Skip to content

Commit

Permalink
Refs #24 added PBS jobs for short test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmborr committed Jul 3, 2013
1 parent 2605ac3 commit 1b5f78f
Show file tree
Hide file tree
Showing 2 changed files with 418 additions and 0 deletions.
356 changes: 356 additions & 0 deletions simulation/namd_camm-shorttest.pbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,356 @@
#!/bin/bash
#PBS -l nodes=12:ppn=16
#PBS -l walltime=100:00:00
#PBS -j oe
#PBS -N namdTest

cd $PBS_O_WORKDIR

MPIRUN="/shared/openmpi/gcc/bin/mpirun"
NAMD=/shared/local/namd/NAMD_2.9_Linux-x86_64-mpi_shared/Linux-x86_64-g++/namd2

#Run 3 jobs simultaneously, each with one third cores

let total_tasks=$(wc -l $PBS_NODEFILE | awk '{print $1}')
let num_jobs=3
let tasks_per_job=$total_tasks/$num_jobs

#Assume jobs run in separate directories, job1, job2, ...
for i in $(seq $num_jobs)
do
#write hostfile for i-th job to use
let lstart=($i-1)*${tasks_per_job}+1
let lend=${lstart}+${tasks_per_job}-1
sed -n ${lstart},${lend}'p' < $PBS_NODEFILE >nodefile$i
done

#Eq config file
cat > equilibrate.conf <<'@EQEOF'
#############################################################
## JOB DESCRIPTION ##
#############################################################
# Retrieve init.* from the annealing directory with original
# Hydrogen charge.
#############################################################
## ADJUSTABLE PARAMETERS ##
#############################################################
set temperature 290 ;# initial temperature, in Kelvin
set charge 42 ;# hydrogen charge
set pressure 1.01325 ;# in bar -> 1 atm
set inputname init ;# prefix for input files
set outputname equilibrate ;# prefix for output files
#############################################################
## SIMULATION PARAMETERS ##
#############################################################
# Input files
structure toppar/Q$charge.psf ;# topoloty
coordinates toppar/crd.md18_vmd_autopsf.pdb ;# coordinates
#binCoordinates $inputname.restart.coor; # binaryCoordinates override coordinates
#binVelocities $inputname.restart.vel;
temperature $temperature ; # do not set the temperature if we pass a velocities file
extendedSystem $inputname.xsc; # extended info file
paraTypeCharmm on ;# CHARMM force-field
parameters toppar/par_all27_prot_lipid.inp
# These are specified by CHARMM
exclude scaled1-4
1-4scaling 1.0
switching on
# You have some freedom choosing the cutoff
cutoff 12.0 ;# may use smaller, maybe 10., with PME
switchdist 10.0 ;# cutoff - 2.
pairlistdist 14.0 ;# cutoff + 2. Promise that atom won't move more than 2A in a cycle
stepspercycle 20 ;# redo pairlists every X steps
pairlistsPerCycle 2 ;# This means the parilist will be updataed every stepspercycle/pairlistsPerCycle = 10 (default=10)
# Integrator Parameters
timestep 1.0 ;# 1fs/step
rigidBonds none ;# rigidBonds=none needed to record vibrations of bonds involving hydrogens
nonbondedFreq 1 ;# nonbonded forces every step
fullElectFrequency 1 ;# evaluate PME every X steps
# Periodic Boundary Conditions. Only given when starting a simulation from scratch,
# since the basis vectors will fluctuate during constant pressure simulation and
# updated values need to be read via extendedSystem from a .xsc file.
#cellBasisVector1 36.0 0. 0.0
#cellBasisVector2 0.0 36.0 0.0
#cellBasisVector3 0.0 0 36.0
# Wrap output coordinates to the central cell
wrapWater on ;# wrap water to central cell
wrapAll on ;# wrap other molecules too
wrapNearest off ;# issue for non-rectangular cells
# PME (for full-system periodic electrostatics)
PME on
PMEInterpOrder 6 ;# interpolation order (spline order = 6 in CHARMM)
PMEGridSpacing 1.0
PMEGridSizeX 40 ;# should be slightly higher than the cell size and a multiple of 2, and/or 3, and/or 5
PMEGridSizeY 40
PMEGridSizeZ 40
# Langevin tempeature control
langevin on ;# do langevin dynamics
langevinTemp $temperature
langevinDamping 1.0 ;# damping coefficient (gamma) of 1/ps
langevinHydrogen off ;# don't couple langevin bath to hydrogens
# Control parameters for annealing
#reassignFreq 3000 ;# number of timesteps between temperature reassignment
#reassignTemp 290 ;# new temperature when reassignment happens
#reassignIncr -1.0 ;# temperature increment when reassignment happens
#reassignHold 10.0 ;# target or limit temperature
# Constant Pressure Control (variable volume)
useGroupPressure no ;# needed if rigidBonds are declared
useFlexibleCell no ;# anysotropic cell fluctuations. Adequate for membrane simulations
useConstantArea no ;# no for water box, maybe for membrane simulations
langevinPiston on
langevinPistonTarget $pressure ;# in bar -> 1 atm
langevinPistonPeriod 100.0 ;# in fs
langevinPistonDecay 50.0 ;# recommended langevinPistonPeriod = 2 * langevinPistonDecay
langevinPistonTemp $temperature ;# coupled to heat bath
# Output
outputName $outputname ;# prefix for output files
restartfreq 5000 ;# overwrite restart file every X steps
DCDUnitCell yes ;# write unit cell data to DCD file
dcdfreq 5000 ;# write coords every X steps
xstFreq 5000 ;# write extended trajectory every X steps
#forceDCDfreq 1000 ;# trajectory of atom forces every X steps
outputEnergies 5000
outputPressure 5000
outputTiming 5000
#############################################################
## EXTRA PARAMETERS ##
#############################################################
# Put here any custom parameters that are specific to
# this job (e.g., SMD, TclForces, etc...)
###################################################################
## EXECUTION SCRIPT
# time namd2-mc +idlepoll +p8 file.conf > file.log (8 cores)
###################################################################
# Minimization
#minimize 1000 ;# perform 1000 minimization steps
firsttimestep 0 ;# reset frame counter
run 5000 ;# 5ps
@EQEOF

