CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Parallel Computing in a local network (

ray June 11, 2013 07:05

Parallel Computing in a local network
Hi dear FOAMers,

I want to use two computers in a local network in order to make my calculations in OpenFOAM 2.2 much faster.
I wish to run the calculations from cfd4 on the machines cfd3 and cfd4, which both have 4 processors (cpu), that means I want to use 8 cpus for the calculation. By the way I got the names of the computers by typing hostname in the terminal. The operating system on both computers is Kubuntu 12.04.
In order to run applications in parallel I followed the instructions given by .
So I first of all wrote the file "decomposeParDict" in order to break up the geometry and the field of my calculation in 8 subdomains. Afterwards I have written the file machines.
After creating the mesh and decomposing my mesh and field on cfd4 I typed

mpirun -hostfile machines -np 8 sprayFoam -parallel > log &

in order to get the process using the sprayFoam solver started.
Unfortunately I get the following error:

mpirun was unable to launch the specified application as it could not find an executable:
Executable: sprayFoam

while attempting to start process rank 4.

I know that process rank 0 to 3 belong to cfd4 and process rank 4 to 7 belong to cfd3, that means that he cannot find the executable on cfd3.
Can anybody help me through this problem?

I would be very pleased for any hint. Thank you very much in advance.

best regards


voingiappone June 28, 2013 03:51

Hello Ray,

I had a very bad experience using OF on multiple machines so I started this thread.
I was mixing architectures and eventually I gave up. But! If you go through the thread there is a lot of troubleshooting related to mpirun you may be lucky enough to find your problem by following wyldckat's suggestions.

Hope it helps!

onyir June 28, 2013 05:54

Hi Ray,

As far as I know, to be able to run in a local network, you have to:

1. Have the OpenFOAM installed in all the nodes you are willing to use, or in a shared (nfs) unit.
2. Have your user load the OpenFOAM environment by default by adding
source /path/to/foam_install_dir/etc/bashrc
to your ~/.bashrc
3. Have passwordless login by ssh to the nodes.

ray July 1, 2013 10:00

Hey guys thanks for your answer.

Dear onyir,

could you please describe in more detail point 2. Where shall I add this line and to which directory should it refer?

best regards


onyir July 1, 2013 10:08

Hi ray,

In order to use OpenFOAM, you have to load the environment by sourcing the configuration file.
For example, if you have OpenFOAM-2.2.0 installed in your home directory, you'll have to do
. /home/user/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc
source /home/$user/OpenFOAM/OpenFOAM-2.2.0/etc/bashrc

To do that automatically for your user, you have to add that line (updating your OpenFOAM installation directory and version) to the file

ray July 1, 2013 10:13

i found my bashrc file in the following directory:


So do i have to add source/opt/openfoam220/etc/bashrc in the first line of my .bashrc - file?

best regards

onyir July 1, 2013 10:16

You can add that line at the end of your .bashrc

ray July 1, 2013 10:19

oh now I know what you mean, but I already had that line added :(

ray July 1, 2013 10:23

i still get the same error:

mpirun was unable to launch the specified application as it could not find an executable:

Executable: sprayFoam

while attempting to start process rank 4.

All times are GMT -4. The time now is 01:44.