Skip to content

queuing system scripts

Oliver Beckstein edited this page Oct 6, 2017 · 2 revisions

If you provide queuing system template scripts to MDPOW it can write scripts to submit jobs to your queuing system. Because machines are very idiosyncratic, no such templates are shipped with MDPOW. This page shows some examples used in the Becksteinlab.

For background see GromacsWrapper's gromacs.qsub documentation.

Gridengine

Job array

Job with Gromacs 4.6.6 on the "workstation queue", using 4 cores.

Usage

MDPOW writes a bash file that will contain the commands to submit the scripts for VDW and Coulomb FEP.

wsq_4_MDPOW_array_default_466.sge

The # JOB_ARRAY_PLACEHOLDER has MDPOW insert code to run a job array.

# Standard Gromacs script
#$ -S /bin/bash
#$ -N MD_simulation
#$ -pe singlenode 4
#$ -cwd
#$ -j y
#$ -R y -r n
#$ -q workstations.q
### FOR RUNLOCAL = FALSE

#--------------------------------
# adjust these parameters
#--------------------------------
TPR='md.tpr'
DEFFNM=md
# optimize the number of PME nodes with g_tune_pme
# (NPME = -1 means automatic but that's rarely optimal)
NPME=-1
MDRUN_OPTS=""
#--------------------------------

# JOB_ARRAY_PLACEHOLDER

# set up scratch directory
WORK=/scratch/${USER}/WORK/${JOB_ID}.${SGE_TASK_ID}
ORIG=$PWD


echo "-- HOST  $(hostname)"
echo "-- WORK  $WORK"
echo "-- time  $(date)"

mkdir -p $WORK
test -d $WORK || { echo "Failed to make tmpdir"; exit 2; }

cp $TPR $DEFFNM.{cpt,xtc,trr,edr,log,xvg} $WORK
cd $WORK || { echo "Failed to cd $WORK"; exit 2; }

GMX_VERSION=4.6.6
. /nfs/packages/modules/init
# load appropriate version
# (for Gromacs 4.5.5 simply use 'module load gromacs/4.5.5')
case $(hostname) in
  darthtater)
    echo "-- enabled 'mdrun -pin off' workaround for $(hostname)"
    MDRUN_OPTS="${MDRUN_OPTS} -pin off";
    module load gromacs/${GMX_VERSION}/cuda5/intel13.0/sse/64;;
  *)
    #echo "-- enabled 'mdrun -pin on' for $(hostname)"
    #MDRUN_OPTS="${MDRUN_OPTS} -pin on";
    echo "-- no pinning for $(hostname)"
    module load gromacs/${GMX_VERSION}/cuda5/intel13.0/avx/bare/64;;
esac

echo "-- running mdrun"
echo ">> mdrun ${MDRUN_OPTS} -nt $NSLOTS -s $TPR -deffnm $DEFFNM -c $DEFFNM.pdb -cpi -npme $NPME -pd"
mdrun ${MDRUN_OPTS} -nt $NSLOTS -s $TPR -deffnm $DEFFNM -c $DEFFNM.pdb -cpi -npme $NPME -pd
rc=$?
if [ $rc -gt 0 ]; then
    echo "ERROR in mdrun [$rc]"
    echo "EE directory $(hostname):$PWD"
    echo "EE contents (ls -la)"
    echo "------------------"
    ls -la .
    echo "------------------"
fi

echo "-- copying back results"
echo ">> cp $(hostname):${WORK}/* ${ORIG}"
cp * $ORIG || { echo "Did not copy $WORK --- check manually!"; exit 1; }
cd $ORIG
echo "-- cleaning up WORK"
echo ">> rm -r $WORK"
rm -r $WORK
Clone this wiki locally