Skip to main content

mpich

Versions and Availability

About the Software

MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard.

Usage

  1. Set up your .soft file to select the library version, and the compilers you want to use for building and executing your code. Keep in mind that keys take effect in the order they appear. The following shows how to select the MPICH library and use it with the Intel C compiler. Do not simply copy them, as they are subject to change. Use the softenv command to verify them before use.
  2. +mpich-1.2.7-intel-11.1
    +intel-fc-11.1
    @default
    
  3. The compiler, mpicc, will use icc and link with mpich with no further ado.
  4. Run with: mpirun -machinefile $PBS_NODEFILE -np $NPROCS /path/to/executable
  5. An example PBS script can be viewed below.

▶ Open Example?

#!/bin/sh
#
# No shell commands until PBS setup is completed!
#
# Provide your allocation code.
#PBS -A ALLOCATION_CODE
#
# "workq" is the default job queue.
#PBS -q workq
#
# Set to your email address.
#PBS -M EMAIL_ADDRESS
#
# PPN should be 4, 8, 16, 20, etc., depending on machine/queue you are using.
#PBS -l nodes=1:ppn=4
#
# Set amount of time job may run in hh:mm:ss
#PBS -l walltime=00:10:00
#
# Have PBS pass all shell variables to the job environment
#PBS -V
#
# Send stdout and stderr to named files.
#PBS -o MPI_test.out
#PBS -e MPI_test.err
#
# Give the job a name to make tracking it easier
#PBS -N MPI_test 
#
# Shell commands may begin here.
 
# Your executable should either be in your path, or defined explicitly.
# Here we'll assume a custom program named "hello" that exists in the
# work directory:

export EXEC=hello
export WORK_DIR=/work/uname/path
export NPROCS=`wc -l $PBS_NODEFILE |gawk '//{print $1}'`
cd $WORK_DIR 
 
# The order in which options are provided is important:
mpirun -machinefile $PBS_NODEFILE -np $NPROCS $WORK_DIR/$EXEC 

Resources

  • Documentation site. You will have to use MPICH2 documentation and pay attention only to those features support by MPI-1.

Last modified: September 10 2020 11:58:50.