skip to content

MPI library

Instructions for users: 

You need to load the module. MPICH jobs are launched with the 'mpiexec' program, so for example to run a simple program over four processes on the local machine you'd do something like this:

cen1001@titan:~$ module add mpi/mpich2/gnu/1.4.1p1
cen1001@titan:~$ mpicc -o mpi_hello mpi_hello.c
cen1001@titan:~$ mpiexec -n 4 ./mpi_hello
Hello world, I am process 0 of 4
My host name is titan
Hello world, I am process 2 of 4
My host name is titan
Hello world, I am process 3 of 4
My host name is titan
Hello world, I am process 1 of 4
My host name is titan

There are manpages and there's lots online at the MPICH homepgae above. You may find it useful to know that MPICH has changed its name a few times over its life. Originally there was MPICH, then a new version was written called MPICH2 which incorporated the MPI-2 standard. The old MPICH was renamed MPICH1 and its last version was 1.2.7. MPICH2 got to version 1.5 and then was renamed MPICH, and the version number changed to 3.0. So 'MPICH 1.2.7' is older than 'MPICH2 1.5' which is older than 'MPICH 3.0'.

Admin notes: 

You must specify the compilers when building if you have more than one set loaded or it may find ones that you don't want:

 ./configure CC=gcc CXX=g++ FC=gfortran F77=gfortran --prefix=/whatever make make install 

System status 

System monitoring page

Can't find what you're looking for?

Then you might find our A-Z site index useful. Or, you can search the site using the box at the top of the page, or by clicking here.