[petsc-users] On what condition is useful MPI-based solution?

Takuya Sekikawa sekikawa at msi.co.jp
Wed Jan 13 03:21:06 CST 2010


Hi Jose,
Thank you for very quick reply.

On Wed, 13 Jan 2010 09:50:57 +0100
"Jose E. Roman" <jroman at dsic.upv.es> wrote:

> On 13/01/2010, Takuya Sekikawa wrote:
> 
> > Dear SLEPc/PETSc team,
> > 
> > I tried to run SLEPc's samples program ex1 in MPI-based multi-PC
> > environment. (1-PC vs 2-PCs)
> > 
> > (ex)
> > [running ex1 in only 1 PC]
> > ----------------------------------------------------------
> > $ time -p mpiexec -n 1 ./ex1 -n 4000 -eps_max_it 10000
> > ...
> > real 76.2
> > ----------------------------------------------------------
> > says, ex1 took 76.2 seconds.
> > 
> > next, I run same sample in 2 PCs environment.
> > 
> > [running ex1 in 2 PCs]
> > ----------------------------------------------------------
> > $ time -p mpiexec -n 2 ./ex1 -n 4000 -eps_max_it 10000
> > ...
> > real 265.54
> > ----------------------------------------------------------
> > I got 265.54 seconds. (slower than single PC)
> > 
> > [Q1]
> > Can ex1 sample speed up with MPI?, if so, generally on what condition?
> 
> Yes. The same example on my desktop computer (Intel Core 2 Duo):
> With -n 1 --> real 33.99
> With -n 2 --> real 21.90
> If you simply have two PCs connected via a slow network, then you cannot expect good speedup. Try in a cluster with fast network.
> On the other hand, a better way to measure the parallel execution time is to edit the source file and put PetscGetTime around the Solve call. 

Thank you for benchmarking on your environment.
that result is quite useful for me.
Certainly my current test network is not fast.
Probably that is the problem. thank you.

> > [Q2]
> > Generally, Is MPI only useful in very large matrix?
> > Now I have to solve eigenvalue problem of 1M x 1M matrix,
> > Should I use MPI-based system?
> 
> For a 1 million matrix I would suggest to run in parallel on an MPI cluster. However, a single computer might be enough if the matrix is very sparse, you need very few eigenvalues, and/or the system has enough memory (but in that case, be prepared for very long response times, depending on how your problem converges).

Also this advice is really meaningful to me, thank you so much!

Takuya

> Jose
> 
> > 
> > Thanks,
> > Takuya
> > ---------------------------------------------------------------
> >  Takuya Sekikawa
> >         Mathematical Systems, Inc
> >                    sekikawa at msi.co.jp
> > ---------------------------------------------------------------
> > 
> 

---------------------------------------------------------------
    Takuya Sekikawa
         Mathematical Systems, Inc
                    sekikawa at msi.co.jp
---------------------------------------------------------------




More information about the petsc-users mailing list