#!/bin/sh # MODIFIED "MP1SCRIPT" FOR GRIDMPI (gridmpi.script) _CONDOR_PROCNO=$_CONDOR_PROCNO _CONDOR_NPROCS=$_CONDOR_NPROCS CONDOR_SSH=`condor_config_val libexec` CONDOR_SSH=$CONDOR_SSH/condor_ssh SSHD_SH=`condor_config_val libexec` SSHD_SH=$SSHD_SH/sshd.sh . $SSHD_SH $_CONDOR_PROCNO $_CONDOR_NPROCS # If not the head node, just sleep forever, to let the # sshds run if [ $_CONDOR_PROCNO -ne 0 ] then wait sshd_cleanup exit 0 fi EXECUTABLE=$1 shift # the binary is copied but the executable flag is cleared. # so the script have to take care of this chmod +x $EXECUTABLE # Set this to the bin directory of MPICH installation MPDIR=/usr/local/gridmpi/bin PATH=$MPDIR:.:$PATH export PATH export _YAMPI_RSH=$CONDOR_SSH export _YAMPI_MPIRUN_SPREAD=255 export _YAMPI_MPIRUN_CHDIR=0 CONDOR_CONTACT_FILE=$_CONDOR_SCRATCH_DIR/contact export CONDOR_CONTACT_FILE # The second field in the contact file is the machine name # that condor_ssh knows how to use sort -n -k 1 < $CONDOR_CONTACT_FILE | awk '{print $2}' > mpi_conf.$$ ## run the actual mpijob mpirun -c mpi_conf.$$ -np $_CONDOR_NPROCS ./$EXECUTABLE $@ sshd_cleanup rm -f mpi_conf.$$ exit $?