mpiexec running liggghts in Win7

Submitted by rahulsoni on Tue, 06/10/2014 - 16:20

Hi I have installed mpich2 with process outlined below. LIGGGHTS in installed by following the process outlined in https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/wiki/Installing-LIGGGHTS...

.bashrc configuration
alias liggghts='"/cygdrive/c/Program Files/MPICH2/bin/lmp_fedora"' (as per suggestion copied lmp_fedora to mention dir. Individually this is also working)
alias mpirun=/cygdrive/c/cygwin/bin/mpirun
alias mpiexec='"/cygdrive/c/Program Files/MPICH2/bin/mpiexec"'
alias smpd='"/cygdrive/c/Program Files/MPICH2/bin/smpd"'
export WM_NCOMPPROCS=2

MPICH2 installation
Uninstall previous version of MPICH2
Open an admin command prompt by right-clicking on the command prompt icon and selecting "run as administrator"
Run "msiexec /i mpich2-1.3.2p1-win-ia32.msi" from the admin command prompt to install MPICH2
During installation select that MPICH2 be installed for "Everyone" for all users.
Run wmpiconfig and store username/password. EDIT: Use your REAL windows login name and password.
Add "C:\Program Files\MPICH2\bin" to system Path and EDIT: no need to reboot
Check smpd using 'smpd -status'. it should return 'smpd running on $hostname$'
To test execution environment, go to the directory $MPICHROOT\examples and run cpi.exe using: 'mpiexec -n 4 cpi' (this is also working for me)

Everything is working fine individually. LIGGGHTS is able to simulate. mpiexec is working. smpd -status returns that service is running.
But I am trying every other possibility to run liggghts with something like below. But no luck...
mpiexec -n 2 liggghts -in in.packing
mpiexec -n 2 /cygdrive/c/LIGGGHTS-PUBLIC/src/lmp_fedora -in /cygdrive/c/LIGGGHTS-PUBLIC/examples/LIGGGHTS/TutorialsPublic/packing/in.packing
and every other possibility.

Can anyone give any clue to resolve the issue.

rberger's picture

rberger | Tue, 06/10/2014 - 18:06

Seems like you are trying to run a LIGGGHTS binary, compiled with OpenMPI, using MPICH2. These are two different MPI implementations! You can't mix the two. If you compile a binary inside of cygwin, you will have to run it using mpirun from OpenMPI inside of Cygwin.

rahulsoni | Wed, 06/11/2014 - 07:17

I tried running with mpitun also. All option all alternative... but no luck.
This is what I am getting...

Rahulhp430@Rahulhp430-PC /cygdrive/c/LIGGGHTS-PUBLIC/src
$ mpirun -n 2 lmp_fedora -in /cygdrive/c/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/packing/in.packing
-------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

Process name: [[33381,1],0]
Exit code: 65
--------------------------------------------------------------------------

Rahulhp430@Rahulhp430-PC /cygdrive/c/LIGGGHTS-PUBLIC/src
$

This is my bash_rc config

alias mpirun=/cygdrive/c/cygwin/bin/mpirun
alias mpiexec='"/cygdrive/c/Program Files/MPICH2/bin/mpiexec"'
alias smpd='"/cygdrive/c/Program Files/MPICH2/bin/smpd"'
export WM_NCOMPPROCS=2
alias liggghts=/cygdrive/c/LIGGGHTS-PUBLIC/src/lmp_fedora
export LD_LIBRARY_PATH=/usr/lib/:$LD_LIBRARY_PATH
alias mpirun=/cygdrive/c/cygwin/bin/mpirun

Can you tell me any weblink or any guide which can tell me to how to use mpirun to run liggghts...

Thanks in advance

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

rberger's picture

rberger | Wed, 06/11/2014 - 12:44

Had a quick look. Not an MPI issue. If you run it this way, it should also crash even without mpirun or mpiexec. That's because the script will crash with the following error:

ERROR on proc 0: Cannot open dump file (../dump.cpp:478)

There is no post folder in the src/ directory. The script is trying to open a new file in a post folder, inside your current working directory.
You must change your working directory to the example folder! E.g.

cd /cygdrive/c/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/packing/
mkdir post # in case it does not already exist
mpirun -n 2 /cygdrive/c/LIGGGHTS-PUBLIC/src/lmp_fedora -in in.packing

BTW: mpirun and mpiexec aliases in your bashrc should not be necessary. If you installed it via Cygwin Setup it should work out of the box.

Cheers,
Richard

rahulsoni | Wed, 06/11/2014 - 15:06

I tried that one its not working. Plz see below.

Rahulhp430@Rahulhp430-PC /cygdrive/c/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/packing
$ mpirun -n 2 /cygdrive/c/LIGGGHTS-PUBLIC/src/lmp_fedora -in in.packing
-------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

Process name: [[32833,1],0]
Exit code: 65
--------------------------------------------------------------------------

Rahulhp430@Rahulhp430-PC /cygdrive/c/LIGGGHTS-PUBLIC/examples/LIGGGHTS/Tutorials_public/packing

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

msandli | Wed, 06/11/2014 - 17:56

I am monitoring this thread with interest. Getting the same error message as above. Thought problem might be because I have both a serial and parallel executable in the same liggghts directory, but this thread makes me thing something else is going on.

