How to Build and Run MPI Programs
GNU | Intel | |
---|---|---|
module |
|
|
Notes | Where
You can also use gcc/V.R/openmpi-V.R.P, like in
| Where YY is the version (year), like in
You can also use intel/YY/mvapich-YY.R, like in
Do not use the MPI implementation distributed by Intel, as it fails to run on Hydra (IB incompatibility). Hence do not try to use |
Examples location |
|
|
PGI | NVIDIA | |
module |
|
|
Notes | Where YY is the version (year), like in
You can also use
| Where YY is the version(year), like in
You can also use
|
Examples location | /home/hpc/examples/pgi | /home/hpc/examples/nvidia |
Note
MPI jobs must request either the
orte
or thempich
parallel environment with the number of slots (CPUs, computing elements, etc)- OpenMPI uses
orte
, MVAPICH usesmpich
, - except that pgi/NVIDIA vendor supplied openmpi uses/needs
mpich
.
- OpenMPI uses
- The job script should use the environment variable
NSLOTS
(via$NSLOTS
) to access the assigned number of CPUs (slots),
that number should not be hardwired. the list of nodes set aside for your MPI job is compiled by the jobs scheduler (GE) and passed to the job script via a machine list file
that file is either$PE_HOSTFILE
or$TMPDIR/machines
Whether you build or run an MPI program, you must first load the corresponding module, before invoking
mpirun
.I recommend to log what computes nodes your MPI job is using with commands next to "Info"
ORTE MPICH qsub -pe orte N
-pe mpich N
Info echo using $NSLOTS slots on:
cat $PE_HOSTFILE
echo using $NSLOTS slots on:
sort $TMPDIR/machines | uniq -c
module module load XXX
module load XXX
run mpirun -np $NSLOTS ./code
mpirun -np $NSLOTS -machinefile $TMPDIR/machines ./code
where XXX is the right module, and N is the number of slots you want your code to use,
- it can also be specified as "
N-M"
, meaning at leastN
and at mostM
CPUs (slots, ...)
- it can also be specified as "
- This can be confusing, so look at the examples for the compiler/mpi-flavor you use.
You can find more information under Submitting Distributed Parallel Jobs with Explicit Message Passing.
Last updated SGK