CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Error when using mpirun for parallel case (https://www.cfd-online.com/Forums/openfoam-solving/148430-error-when-using-mpirun-parallel-case.html)

mfoster February 11, 2015 16:11

Error when using mpirun for parallel case
 
I have been working through the depthCharge2D tutorial on Win8 using cygwin. I have run decomposePar, and then I run the following to initiate the solve process...

Code:

mpirun -np 4 compressibleInterFoam -parallel > log.compress
The resulting error is:

Code:

--> FOAM FATAL ERROR:
bool IPstream::init(int& argc, char**& argv) : attempt to run parallel on 1 processor

    From function UPstream::init(int& argc, char**& argv)
    in file UPstream.C at line 79.

FOAM aborting

Thinking mpirun was at fault, I ran the following to check:

Code:

mpicc -o hello_c hello_c.c
mpirun -np 4 ./hello_c

After installing the gcc/g++ package, the hello_c test worked just fine. Still having the same error with parallel case above.

Thoughts?

Linse February 13, 2015 09:04

Just for making sure everything went well before the installation was supposed to start, please check the following:
Did the decomposition succeed, i.e. did you have folders processor0 to processor3 in your case-directory afterwards? If not, please check system/decomposeParDict for the correct decomposition settings.

Otherwise: Do you have four processors available at all? Does parallel execution of jobs in general work on your machine? Please simply check with one of the parallel-tutorials, e.g. the incompressible/simpleFoam/motorBike case by using nothing but the Allrun-script.
This way we see if your machine is setup correctly. It should take not more than ten minutes and will exclude at least one potential reason for the failure.

This might seem to be silly questions, but sometimes one misses the simplest things...

Cheers,
Bernhard

mfoster February 14, 2015 16:18

Thank you for your suggestions...I'll get to those either Monday or Tuesday.

In some of my other troubleshooting, I realized wmake wasn't working. Would this make a difference?

I added a source to the etc/bashrc into my home .bashrc that I also realized I needed. When I did this, the wmake command worked, but I lost access to all the solvers!? So, I'll need to add a PATH to the solvers into to .bashrc.

mfoster February 16, 2015 10:06

Ok, I copied the motorbike tutorial to my home directory then ran Allrun. Here is what was displayed in the terminal window:
Code:

cp: cannot stat ‘/resources/geometry/motorBike.obj.gz’: No such file or directory
Running surfaceFeatureExtract on /home/Mike/motorBike
Running blockMesh on /home/Mike/motorBike
Running decomposePar on /home/Mike/motorBike
Running snappyHexMesh in parallel on /home/Mike/motorBike using 6 processes
Running patchSummary in parallel on /home/Mike/motorBike using 6 processes
Running potentialFoam in parallel on /home/Mike/motorBike using 6 processes
Running simpleFoam in parallel on /home/Mike/motorBike using 6 processes
Running reconstructParMesh on /home/Mike/motorBike
Running reconstructPar on /home/Mike/motorBike

It looks like all the $WM_... are not defined. As I mentioned in my previous reply, I think the bashrc references didn't get setup/defined properly during the basic install (I'm using CFDsupport.com's version since I'm running on Windows).

Note: when I run "which icoFoam" the path given is...
/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin/icoFoam

Can you give me some direction? Thanks!

alexeym February 16, 2015 10:55

Hi,

About a problem with "/resources/geometry/motorBike.obj.gz", do you have FOAM_TUTORIALS environment variable set? As Allrun file starts with

Code:

cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
About your initial error, it is just a guess, but it seems mpirun somehow loses -parallel switch. The error you have posted usually happens when you do mpirun without parallel switch. So try to execute command like

Code:

mpirun -np 4 "compressibleInterFoam -parallel" > log.compress
Maybe it is a feature of cygwin's OpenMPI.

mfoster February 16, 2015 15:07

Alexey,

Yes, once I add...
Code:

source /opt/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc
...to my .bashrc file, the Allrun is clean:
Code:

Running surfaceFeatureExtract on /home/Mike/motorBike
Running blockMesh on /home/Mike/motorBike
Running decomposePar on /home/Mike/motorBike
Running snappyHexMesh in parallel on /home/Mike/motorBike using 6 processes
Running patchSummary in parallel on /home/Mike/motorBike using 6 processes
Running potentialFoam in parallel on /home/Mike/motorBike using 6 processes
Running simpleFoam in parallel on /home/Mike/motorBike using 6 processes
Running reconstructParMesh on /home/Mike/motorBike
Running reconstructPar on /home/Mike/motorBike

