This section describes how to run OpenFOAM cases in parallel using MPI/MPICH
rather than LAM, as described in subsection 3.4.2.
The invocation of MPI/MPICH differs whether or not the application that is
being executed has the same pathname on all processor nodes. The pathname to
the executable can differ if:
the processors do not all belong to the same UNIX/Linux architectures;
there is no networked file system (NFS) access to the executable from
all nodes and therefore it is installed in a different place on different
nodes.
On a single machine in which the processor nodes are
all local to the user, the following command should be
executedThis command executes mpirun in the background which does not work for SGI mpirun;SGI users must therefore omit the final & in this and later mpirun commands. ,
noting that ` is a backwards quotation character, typically found at the top left of
the keyboard (not a '):
where: <nProcs> is the number of processors; <foamExec> is the
executable, e.g. icoFoam; and, the output is redirected to a file named log.
For example, if icoFoam is run on 3 nodes on the cavity tutorial in the
$OpenFOAM_RUN/tutorials/icoFoam directory, then the following command should be
executed:
This is the same as before except that there is the <machinesFile> file that
contains the names of the nodes, one per line, with the first one being the machine
that the user is currently logged onto. A <machinesFile> is a file read by
MPICH and therefore requires no header, only the names of the machines
and number of processors to be used on each machine. For example, to
run one process on machine arp and two on noddy, the file would be:
arp:1 noddy:2
Note: optimisation of the performance on a cluster of machines with shared
memory may require recompiling of the MPICH library. See the MPICH
documentation on how to do this or contact Nabla Ltd.
To run an executable with a different pathname on different nodes requires the
same version of OpenFOAM to be installed on all nodes and the ability to run using
rsh. The latter can be tested by trying to execute an application, e.g. icoFoam, on
all nodes:
rsh <machineName> icoFoam <root> <case>
Different pathnames of executables can be specified through a <p4pgFile> file
containing the names of nodes and the respective pathname to the executable. For
example to run icoFoam on machine arp, a Linux machine, and on noddy,
a Solaris machine, the <p4pgFile> would contain the following entries:
The second entry per line, here 0 and 1, are the number of additional processes
per machine. Since the MPI run is started from arp the master process runs on it
and no additional processes should be started on it. The job is run by executing