Is the "-np" mpirun switch enough for parallel processing?

mdasilva's picture
Submitted by mdasilva on Tue, 12/06/2016 - 21:27

Hi there, I've been experiencing a little bit with LIGGGHTS for the last weeks. I could get the software installed and running. The tutorial and the test cases available were of great help.

Right now my "problem" is how to run a simulation parallelly. I'm aware of the "processors" command and made this change to one of the input files I'm handling:

processors 2 2 2

Besides that, to launch LIGGGHTS I issue this command:

$ mpirun -np 8 /lmp_fedora -in input_file

So, is it enough to get the simulation running parallelly?

I've been checking around to get more information on this. After the installation I got the lmp_fedora command (I got this one by following the "Installation Instructions" - http://www.cfdem.com/installation-tutorial), nevertheless I also found some resources on the web suggesting to issue "make openmpi" instead of "make fedora".

Using "make openmpi" gives me a "new" command: lmp_openmpi.

Is this one the same as lmp_fedora?

Will it change the performance of a simulation (given I don't change the "processors" command and pass mpirun the same options).

Greetings.

aaigner's picture

aaigner | Wed, 12/21/2016 - 14:36

Hello mdasilva!

First of all: Yes, that is all what you need for a parallel simulation. ('processors' command and 'mpirun -np NPROCS ...')

Don't get confused by all this different Makefiles that you can use via 'make FEDORA or OPENMPI or ...'
Most of them have nearly no differences except the location of the linked libraries and enabled/disabled debug-flags. (They are all located in src/MAKE/.. - if you are interested in makefiles) Concerning parallel simulations it is only important that LIGGGHTS is linked to the correct openmpi libraries (which are usually in your system path and not defined explicitly) .
That said, if the compilation worked with 'make fedora', just keep this.

I made a quick comparison between Makefile.fedora and Makefile.openmpi:

  • Fedora uses O2 and Openmpi uses only O. This defines the optimization level. Thus fedora should be faster.
  • They will output different compiler warnings ... this doesn't change the performance... just FYI
  • Openmpi defines the FFT_FFTW3 flag. I am not sure, which class/function/pair_style is using them. I assume nothing important for LIGGGHTS

That's it.. there is nothing else.

Best wishes
Andreas