Running MPICH program
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.

How to compile MPI program
Here we will use mpi_hello_world in https://mpitutorial.com/tutorials/ as an example.
SSH to node-1
You can login node-1 by using your CSE account just like linux9.
Clone the mpitutorial git repository
Compile the mpi_hello_world using mpicc
Instead of using gcc, we use mpicc such that the mpich library is linked.
Now you should get the executable mpi_hello_world
Run MPI program in CSCI4160 cluster using SLURM
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
MPICH Programming
I suggest you go through the tutorials below, which will help you a lot in Asgn1c.
Last updated
Was this helpful?