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/arrow-up-right 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.

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)

circle-info

In the links above, they launch MPI using a scriptrun.py . Using salloc to launch MPI is also OK.

Last updated