#Production config file
cat > production.conf <<'@PRODEOF'
#############################################################
## JOB DESCRIPTION ##
#############################################################
# Retrieve init.* from the annealing directory with original
# Hydrogen charge.
#############################################################
## ADJUSTABLE PARAMETERS ##
#############################################################
set temperature 290 ;# initial temperature, in Kelvin
set charge 42 ;# hydrogen charge
set pressure 1.01325 ;# in bar -> 1 atm
set inputname production00 ;# prefix for input files
set outputname production ;# prefix for output files
#############################################################
## SIMULATION PARAMETERS ##
#############################################################
# Input files
structure toppar/Q$charge.psf ;# topoloty
coordinates toppar/crd.md18_vmd_autopsf.pdb ;# coordinates
binCoordinates $inputname.restart.coor; # binaryCoordinates override coordinates
binVelocities $inputname.restart.vel;
#temperature $temperature ; # do not set the temperature if we pass a velocities file
extendedSystem $inputname.restart.xsc; # extended info file
paraTypeCharmm on ;# CHARMM force-field
parameters toppar/par_all27_prot_lipid.inp
# These are specified by CHARMM
exclude scaled1-4
1-4scaling 1.0
switching on
# You have some freedom choosing the cutoff
cutoff 12.0 ;# may use smaller, maybe 10., with PME
switchdist 10.0 ;# cutoff - 2.
pairlistdist 14.0 ;# cutoff + 2. Promise that atom won't move more than 2A in a cycle
stepspercycle 20 ;# redo pairlists every X steps
pairlistsPerCycle 2 ;# This means the parilist will be updataed every stepspercycle/pairlistsPerCycle = 10 (default=10)
# Integrator Parameters
timestep 1.0 ;# 1fs/step
rigidBonds none ;# rigidBonds=none needed to record vibrations of bonds involving hydrogens
nonbondedFreq 1 ;# nonbonded forces every step
fullElectFrequency 1 ;# evaluate PME every X steps
# Periodic Boundary Conditions. Only given when starting a simulation from scratch,
# since the basis vectors will fluctuate during constant pressure simulation and
# updated values need to be read via extendedSystem from a .xsc file.
#cellBasisVector1 36.0 0. 0.0
#cellBasisVector2 0.0 36.0 0.0
#cellBasisVector3 0.0 0 36.0
# Wrap output coordinates to the central cell
wrapWater off ;# wrap water to central cell
wrapAll off ;# wrap other molecules too
wrapNearest off ;# issue for non-rectangular cells
# PME (for full-system periodic electrostatics)
PME on
PMEInterpOrder 6 ;# interpolation order (spline order = 6 in CHARMM)
PMEGridSpacing 1.0
PMEGridSizeX 40 ;# should be slightly higher than the cell size and a multiple of 2, and/or 3, and/or 5
PMEGridSizeY 40
PMEGridSizeZ 40
# Langevin tempeature control
langevin on ;# do langevin dynamics
langevinTemp $temperature
langevinDamping 1.0 ;# damping coefficient (gamma) of 1/ps
langevinHydrogen off ;# don't couple langevin bath to hydrogens
# Control parameters for annealing
#reassignFreq 3000 ;# number of timesteps between temperature reassignment
#reassignTemp 290 ;# new temperature when reassignment happens
#reassignIncr -1.0 ;# temperature increment when reassignment happens
#reassignHold 10.0 ;# target or limit temperature
# Constant Pressure Control (variable volume)
useGroupPressure no ;# needed if rigidBonds are declared
useFlexibleCell no ;# anysotropic cell fluctuations. Adequate for membrane simulations
useConstantArea no ;# no for water box, maybe for membrane simulations
langevinPiston on
langevinPistonTarget $pressure ;# in bar -> 1 atm
langevinPistonPeriod 100.0 ;# in fs
langevinPistonDecay 50.0 ;# recommended langevinPistonPeriod = 2 * langevinPistonDecay
langevinPistonTemp $temperature ;# coupled to heat bath
# Output
outputName $outputname ;# prefix for output files
restartfreq 1000 ;# overwrite restart file every X steps
DCDUnitCell yes ;# write unit cell data to DCD file
dcdfreq 1000 ;# write coords every X steps
xstFreq 1000 ;# write extended trajectory every X steps
#forceDCDfreq 1000 ;# trajectory of atom forces every X steps
outputEnergies 1000
outputPressure 1000
outputTiming 1000
#############################################################
## EXTRA PARAMETERS ##
#############################################################
# Put here any custom parameters that are specific to
# this job (e.g., SMD, TclForces, etc...)
###################################################################
## EXECUTION SCRIPT
# time namd2-mc +idlepoll +p8 file.conf > file.log (8 cores)
###################################################################
# Minimization
#minimize 1000 ;# perform 1000 minimization steps
firsttimestep 0 ;# reset frame counter
run 400000 ;# 400ps
@PRODEOF
mkdir -p center/toppar
mkdir -p backward/toppar
mkdir -p forward/toppar
mv Q42_*b.psf backward/toppar/Q42.psf
mv Q42_*f.psf forward/toppar/Q42.psf
mv Q42_*.psf center/toppar/Q42.psf
cd center
#equilibrium run
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/toppar/crd.md18_vmd_autopsf.pdb toppar
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/toppar/par_all27_prot_lipid.inp toppar
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/T290/equilibrate/init.xsc .
cp ../equilibrate.conf .
cp ../production.conf .
$MPIRUN -n $tasks_per_job -hostfile ../nodefile1 $NAMD equilibrate.conf > equilibrate.log &
center_pid=$!
cd ../backward
#equilibrium run
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/toppar/crd.md18_vmd_autopsf.pdb toppar
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/toppar/par_all27_prot_lipid.inp toppar
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/T290/equilibrate/init.xsc .
cp ../equilibrate.conf .
cp ../production.conf .
$MPIRUN -n $tasks_per_job -hostfile ../nodefile2 $NAMD equilibrate.conf > equilibrate.log &
backward_pid=$!
cd ../forward
#equilibrium run
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/toppar/crd.md18_vmd_autopsf.pdb toppar
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/toppar/par_all27_prot_lipid.inp toppar
cp /data/jbq/projects/research/LiCl/watBox30/Hq.II/Q42/T290/equilibrate/init.xsc .
cp ../equilibrate.conf .
cp ../production.conf .
$MPIRUN -n $tasks_per_job -hostfile ../nodefile3 $NAMD equilibrate.conf > equilibrate.log &
forward_pid=$!

