5、Gromacs-DCU
脚本共2个文件,分别为run.sh、bind.sh,置于同一目录。提交作业时,执行sbatch run.sh。
注:run.sh是资源申请与环境配置脚本;bind.sh是运行命令与绑卡脚本。
(1) run.sh
#!/bin/bash
#SBATCH -J GROMACS-DCU
#SBATCH -p wzhdtest
#SBATCH -N 1
#SBATCH -n 32
#SBATCH --gres=dcu:4
#SBATCH --exclusive
module purge
module load compiler/devtoolset/7.3.1
module load mpi/hpcx/gcc-7.3.1
module load compiler/dtk/21.04
module load apps/Gromacs-DCU2/2020.3-dtk21.04/hpcx-gcc-7.3.1
mpirun --allow-run-as-root -np 4 ./bind.sh
(2) bind.sh
#!/bin/bash
#numa_node=$1
cmd="gmx_mpi mdrun -gpu_id 0 -ntomp 7 -nb gpu -v -noconfout -deffnm nvt -nsteps 20000"
lrank=$OMPI_COMM_WORLD_LOCAL_RANK
case ${lrank} in
[0])
export HIP_VISIBLE_DEVICES=0
export GOMP_CPU_AFFINITY='0-6'
numactl --cpunodebind=0 --membind=0 ${cmd}
;;
[1])
export HIP_VISIBLE_DEVICES=1
export GOMP_CPU_AFFINITY='8-14'
numactl --cpunodebind=1 --membind=1 ${cmd}
;;
[2])
export HIP_VISIBLE_DEVICES=2
export GOMP_CPU_AFFINITY='16-22'
numactl --cpunodebind=2 --membind=2 ${cmd}
;;
[3])
export HIP_VISIBLE_DEVICES=3
export GOMP_CPU_AFFINITY='24-30'
numactl --cpunodebind=3 --membind=3 ${cmd}
;;
esac
~