Parallel calculation is slower than single processor

Submitted by alonso on Mon, 01/12/2015 - 10:21

Hello, I've done a few simulations trying with 1, 4 and 8 processors, and I got higher calculation time for 4, and even more, for 8 processors. In the input script, I tried two thing. First I didn't set any parameter for "Processors", and then I try with several combinations. I noticed that I could get better calculation time chosing aproppiate values in "Processors", but it is not better than a single processor. I read the recomendations in the manual where is explained what to do to get better performance. I noticed that the "Other Time" was much higher (60% - 80%) than the others ones, so I uncomented the MPI lines in the "timer.cpp" file, and recompile, but I can't get faster simulations. ¿Does somebody know what to do?

PD: I tried the example in.conveyor, and another simulation that I created. I got the same behaviour.

Regards!

nasato | Mon, 01/12/2015 - 10:33

Hi alonso,

i think in this small case the time spent by the processors communicating to each other is bigger than the speed gain of using multiprocessor simulation.

Try with bigger cases with more particles. I guess you will then notice the difference.

Cheers,

Nasato

ckloss's picture

ckloss | Wed, 01/14/2015 - 18:39

Hi,

>>PD: I tried the example in.conveyor, and another simulation that I created. I got the same behaviour.
The conveyor testcase is simply way too small! As a rule of thumb, if each process has 10-20k particles, you can expect good scalability

Best wishes
Christoph

NTT1508 | Thu, 01/15/2015 - 00:20

Hi,

I am concerning computing efficiency with the function of "processors" command too. In my case, I donot have a big number of particles (around 1000 to 3000) however the particle size and time step are extremely small (5.e-5; 1e-8 respectively). To run simulation, I need a total 2.e+7 (dt) (cost me 3 hours just for 620 particles). So in this case, problem is not related to a large scale of particles. Do you think optimizing communication among processors is workable here?

I try to set 'processors' command: processors * * * grid onelevel map cart/reorder; but when I check system monitoring, there is always only one of 8 processor working (100% resource) while others nearly not. Did I miss something around?

Thanks,

Regards,

Nathan,

ckloss's picture

ckloss | Thu, 01/15/2015 - 10:48

>>In my case, I donot have a big number of particles (around 1000 to 3000)
Then run on 1 process, everything else is not feasible!

Christoph

alonso | Mon, 01/19/2015 - 04:54

Thank you for the answers!. Finally I could get a great improvement in the simulations, some of them with many particles (20K - 50K), and even with small quantities (4K). I would like to register what I did, maybe it could help someone else. I don't know what were the more important factors in the things that I did trying to improve the performance (maybe some of them were not necessary).

1) Install the latest public version of liggghts, the latest version of MPICH, and FTTW2.
2) Compile LIGGGHTS using "make openmpi" (I'm working with Ubuntu 14.04 LTS), before I had used "fedora".
3) Run the simulations with: mpiexec -n (number of processors) liggghts < in.(name of file)
4) When is possible, I set manually the parameters in "processors" thinking on get a balanced grid depending the way that describes the particles. The distribution of particles, is no always related with the size of the scene, and liggghts seemed to choose the best spatial distribution, but sometimes it doesn't mean a good balance load in processors, that is related with the position of the particles. (I'm not sure about this, but it make sense when i evaluated the performance in different cases)

Regards!

govind | Fri, 07/21/2017 - 13:11

I am also facing the issue of slow simulation in parallel and followed your steps but When i do "make openmpi" i get following error :

/usr/bin/ld: cannot find -lfftw
collect2: error: ld returned 1 exit status
Makefile:86: recipe for target '../lmp_openmpi' failed
make[1]: *** [../lmp_openmpi] Error 1
make[1]: Leaving directory '/home/dhiraj/LIGGGHTS-PUBLIC3.6.0/src/Obj_openmpi'
Makefile:72: recipe for target 'openmpi' failed

Previously I have compiled with "make fedora", I did not get any error. I am using ubuntu 16.04LTS.

Can you please suggest me something?

Govind

arnom's picture

arnom | Fri, 07/21/2017 - 13:58

Unless you need fftw remove -lfftw from your makefile. Also it is strongly recommended to upgrade to 3.7 and use "make auto".

DCS team member & LIGGGHTS(R) core developer

NTT1508 | Tue, 01/20/2015 - 12:06

Hi Alonso,

That's sound interesting. I would like to test with my case too. However I am wondering some points on your solution. (1) Might installing new MPICH cause conflict with other type of exisitng MPI in the system? Last time I got problem with MPI wrapper at Thirdparty and Ubuntu's system. (2) Do we really need FFTW2 according to your procedure? what it's function actually? (2) I have not tried compiling LIGGGHTS by "make openmpi", I usually do "make fedora". Could you please give more details about that?

Thank very much. Hope it's good for my simulation too.

Best regards,

Nathan,