CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Help: Serial code to parallel but even slower (https://www.cfd-online.com/Forums/main/15068-help-serial-code-parallel-but-even-slower.html)

Zonexo April 13, 2008 04:51

Help: Serial code to parallel but even slower
 
Hi,

I've a serial 2D CFD code. As my grid size requirement increases, the simulation takes longer. Also, memory requirement becomes a problem. Grid size 've reached 1200x1200. Going higher is not possible due to memory problem.

Currently, I'm using the PETSc solver which is a parallel MPI solver, to solve the momentum and poisson eqn.

I tried to convert my code to a parallel one but after restructuring and enabling the parallel mode of the solver, I found that it is much slower, although the answer is correct.

I wonder what I should do to check what's wrong. Btw, is a grid size of 1200x1200 suitable for parallel run of 4 processors? I read that if grid is too small, it may be inefficient.

Thank you.

cfd_newbie April 13, 2008 10:08

Re: Help: Serial code to parallel but even slower
 
From my experience a small problem like yours won't scale very nice on multiple machines because the communications will take longer than the calculations. Try to run the same problem on a dual/quad core machine and if your code is correct it will run faster.


Dominic April 13, 2008 10:47

Re: Help: Serial code to parallel but even slower
 
From my experience, I dont think 1200 x 1200 ( ~ 1.4 Million Unknowns ) is a small problem. You should get a speedup. Try timing the Poisson equation part only and see if you get a speed up.. -Dominic

Praveen. C April 14, 2008 03:38

Re: Help: Serial code to parallel but even slower
 
Which mpi implementation are you using ? If you have access to different mpi like mpich, mpich2, openmpi, lammpi, then try compiling with others and check. In our experience, we found mpich2 to give poor performace which was dramatically improved when we used openmpi.

agg May 14, 2008 10:26

Re: Help: Serial code to parallel but even slower
 
Have you tried OpenMP? This is an easier option i.e less work involved. You could try automatic parallelization as a first step.

As for the MPI code, there are tools available such as vampir and jumpshot to analyze the code and see why it is slow.


All times are GMT -4. The time now is 03:56.