Seite druckenPDF Version herunterladenSeitenstruktur anzeigenSeite durchsuchen
nach oben

Message Passing Interface(s) (MPI)

vorhandene Versionen

Es sind folgende Versionen mit Unterstützung für Infiniband für die Compiler von Intel, PGI oder GNU verfügbar:
  • OpenMPI 1.4.2
  • installiert in: /opt/openmpi/1.4.2/
  • MVAPICH2 1.2.p1
  • installiert in: /opt/ofed/mpi/{COMPILER}/mvapich2-1.2p1/
  • Intel-MPI 3.2.1
  • installiert in: /opt/intel/impi/3.2.1/

Ältere verfügbare Versionen von OpenMPI und MVAPICH sind zudem:
  • OpenMPI 1.2.8, 1.3.1
  • MVAPICH 1.1.0
... sowie von:
  • MPICH 1.2.7p1 für GCC
  • installiert in: /G/home/software/mpich-1.2.7p1/
    Für Latenzzeit-kritische Anwendungen ungeignet, da keine Unterstützung für Infiniband vorhanden.

OpenMPI


Übersetzung

Beispiel für GCC unter Verwendung des Quell-Codes eines dem Intel-MPI beiliegenden Beispiel-Programms:
  /opt/openmpi/1.4.2/gcc/bin/mpicc /opt/intel/impi/3.2.1/test/test.c -o mpi-test

Batchfile

#!/bin/bash
#PBS -V

VERSION=1.4.2; COMPILER=gcc
#Bibliotheken für Open-MPI einbinden
export LD_LIBRARY_PATH="/opt/openmpi/${VERSION}/${COMPILER}/lib/"

#Falls der Intel-Compiler (C oder Fortran) verwendet wurde:
source /opt/intel/Compiler/11.0/081/bin/iccvars.sh intel64
source /opt/intel/Compiler/11.0/081/bin/ifortvars.sh intel64

EXEC="$HOME/mpi-test"
MPIRUN="/opt/openmpi/${VERSION}/${COMPILER}/bin/mpirun"
PARAMS="--mca mpi_paffinity_alone 1"

$MPIRUN $PARAMS $EXEC

Submission

  qsub -l nodes=2:ppn=8 -q c16 BATCHFILE

Der Schalter "--mca mpi-paffinity_alone 1" aktiviert die Affinität eines Threads/MPI-Ranks zu gegebener physikalischer CPU.

Ergänzungen

Die Manpages erhalten sie mit:
  man -M /opt/openmpi/{Version}/{Compiler}/share/man/ mpirun


MVAPICH2


Setup

Um MVAPICH2 verwenden zu können, müssen sie zuvor zwei Dateien in ihrem Homeverzeichnis erstellen:
  echo secretword=Passwd1234 > .mpd.conf
  echo secretword=Passwd5678 > .mpdpasswd
Dann die Rechte restriktiv einstellen:
  chmod 600 $HOME/.mpd.conf
Bitte zwei unterschiedliche Passwörter verwenden und bitte nicht die beiden hier gezeigten.

Übersetzung

user@hpclogin:~> /opt/ofed/mpi/gcc/mvapich2-1.2p1/bin/mpicc /opt/intel/impi/3.2.1/test/test.c

Batchfile

#!/bin/bash

#PBS -V

np=$(cat $PBS_NODEFILE | wc -l)
mnp=$(sort -u $PBS_NODEFILE | wc -l)

source /opt/intel/Compiler/11.0/081/bin/iccvars.sh intel64
source /opt/intel/Compiler/11.0/081/bin/ifortvars.sh intel64
source /opt/intel/mkl/10.1.1.019/tools/environment/mklvars64.sh 
export MKL=/opt/intel/mkl/10.1.1.019/