wait $forward_pid
if [ $? -ne 0 ]; then
cd ../forward
$MPIRUN -n $tasks_per_job -hostfile ../nodefile3 $NAMD equilibrate.conf > equilibrate.log &
fi
wait $backward_pid
if [ $? -ne 0 ]; then
cd ../backward
$MPIRUN -n $tasks_per_job -hostfile ../nodefile2 $NAMD equilibrate.conf > equilibrate.log &
fi
wait $center_pid
if [ $? -ne 0 ]; then
cd ../center
$MPIRUN -n $tasks_per_job -hostfile ../nodefile1 $NAMD equilibrate.conf > equilibrate.log &
fi

cd ../center
#production run
mv equilibrate.restart.coor production00.restart.coor
mv equilibrate.restart.vel production00.restart.vel
mv equilibrate.restart.xsc production00.restart.xsc
$MPIRUN -n $tasks_per_job -hostfile ../nodefile1 $NAMD production.conf > production.log &
center_pid=$!
cd ../backward
#production run
mv equilibrate.restart.coor production00.restart.coor
mv equilibrate.restart.vel production00.restart.vel
mv equilibrate.restart.xsc production00.restart.xsc
$MPIRUN -n $tasks_per_job -hostfile ../nodefile2 $NAMD production.conf > production.log &
backward_pid=$!
cd ../forward
#production run
mv equilibrate.restart.coor production00.restart.coor
mv equilibrate.restart.vel production00.restart.vel
mv equilibrate.restart.xsc production00.restart.xsc
$MPIRUN -n $tasks_per_job -hostfile ../nodefile3 $NAMD production.conf > production.log &
forward_pid=$!

wait $forward_pid
if [ $? -ne 0 ]; then
cd ../forward
$MPIRUN -n $tasks_per_job -hostfile ../nodefile3 $NAMD equilibrate.conf > equilibrate.log &
fi
wait $backward_pid
if [ $? -ne 0 ]; then
cd ../backward
$MPIRUN -n $tasks_per_job -hostfile ../nodefile2 $NAMD equilibrate.conf > equilibrate.log &
fi
wait $center_pid
if [ $? -ne 0 ]; then
cd ../center
$MPIRUN -n $tasks_per_job -hostfile ../nodefile1 $NAMD equilibrate.conf > equilibrate.log &
fi
Loading

0 comments on commit 1b5f78f

Please sign in to comment.