On ATS-hosted clusters we use the following implementations of MPI: MPICH and MPICH2 from Argonne National Lab for Ethernet, MVAPICH1 and MVAPICH2 from The Ohio State University for Infiband and, the MPI from Myricom, for Myrinet.
| Network | MPI 1 | MPI 2 |
| Ethernet | MPICH1 | MPICH2, Open MPI |
| InfiniBand | MVAPICH1 | MVAPICH2, Open MPI |
| Myrinet | Myricom |
| Cluster | Networks | MPI Implementations | Compilers | Defaults |
| Hoffman2 |
Infinband Ethernet |
MVAPICH2, Open MPI MPICH2 |
Intel | Open MPI and Intel |
| Cardio | Myrinet | Myricom | Intel | Myricom and Intel |
| CNSI2 | Ethernet | MPICH1 | PathScale | MPICH1 and PathScale |
| Hydro |
Infinband Ethernet |
MVAPICH1 and MVAPICH2 MPICH1 and MPICH2 |
Intel | MVAPICH2 and Intel |
| Neutrino | Ethernet | MPICH1 | Intel | MPICH1 and Intel |
MPI-1 is deprecated and MPI-1 implemtations, including MPICH1, are no longer under development.
The default combination for a cluster has been selected to give you the best performance with the hardware/software available on that cluster. Only set your path as described in this section to use an MPI version/compiler combination other than the default.
To use a version of MPI/compiler combination other than the default, add the appropriate compiler path as shown in the table below IN FRONT of your PATH environment. For the bash shell:
export PATH=pathToAdd:$PATHFor the tcsh shell:
setenv PATH pathToAdd:${PATH}You can only select an MPI/compiler combination that is available on the cluster you are using. See the table above.
|
MPI Implementation
Compiler |
Add this path to the front of your PATH |
|
MVAPICH1
Intel PathScale Portland Group Nag |
/u/local/mpi/mvapich1/current/bin /u/local/mpi/pathscale/mvapich1/current/bin /u/local/mpi/pg/mvapich1/current/bin /u/local/mpi/nag/mvapich1/current/bin |
|
MVAPICH2
Intel PathScale Portland Group Nag |
/u/local/mpi/mvapich2/current/bin /u/local/mpi/pathscale/mvapich1/current/bin /u/local/mpi/pg/mvapich1/current/bin /u/local/mpi/nag/mvapich1/current/bin |
|
MPICH1
Intel PathScale Portland Group Nag |
/u/local/mpi/mpich1/current/bin /u/local/mpi/pathscale/mpich1/current/bin /u/local/mpi/pg/mpich1/current/bin /u/local/mpi/nag/mpich1/current/bin |
|
MPICH2
Intel PathScale Portland Group Nag |
/u/local/mpi/mpich2/current/bin /u/local/mpi/pathscale/mpich2/current/bin /u/local/mpi/pg/mpich2/current/bin /u/local/mpi/nag/mpich2/current/bin |
|
Open MPI
Intel |
/u/local/mpi/openmpi/current/bin |
The following commands are used to compile/link mpi programs. The commands are the same no matter what MPI version, interconnect, and compiler you are using. If you have not modified your path, as described above, you will get the default MPI version, interconnect and compiler for the cluster you are using. Otherwise, what you get will be determined by how you have set your path.
| Language | Command Used to Compile |
| Fortran 77 | mpif77 |
| Fortran 90 | mpif90 |
| C | mpicc |
| C++ | mpiCC |
Examples:
- mpif90 -o myprog myprog.f90
- Compiles myprog.f90 and creates the myprog executable.
- mpicc -c myprog.c
- Compiles myprog.c and creates the myprog.o object file.
- mpiCC -o myprog myprog.o
- Links the C++ object file myprog.o with the appropriate MPI libraries and creates the myprog executable.
There are three ways to submit an MPI batch job to the Hoffman2 Cluster. They are from easiest to hardest:
mpi.q
Instructions are given in Running a Batch Job on an ATS-Hosted Cluster.
NOTE: Not all clusters have interactive nodes. You can only debug an MPI program interactively on clusters that do.
While you can DEBUG or TEST a parallel program for a short time on the interactive nodes of an ATS-hosted cluster, you cannot run a full run on the interactive nodes. After testing, a parallel program must be submitted to the SGE batch queuing system to run on the compute nodes.
To test a parallel program ssh to one of the interactive nodes, and follow the instructions for the version of MPI you are using.
MPI 2 (using MPICH2 or MVAPICH 2)
Create a host file with one line for each process to be run excluding the local host where you are currently logged on. For example, on the Hoffman2 Cluster the interactive nodes are named i01 and i02 and you are logged into i01. You could create a host file named hostfile with the following commands:
echo "i01:4" > hostfile
echo "i02:4" >> hostfile
Where 4 is due to the fact that i01 and i02 both have 4 processors. Then issue the following commands to run the program:
mpdboot --ncpus=4 -n 2 -f hostfileReplace hostfile with the name of your hostfile and pathToExecutable with the name of your executable (relative or full path).
mpiexec -n 8 pathToExectutableAfter your program has completed enter:
mpdallexitto clean up and release the hosts.
MPI 2 (using Open MPI)
Create a host file with one line for each process to be run excluding the local host where you are currently logged on. For example, on the Hoffman2 Cluster the interactive nodes are named i01 and i02 and you are logged into i01. You could create a host file named hostfile with the following commands:
echo "i01 slots=4" > hostfile
echo "i02 slots=4" >> hostfile
Where 4 is due to the fact that i01 and i02 both have 4 processors. Then issue the following commands to run the program:
mpirun -machinefile hostfile -np 8 pathToExecutable < input > outputMPI 1
Create a host file indentically to the way you would for MPI 2. Then issue the command:
mpirun -machinefile hostfile -np 8 pathToExecutable < input > outputReplace hostfile with the name of your hostfile, pathToExecutable with the name of your executable (relative or full path), and input and output with the names of your standard input and output files.
After your program completes, you MUST enter:
cleanupmpinodesto kill any orphan MPI processes that may have inadvertently been left behind. This is especially important if any of your processes terminated abnormally or did not run to completion normally.