MBG wiki | RecentChanges | Blog | 2024-05-18 | 2024-05-17

Showing revision 3

SGE script to start a parallel job on the cluster

Cut-and-paste the script that follows in a reasonably named file like myjob.sh, edit the file and change the obvious things (like program name, arguments to program, name of log file, number of processors) and then submit the job with qsub myjob.sh. Check that it starts without problems using qstat.

#!/bin/csh -f
#

#
# The name of the log file (MPI_log) ...
#
#$ -N MPI_log

#
# The parallel environment (mpi_fast) and number of processors (9) ...
# 
#$ -pe mpi_fast 9

#
# The version of MPICH to use, transport protocol & a trick to delete cleanly
# running MPICH jobs ...
#
#$ -v MPIR_HOME=/usr/local/mpich-ssh
#$ -v P4_RSHCOMMAND=rsh
#$ -v MPICH_PROCESS_GROUP=no

#
# Execute from the current working directory ...
#
#$ -cwd

#
# Standard error and output should go into the current working directory ...
#
#$ -e ./
#$ -o ./

echo "Got $NSLOTS slots."

$MPIR_HOME/bin/mpirun -np $NSLOTS -machinefile $TMPDIR/machines my_MPI_program