No t4 step2 min.bash

From Rizzo_Lab
Revision as of 11:36, 18 January 2010 by Stonybrook (talk | contribs)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
#!/bin/bash
wd=`pwd`
pre0='bnz'
pre1='phn'
mask0=':BNZ@H6'
mask1=':PHN@O1,H6'

for X in 1 2 3 4 5 6 7 8 9

do

cat << EOF > group_min_l${X}
-O -i mdin_min_v0_l${X} -o ${pre0}_min_v0_l${X}.out -p ../${pre0}.prm -c ../${pre0}.rst -r ${pre0}_min_v0_l${X}.rst
-O -i mdin_min_v1_l${X} -o ${pre1}_min_v1_l${X}.out -p ../${pre1}.prm -c ../${pre1}.rst -r ${pre1}_min_v1_l${X}.rst
EOF

cat << EOF > mdin_min_v0_l${X}
density minlibration
 &cntrl
  imin = 1, ntmin = 2, 	
  ntx = 1,
  maxcyc=500,
  ntpr = 100,
  ntf = 1,      ntc = 1,
  ntb = 1,	cut = 9.0,
  icfe=1,	clambda = 0.${X},
EOF

cp mdin_min_v0_l${X} mdin_min_v1_l${X}

cat << EOF >> mdin_min_v0_l${X}
  ifsc=1,
  crgmask='${mask0}',
  scmask='${mask0}',
 &end
EOF
cat << EOF >> mdin_min_v1_l${X}
  ifsc=1,
  crgmask='${mask1}',
  scmask='${mask1}',
 &end
EOF

sander="${AMBERHOME}/exe/sander.MPI"
cd $wd
rm -rf zzz.minqsub.out.${X} zzz.minqsub.err.${X} minrun.pbs.${X}

cat << EOF > minrun.pbs.${X}
#!/bin/bash
#PBS -l nodes=1:ppn=2
#PBS -l walltime=168:00:00
#PBS -o zzz.minqsub.out.${X}
#PBS -e zzz.minqsub.err.${X}

cd $wd
cat \$PBS_NODEFILE | sort | uniq > mpd.nodes.${X}

mpdboot --totalnum=-1 --ncpus=2 -f mpd.nodes.${X}
mpiexec -n 2 $sander -O -ng 2 -groupfile group_min_l${X}

mpdallexit
EOF

chmod +x minrun.pbs.${X}
qsub minrun.pbs.${X}

done