However, if I try...
Code:

icoFoam -help
-bash: icoFoam: command not found

Therefore, the compressibleInterFoam command will not work now. In addition, if you note in the first post, I did use the parallel switch, but it wasn't in quotes. Are the quotes necessary?

I then tried adding...
Code:

PATH=/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin:${PATH}
...to .bash_profile to get access to the solver's executable file, but I get...
Code:

icoFoam.exe -help
/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/bin/icoFoam.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

Looking through some more material, I noticed that several of the environmental setting are based off of $HOME and it being defined as the OpenFOAM installation location. In my case, $HOME is set as /home/Mike (where the .bashrc file is located) as a result of, I assume, the cygwin installation. The OpenFOAM installation is at /opt/OpenFOAM/OpenFOAM-2.3.x

I'm happy to change/move things around if necessary :)

alexeym February 17, 2015 02:15

Hi,

Well, in fact Allrun script may fail, look in the log-files it created. For example here's Allrun script which tries to execute non-existent utilities:

Code:

#!/bin/sh
cd ${0%/*} || exit 1    # run from this directory

# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions

runApplication blockMeshD
runApplication setFieldsD

when I run it, output is

Code:

alexey at daphne in cavity$ ./Allrun
Running blockMeshD on $FOAM_RUN/cavity
Running setFieldsD on $FOAM_RUN/cavity

while inside log-file:

Code:

$HOME/OpenFOAM/OpenFOAM-2.3.0/bin/tools/RunFunctions: line 52: blockMeshD: command not found
References to $HOME usually appear in messages when people install OpenFOAM in their home-folder.

Also I a little bit mess up messages. In fact this message

Code:

--> FOAM FATAL ERROR:
bool IPstream::init(int& argc, char**& argv) : attempt to run parallel on 1 processor

appears when you try to run application with -parallel switch but without mpirun. So I guess at this point it is necessary to have more information about your OS and the way you've installed OpenFOAM.

mfoster February 17, 2015 09:34

It looks like a few of the log files have the following error:
Code:

--> FOAM FATAL ERROR:
bool IPstream::init(int& argc, char**& argv) : attempt to run parallel on 1 processor

    From function UPstream::init(int& argc, char**& argv)
    in file UPstream.C at line 79.

FOAM aborting

I am running Win8.1 64-bit. For my OpenFOAM installation, I followed these instructions...

http://www.cfdsupport.com/install-op...r-windows.html

...and also added the nano, openmpi, and libopenmpi-devel packages.

alexeym February 17, 2015 09:53

Hi,

I think this http://www.cfd-online.com/Forums/ope...pport-com.html is somehow relevant to your case (or you've already read it, as it is third links in Google search on 'cfdsupport openfoam openmpi'?).

Guess the problem with missing libraries is that you're trying to execute applications in parallel with OpenMPI while applications were compiled with MS MPI.

mfoster February 18, 2015 08:52

Alexey,

That was it! (I may/may not have read that post, but at the time I don't think I would have understood the implications of what was mentioned.)

I also emailed CFD-support and received some feedback. For this particular package, mpiexec.exe takes the place of mpirun. So, for the depthCharge tutorial, it would be...
Code:

mpiexec.exe -n 4 compressibleInterFoam.exe -parallel > log.compress
In addition (as is mention in response #18 at the post you referred to), because of what the OpenFOAM-2.3.x-reg.bat adds to registry, you don't need to source any additional folders in your .bashrc file.

Thanks!

chaiitu2896 July 7, 2015 12:28

thanks it helped really

Quote:

Originally Posted by mfoster (Post 532330)
Alexey,

That was it! (I may/may not have read that post, but at the time I don't think I would have understood the implications of what was mentioned.)

I also emailed CFD-support and received some feedback. For this particular package, mpiexec.exe takes the place of mpirun. So, for the depthCharge tutorial, it would be...
Code:

mpiexec.exe -n 4 compressibleInterFoam.exe -parallel > log.compress
In addition (as is mention in response #18 at the post you referred to), because of what the OpenFOAM-2.3.x-reg.bat adds to registry, you don't need to source any additional folders in your .bashrc file.

Thanks!



All times are GMT -4. The time now is 16:02.