Skip to main content

mvapich2

Versions and Availability

About the Software

MVAPICH2 is an MPI implementation for Infiniband networks.

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 and MVAPICH2 library and use it with the GNU gcc compiler. Do not simply copy them, as they are subject to change. Use the softenv command to verify them before use.
  2. +mvapich2-1.4-gcc-4.3.2 
    +gcc-4.3.2
    @default
    
  3. The compiler, mpicc, will use gcc and link with mvapich2 with no further ado.
  4. Run with: mpirun_rsh -hostfile $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!
#
# Before you submit your job, make sure the following are customized
# for your particular needs:
#
# 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
#
# Queen Bee uses "ppn=8", all others use "ppn=4"
#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 

# Note that order in which the options appear is important, and the
# names may have changed since MVAPICH:

mpirun_rsh -np $NPROCS -hostfile $PBS_NODEFILE $WORK_DIR/$EXEC 

Resources

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