CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Error when using mpirun for parallel case

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 3 Post By mfoster

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2015, 17:11
Default Error when using mpirun for parallel case
  #1
New Member
 
Mike Foster
Join Date: Feb 2015
Posts: 12
Rep Power: 11
mfoster is on a distinguished road
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?

Last edited by mfoster; February 11, 2015 at 19:05. Reason: Additional background info on my troubleshooting effort
mfoster is offline   Reply With Quote

Old   February 13, 2015, 10:04
Default
  #2
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
Linse is on a distinguished road
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
Linse is offline   Reply With Quote

Old   February 14, 2015, 17:18
Default
  #3
New Member
 
Mike Foster
Join Date: Feb 2015
Posts: 12
Rep Power: 11
mfoster is on a distinguished road
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 is offline   Reply With Quote

Old   February 16, 2015, 11:06
Default
  #4
New Member
 
Mike Foster
Join Date: Feb 2015
Posts: 12
Rep Power: 11
mfoster is on a distinguished road
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!
mfoster is offline   Reply With Quote

Old   February 16, 2015, 11:55
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Old   February 16, 2015, 16:07
Default
  #6
New Member
 
Mike Foster
Join Date: Feb 2015
Posts: 12
Rep Power: 11
mfoster is on a distinguished road
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
mfoster is offline   Reply With Quote

Old   February 17, 2015, 03:15
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Old   February 17, 2015, 10:34
Default
  #8
New Member
 
Mike Foster
Join Date: Feb 2015
Posts: 12
Rep Power: 11
mfoster is on a distinguished road
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.
mfoster is offline   Reply With Quote

Old   February 17, 2015, 10:53
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Old   February 18, 2015, 09:52
Default
  #10
New Member
 
Mike Foster
Join Date: Feb 2015
Posts: 12
Rep Power: 11
mfoster is on a distinguished road
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, acs and Deagle like this.
mfoster is offline   Reply With Quote

Old   July 7, 2015, 13:28
Default
  #11
New Member
 
chaitanya bhatraju
Join Date: Jun 2015
Posts: 7
Rep Power: 10
chaiitu2896 is on a distinguished road
thanks it helped really

Quote:
Originally Posted by mfoster View Post
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 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pressure instabilities with interDyMFoam for the floatingObject case nbadano OpenFOAM Running, Solving & CFD 15 October 15, 2021 07:35
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 53 February 16, 2020 16:13
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 9 August 16, 2015 15:53
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Turbulent Flat Plate Validation Case Jonas Larsson Main CFD Forum 0 April 2, 2004 11:25


All times are GMT -4. The time now is 17:42.