Skip to content

Instantly share code, notes, and snippets.

@kmtu
Last active August 29, 2015 14:08
Show Gist options
  • Save kmtu/911588ed85dbb1eda4aa to your computer and use it in GitHub Desktop.
Save kmtu/911588ed85dbb1eda4aa to your computer and use it in GitHub Desktop.
run-md-nve.sh
if [[ ! $# == 1 ]]; then
echo "Usage: $0 <index of md>"
exit 1;
fi
idx=$1
sdir=../../2-npt
tdir=md$idx
if [[ ! -d "$tdir" ]]; then
mkdir $tdir &&\
ln -s $sdir/md-npt-${idx}.cpt $tdir/ &&\
ln -s $sdir/md-npt-${idx}.tpr $tdir/ || exit 1;
fi
cd $tdir &&\
cat > run-md.sh <<EOF
#PBS -l nodes=2:ppn=12
#PBS -N system-md$IDX
cd \$PBS_O_WORKDIR
NPROCS=\`wc -l <\$PBS_NODEFILE\`
MPIRUN="mpirun -machinefile \$PBS_NODEFILE -n \$NPROC"
GMDIR=/home/kmtu/local/gromacs-4.6.6/bin
GROMPP=\$GMDIR/grompp_d
MDRUN=\$GMDIR/mdrun_mpi_d
TOP=../../system
PREV=md-npt-$IDX
STAGE=md-nve
\$GROMPP -f ../\${STAGE}.mdp -c \$PREV.tpr -t \$PREV.cpt -p \$TOP.top -o \$STAGE.tpr
\$MPIRUN \$MDRUN -s \$STAGE.tpr -deffnm \$STAGE
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment