OldMPI

From UMIACS
Jump to navigation Jump to search
  • LAM

To compile this program and execute under using LAM, make sure /usr/local/stow/lam-7.1.4/bin is in your PATH environment variable. It can be compiled by doing: mpicc alltoall.c -o alltoall-lam

The submission file lamsub.sh can be submitted to run your program

#!/bin/bash
#PBS -l nodes=8
#PBS -l walltime=0:10:0
cd ~/torquejobs/lamtest
mpiexec -machinefile ${PBS_NODEFILE} alltoall-lam

Here is what looks like on your terminal after submit the job:

[opensub00 142] qsub lamsub.sh
127.opensrv.umiacs.umd.edu
 [opensub00 143] qstat -n

opensrv.umiacs.umd.edu:
                                                                   Req'd  Req'd   Elap
Job ID               Username Queue    Jobname    SessID NDS   TSK Memory Time  S Time
-------------------- -------- -------- ---------- ------ ----- --- ------ ----- - -----
127.opensrv.umiacs.u xhe      dque     lamsub.sh     --      8  --    --  48:00 R   --
   openlab00/0+openlab01/0+openlab02/0+openlab03/0+openlab04/0+openlab05/0
   +openlab06/0+openlab07/0
 [opensub00 144]

Output files for this job: lamsub.sh.o127 and lamsub.sh.e127(empty)

The submission file lamsub2.sh uses mpirun instead of mpiexec, which user need to set up the MPI environment by starting lamboot, then run lamhalt to stop it afterwards. We recommend user use mpiexec since it will set up MPI runtime environment for your jobs.


  • MPICH1

To compile and run this program under MPICH1 you need to set up your environment: The following script will set the appropriate environment.

setenv MPI_ROOT /usr/local/stow/mpich-version
setenv MPI_LIB  $MPI_ROOT/lib
setenv MPI_INC  $MPI_ROOT/include
setenv MPI_BIN $MPI_ROOT/bin
# add MPICH commands to your path (includes mpirun and mpicc)
set path=($MPI_BIN $path)
# add MPICH LD_LIBRARY_PATH pages to your path
if ( $?LD_LIBRARY_PATH ) then
    setenv LD_LIBRARY_PATH  $MPI_ROOT/LD_LIBRRAY_PATH:$LD_LIBRARY_PATH
else
    setenv LD_LIBRARY_PATH  $MPI_ROOT/LD_LIBRARY_PATH
endif

It can be compiled by doing: mpicc alltoall.c -o alltoall-mpich1 (remember we changed our environment to point to MPICH's mpicc)

The submission file mpich1sub.sh is almost the same except you need to call mpirun instead of mpiexec.

#!/bin/bash
# Special PBS control comments
#PBS -l nodes=8,walltime=60

# Set up the path
PATH=/usr/local/stow/mpichgm-1.2.7p1-20/bin:$PATH
export $PATH

cd ~/mpich1test/
echo $PBS_NODEFILE
# Run the program
mpirun -machinefile $PBS_NODEFILE -np $( wc -l < $PBS_NODEFILE ) ./alltoall-mpich1

Here is what looks like when submit the job from a submit machine at your prompt:

[xhe@brood00 ~/mpich1test]$ qsub mpich1sub.sh
167.queen.umiacs.umd.edu
[xhe@brood00 ~/mpich1test]$ qstat -n

queen.umiacs.umd.edu: 
                                                                   Req'd  Req'd   Elap
Job ID               Username Queue    Jobname    SessID NDS   TSK Memory Time  S Time
-------------------- -------- -------- ---------- ------ ----- --- ------ ----- - -----
167.queen.umiacs.umd xhe      dque     mpich1sub.    --      8  --    --  04:00 R   -- 
   bug00/0+bug01/0+bug02/0+bug03/0+bug04/0+bug05/0+bug06/0+bug07/0
[xhe@brood00 ~/mpich1test]$ 

Output files for this job: mpich1sub.sh.o167 and mpich1sub.sh.e167(empty)