CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   mpirun trouble (https://www.cfd-online.com/Forums/openfoam-installation/78405-mpirun-trouble.html)

vaina74 July 21, 2010 06:01

mpirun trouble
 
Hi everybody. Yesterday I made a fresh installation of OpenFOAM-1.7 and today I ran a tested case. I had a mpirun problem:
Code:

foamJob -p -s simpleFoam
Parallel processing using SYSTEMOPENMPI with 2 processors
Executing: mpirun -np 2 /opt/openfoam170/bin/foamExec simpleFoam -parallel | tee log
Error : bashrc file could not be found for OpenFOAM-
Error : bashrc file could not be found for OpenFOAM-

How can I fix it?
My o.s. is Ubuntu 10.04.

wyldckat July 21, 2010 06:32

Hi Maurizio,

:eek: nice catch! That's another bug :) So feel free to report it :)

The quickest fix is this:
Code:

sudo ln -s openfoam170 /opt/OpenFOAM-1.7.0
Or this one also works:
Code:

sudo ln -s /opt/openfoam170 /opt/OpenFOAM-1.7.0
The script foamExec assumes this premise:
Quote:

Originally Posted by foamExec
# This script should exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
# extract the <foamInstall> and <version> elements
# using a function preserves the command args

In other words, the script does not take into account the folder format that the debian package installs. I.e., the nomenclature openfoam170 isn't compatible with the script's search mechanism! OpenFOAM-1.7.0 on the other hand is compatible :)

Best regards,
Bruno

PS: I've hit 500 posts with this post :cool:

vaina74 July 21, 2010 06:55

Hi, Bruno.

I hoped you were around here :-)
I ran in the terminal your second hint and - I'm not so expert - it means that a folder named OpenFOAM-1.7.0 is created, linking to openfoam170. But something doesn't work and I still have the same output when launching foamJob. Have I to make any trivial thing (I already opened a new terminal), like rebooting the computer or create again a 'run' folder (I already had HOME/OpenFOAM/user-1.7.0/run)?

Thanks for your help.

wyldckat July 21, 2010 07:05

Hi Maurizio,

Oops, I forgot one thing... You will have to edit your file "~/.bashrc" and change the line:
Code:

. /opt/openfoam170/etc/bashrc
To:
Code:

. /opt/OpenFOAM-1.7.0/etc/bashrc
I didn't remember the script needs to be executed from the pertinent folder...

As for using the symbolic link: I think it's the best option, since this way when OpenCFD updates the debian package, you'll have your installed version automatically updated too :)

Best regards,
Bruno

vaina74 July 21, 2010 07:26

I edited the ~/.bashrc file and inserted
Code:

# OpenFOAM
. /opt/OpenFOAM-1.7.0/etc/bashrc

but it still doesn't work :-(

wyldckat July 21, 2010 08:45

Ooook... I had to install it and test it for myself. The fixes above apparently are worthless :(

The fix that worked for me right now was to edit the file /opt/openfoam170/bin/foamJob:
Code:

gksu gedit /opt/openfoam170/bin/foamJob
Then go to the end of the file and where you find:
Code:

mpirun $mpiopts $APPLICATION $@ -parallel
Remove the "$APPLICATION" part and save and close.


You better report this, because this is on annoying bug :( I tried to fix the file foamExec, but it never wanted to work :(

Best regards,
Bruno

vaina74 July 21, 2010 09:50

Bruno,

thank you very much for your temporary fix trick. I need OpenFOAM now, I couldn't wait for a definitve solution. I already posted a thread in the OF bugs section of the forum, just a link to this forum.
Thanks again for your quick help. Best regards.


All times are GMT -4. The time now is 07:03.