export MVAPICH2_HOME=/opt/ofed/mpi/intel/mvapich2-1.2p1/
export MPD_BIN=$MVAPICH2_HOME/bin
export PATH=$MVAPICH2_HOME/bin:$PATH
export LD_LIBRARY_PATH=$MPICH2_HOME/lib:$LD_LIBRARY_PATH

mpdboot -n $mnp -f $PBS_NODEFILE
MPIRUN=/opt/ofed/mpi/gcc/mvapich2-1.2p1/bin/mpirun_rsh

EXEC=$HOME/mpi-test
mpiexec -np $np $EXEC

mpdallexit

Submission

qsub -q[Queue] -lnodes=[Nodes]:ppn=[Proz.p.Node] BATCHFILE

Intel-MPI


Übersetzung


Einbinden der Variablen:
  source /opt/intel/impi/3.2.1/bin64/mpivars.sh
  # Für Intel-Compiler (C + Fortran)
  source /opt/intel/Compiler/11.0/081/bin/iccvars.sh intel64
  source /opt/intel/Compiler/11.0/081/bin/ifortvars.sh intel64
Compilieren:
  mpicc -cc=icc -I/opt/intel/impi/3.2.1/include64/ -L/opt/intel/impi/3.2.1/lib64/ /opt/intel/impi/3.2.1/test/test.c

Batchfile

a) mit "mpirun":
#!/bin/bash #PBS -V cat $PBS_NODEFILE > $PWD/mpd.hosts source /opt/intel/impi/3.2.1/bin64/mpivars.sh EXEC=/opt/intel/impi/3.2.1/test/test_impi # Count number of requested processors
np=$(cat $PBS_NODEFILE | wc -l) mpirun -r ssh -np $np $EXEC
b) mit "mpiexec":
#!/bin/bash
# PBS -V source /opt/intel/impi/3.2.1/bin64/mpivars.sh # create the mpd.hosts text file that lists the nodes in the cluster using one # host name per line: cat $PBS_NODEFILE > $PWD/mpd.hosts PBS_NODEFILE_UNIQUE=`cat $PBS_NODEFILE | uniq` # Count number of requested processors np=$(cat $PBS_NODEFILE | wc -l) # Count nodes nnodes=`echo $PBS_NODEFILE_UNIQUE | wc -w` # Shut down the eventual MPD daemons using the mpdallexit command: mpdallexit 2>/dev/null #Use the mpdboot command to start up the MPD daemons (mpdboot -n <#nodes>): #The file $PWD/mpd.hosts will be used by default if it is present. mpdboot -r ssh -n $nnodes #Use the mpdtrace command to determine the status of the MPD daemons: echo ------------------------ echo output: mpdtrace mpdtrace echo ------------------------ #The output should be a list of nodes that are currently running MPD daemons. #This should match the list of nodes in the mpd.hosts file, allowing for name #resolution. EXEC=/opt/intel/impi/3.2.1/test/test_impi mpiexec -n $np $EXEC mpdallexit 2>/dev/null

Submission

Submitieren der "intelligenten" Job-Skripte ("mpirun" und "mpiexec") mit:
  qsub -q[QUEUE] -lnodes=[AnzahlNodes]:ppn=[Proc.perNode]
z.B.:
  qsub -qc32 -lnodes=4:ppn=8 BATCHFILE

MPICH


Übersetzung

  /G/home/software/mpich-1.2.7p1/bin/mpicc /opt/intel/impi/3.2.1/test/test.c -o test_mpich

Batchfile

#!/bin/bash
#PBS -V

# Count number of requested processors
np=$(cat $PBS_NODEFILE | wc -l)

cat $PBS_NODEFILE > $PWD/nodefile.list

EXEC=$HOME/test_mpich
MPICH=/G/home/software/mpich-1.2.7p1/bin/mpirun

$MPICH -machinefile nodefile.list -np $np $EXEC

Autor: Elisabeth Kahnert, Alexander Fitterling, Stand: 09.02.2011 11:22 Uhr

 Impressum