Running MPICH program
Last updated
Was this helpful?
Last updated
Was this helpful?
MPICH is one of the most popular implementations of MPI.
In this tutorial, we aim to introduce that in a CSCI4160 cluster with 3 machines: node-1
, node-2
, and node-3
.
Here we will use mpi_hello_world
in https://mpitutorial.com/tutorials/ as an example.
You can login node-1
by using your CSE account just like linux9.
Instead of using gcc
, we use mpicc
such that the mpich library is linked.
Now you should get the executable mpi_hello_world
We have setup a small SLURM cluster consists of node-1
, node-2
and node-3
. Use salloc
command to launch your mpi program on that cluster:
salloc -N 3 mpirun ./mpi_hello_world
-N 3
: request 3 nodes from the cluster
You can see that there are 3 Hello world messages from 3 processors with different hostnames: node-1 node-2 node-3
I suggest you go through the tutorials below, which will help you a lot in Asgn1c.
Name
link
MPI Send and Receive
Dynamic Receiving with MPI_Probe (can help to query the number of permissible points on another machine)
Custom MPI data type (you may use this to ship struct point
datatype)
In the links above, they launch MPI using a scriptrun.py
. Using salloc to launch MPI is also OK.