Run MPI

Here we assume that mpich2 is installed on the machines of the cluster.

First, in the home directory, create the file .mpd.conf, and write the following line
secretword=yoursecretword
where yoursecretword can be chosen by the user.
Then type:

chmod +600 .mpd.conf

Let us now suppose that the cluster is composed by 2 nodes, called node1 and node2, with 8 cores each.
If the user wants to launch simulations on 16 cores, then he first has to create a file, e.g. mpd.hosts,
which has the following lines

node1
node1
node1
node1
node1
node1
node1
node1
node2
node2
node2
node2
node2
node2
node2
node2

After that, MPI has to be initialized:

mpdboot -n 2 -f mpd.hosts

Now simulations can be run. If the python script is called scriptMPI.py, to launch the script simply type:

mpiexec.py -n 16 python scriptMPI.py

To deinitialize MPI, type:

mpdallexit

Comments are closed.