Skip to content

Instantly share code, notes, and snippets.

@kmtu
Last active November 6, 2017 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kmtu/d1972eb34ca36bf2295d to your computer and use it in GitHub Desktop.
Save kmtu/d1972eb34ca36bf2295d to your computer and use it in GitHub Desktop.
Produce a cpt file every 1 ns for NPT run (for Gromacs ver. 4)
#PBS -l nodes=2:ppn=12
#PBS -N JobName
cd ${PBS_O_WORKDIR}
NPROCS=`wc -l <$PBS_NODEFILE`
MPIRUN="mpirun -machinefile $PBS_NODEFILE -n $NPROC"
export GMX_MAXBACKUP=1000 # max number of gro backup
GMDIR=/home/kmtu/local/gromacs-4.6.6/bin
GROMPP=$GMDIR/grompp_d
MDRUN=$GMDIR/mdrun_mpi_d
TPBCONV=$GMDIR/tpbconv_d
PREV=eq-npt2 # name of the previous stage
STAGE=md-npt # name of the current stage
TOP=../system # topology file (without the .top extension)
TIME=1000 # extending 1000 ps (1 ns) per run
for i in {0..9}
do
if [ $i == 0 ]; then
ln -s $PREV.cpt ${STAGE}-$i.cpt
$GROMPP -f $STAGE.mdp -c $PREV.tpr -p $TOP.top -o ${STAGE}-$i.tpr -t $PREV.cpt
else
if [ $i == 1 ]; then
$TPBCONV -s ${STAGE}-$[i-1].tpr -o ${STAGE}-$i.tpr -until ${TIME}
else
$TPBCONV -s ${STAGE}-$[i-1].tpr -o ${STAGE}-$i.tpr -extend ${TIME}
fi
cp ${STAGE}-$i.tpr ${STAGE}.tpr
$MPIRUN $MDRUN -deffnm ${STAGE} -cpi ${STAGE}
cp ${STAGE}.cpt ${STAGE}-$i.cpt
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment