#!/bin/bash
#SBATCH -c2 --gres=gpu:2
#SBATCH --mem-per-cpu=2000 --time=1:0:0
NAMDHOME=$HOME/NAMD_3.0alpha9_Linux-x86_64-multicore-CUDA
$NAMDHOME/namd3 +p${SLURM_CPUS_PER_TASK} +idlepoll namd3.in
#!/bin/bash
#SBATCH -c2 --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_${SLURM_CPUS_PER_TASK}.in
echo numsteps $1 >> run_${SLURM_CPUS_PER_TASK}.in
echo "CUDASOAintegrate on" >> run_${SLURM_CPUS_PER_TASK}.in
NAMDHOME=$HOME/NAMD_3.0alpha9_Linux-x86_64-multicore-CUDA
echo ${SLURM_NODELIST} running on ${SLURM_CPUS_PER_TASK} cores
cat /proc/cpuinfo | grep "model name" | uniq
nvidia-smi -L
# Run simulation three times
$NAMDHOME/namd3 +p${SLURM_CPUS_PER_TASK} +idlepoll run_${SLURM_CPUS_PER_TASK}.in > $TMPFILE
$NAMDHOME/namd3 +p${SLURM_CPUS_PER_TASK} +idlepoll run_${SLURM_CPUS_PER_TASK}.in > $TMPFILE
$NAMDHOME/namd3 +p${SLURM_CPUS_PER_TASK} +idlepoll run_${SLURM_CPUS_PER_TASK}.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_${SLURM_CPUS_PER_TASK} *.restart.* *.old *.BAK run_${SLURM_CPUS_PER_TASK}.in