#!/bin/bash
#SBATCH -c4 --mem-per-cpu=4000 --time=1:0:0 --gres=gpu:v100:1
module --force purge
module load StdEnv/2020 intel/2020.1.217 cuda/11.0 namd-multicore/2.14
namd2 +p${SLURM_CPUS_PER_TASK } +idlepoll namd.in
#!/bin/bash
#SBATCH -c40 --gres=gpu:v100:2
#SBATCH --mem-per-cpu=2000 --time=1:0:0
# Usage: sbatch submit.cuda.sh [number_of_steps]
INPFILE=namd.in
# End of user input
STEPS=$1
TMPFILE=tf_${SLURM_CPUS_PER_TASK}
cp $INPFILE run.in
echo numsteps $1 >> run.in
module --force purge
module load StdEnv/2020 intel/2020.1.217 cuda/11.0 namd-multicore/2.14
# Print resource info
echo ${SLURM_NODELIST} running on ${SLURM_CPUS_PER_TASK} cores
cat /proc/cpuinfo | grep "model name" | uniq
# Run simulation three times
namd2 +p${SLURM_CPUS_PER_TASK} +idlepoll run.in > $TMPFILE
namd2 +p${SLURM_CPUS_PER_TASK} +idlepoll run.in >> $TMPFILE
namd2 +p${SLURM_CPUS_PER_TASK} +idlepoll run.in >> $TMPFILE
# Print average of three runs.
echo -n "ns/day:"
grep CPUTime $TMPFILE | cut -f5 -d " " | awk -v steps=${STEPS} \
'{ total += $1; count++ } END { print count*3.6*2.4*steps*0.01/total}'
rm -f tf_* *.restart.* *.old *.BAK run.in