#!/bin/bash
#
# This is a simple example of a SGE submit script
# cvos-launcher does all the nice clean up that SGE does not do..
#$ -S /bin/bash
#$ -N GMX_MD
#$ -pe openmpi 8
#$ -q work.q -cwd -V

# host: astrocyte.bioch.ox.ac.uk
# queuing system: SGE

DEFFNM=md

TPR=${DEFFNM}.tpr
OUTPUT=${DEFFNM}.out
PDB=${DEFFNM}.pdb

MDRUN_OPTS=""

# JOB_ARRAY_PLACEHOLDER

source /cvos/shared/apps/opt/gromacs/4.0.5-openmpi/bin/GMXRC
source /etc/profile.d/modules.sh
module add shared openmpi/gcc/64/1.2.8

MDRUN=/cvos/shared/apps/opt/gromacs/4.0.5-openmpi/bin/mdrun_mpi
LAUNCHER=/cvos/shared/apps/sge/6.2/bin/lx26-amd64/cvos-launcher

# for diagnostics
cat $TMPDIR/machines


$LAUNCHER mpirun $MDRUN -step 1000 -deffnm ${DEFFNM} -s ${TPR} -c ${PDB} \
                 $MDRUN_OPTS -cpi -append > $OUTPUT 

exit 0