rberger's picture

rberger | Thu, 06/12/2014 - 01:59

Ok, I'm able to reproduce this behaviour on a Windows 8 system. Just updated Cygwin.
Unfortunetly this also happens with other applications. So it's not LIGGGHTS specific.
Seems to be a cygwin + OpenMPI issue...

However I was able to get it to work inside of cygwin using a source compiled version of MPICH2.
Note this is different from what you were trying to do with MPICH2. Maybe I'll find some time to write a guide later, right now we're a bit preoccupied with our imminent LIGGGHTS 3.0.2 release...

Cheers,
Richard

rahulsoni | Thu, 06/12/2014 - 06:44

Hope to get that guide ASAP...

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

rberger's picture

rberger | Thu, 06/12/2014 - 20:46

I've updated https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/wiki/Installing-LIGGGHTS.... Uninstall OpenMPI from Cygwin (run the setup again and deselect the OpenMPI packages) and then follow the MPICH instructions. After compiling, installing and setting the PATH variable, you should be able to compile LIGGGHTS with "make fedora" and use mpirun from MPICH.

Hope this helps.

Cheers,
Richard

msandli | Fri, 06/13/2014 - 05:18

linux newbie here. do you have to uninstall and reinstall liggghts for this to work? i have a currently working version of ./lmp_serial, and ./lmp_fedora "exists" except for not being recognized by mpirun.

rahulsoni | Mon, 06/23/2014 - 12:08

Hi Richard

Everything is working fine. Just one more query. Is there any way to compile liggghts with jpeg support in windows.

I have tried modifying the makefile such as:

LMP_INC = -DLAMMPS_GZIP -DLAMMPS_JPEG
JPG_INC = -I/usr/include
JPG_PATH =
JPG_LIB = -ljpeg

However, its not working...

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

rberger's picture

rberger | Sun, 07/06/2014 - 17:43

Did you install the libjpeg-devel package in Cygwin?

Cheers,
Richard

rahulsoni | Mon, 07/07/2014 - 17:05

Yes, I installed it. But no luck. I think issue is related with the VTK support. I haven't installed liggghts without vtk support.

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

rahulsoni | Tue, 09/09/2014 - 16:31

Hello Richard

With the continued community effort, we are building and sharing tools which help people grow with their research. In the continuation, I have written a small code for windows that converts the dump files to vtk format. The link for the instruction to setup and use are outlined at http://www.cfdem.com/forums/dump2vtk-converter-windows

I would request you to please paste the link some appropriate title in the liggghts installation in windows page https://github.com/CFDEMproject/LIGGGHTS-PUBLIC/wiki/Installing-LIGGGHTS...

Thanks in advance...

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

sgeerster | Fri, 02/27/2015 - 19:16

Hi Richard,

I realize the installation guide you wrote for Cygwin users says to go with MPICH instead of OpenMPI because the latter is broken; however, if I were to use a working version of OpenMPI, would the directions be identical to those for MPICH, i.e. configure -> make -> make install -> add environment variable to .bashrc, etc?

Thanks,
Steve

rahulsoni | Fri, 06/13/2014 - 11:41

Thanks Richard for promptly updating the guide. Its working fine for me... :)

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

rahulsoni | Fri, 06/13/2014 - 11:43

Hi msandli

Which linux OS you are running on...

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

rahulsoni | Sat, 06/14/2014 - 07:28

Hi Msandli

No need to uninstall liggghts.
Open cygwin terminal cd to liggghts/src.
type make clean-all and enter.

Thereafter, uninstall openmpi,libopenmpi and openmpi-devel from cygwin setup.
Install mpich as suggested by Richard.
Again go to liggghts/src in a cygwin terminal and enter make fedora

--
Regards

Rahul Kumar Soni
Scientist, CSIR - IMMT, India

msandli | Sat, 06/14/2014 - 17:26

Thanks so much for your clear and straight forward instructions, but after taking these steps, here is what shows up on my screen after "make fedora"

In file included from ../pointers.h:24:0,
from ../output.h:17,
from ../output.cpp:17:
../output.cpp: In member function ‘void LAMMPS_NS::Output::reset_timestep(LAMMPS_NS::bigint)’:
../lmptype.h:83:19: error: ‘INT64_MAX’ was not declared in this scope
#define MAXBIGINT INT64_MAX
^
../output.cpp:453:19: note: in expansion of macro ‘MAXBIGINT’
next_dump_any = MAXBIGINT;
^
Makefile:101: recipe for target 'output.o' failed
make[1]: *** [output.o] Error 1
make[1]: Leaving directory '/home/Trap/documents/liggghts/src/Obj_fedora'
Makefile:77: recipe for target 'fedora' failed
make: *** [fedora] Error 2

I recently had trouble trying to "get pull" liggghts 3.0.2, so I don't know if I have some issues because of that. However, I currently have the serial 3.0.1 version working, and my simulations are still quite small (<50k particles) so I might just stick with what I have working.

Thanks again for your help though!

msandli | Mon, 06/16/2014 - 15:27

Thank you SO much for your continued attention to this thread. I didn't know you had to manually alter those files after a git pull. Liggghts 3.0.2 is now installed and running on my machine.