...
#!/bin/bash
#
#SBATCH --job-name=namd2
#SBATCH --output=results.txt
#
#SBATCH --time=10:00
#SBATCH --partition=thor
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=32
INPUT_FILE=/global/home/groups/allhands/applications/namd/apoa1/apoa1.namd
EXE=/global/software/centos-7/modules/apps/md/namd/2.12-hpcx-2.0.0-intel-2018.1.163/bin/namd2
MPI_FLAGS="--display-map --map-by node --display-topo --report-bindings "
UCX_FLAGS="-mca pml ucx -x UCX_NET_DEVICES=mlx5_0:1 -mca mtl ^mxm -x UCX_TLS=rc_x,shm,self all"
HCOLL_FLAGS="-mca coll_fca_enable 0 -mca coll_hcoll_enable 1 -x HCOLL_MAIN_IB=mlx5_0:1 "
module load md/namd/2.12-hpcx-2.0.0-intel-2018.1.163
mpirun $MPI_FLAGS $UCX_FLAGS $HCOLL_FLAGS $EXE $INPUT_FILE
...