Only for mvapich2-gdr: #!/bin/bash # Usage: mpirun -n <num_proc> MV2_USE_AFFINITY=0 MV2_ENABLE_AFFINITY=0 ./launch ./bin
export CUDA_VISIBLE_DEVICES=$MV2_COMM_WORLD_LOCAL_RANK case $MV2_COMM_WORLD_LOCAL_RANK in [0]) cpus=0-3 ;; [1]) cpus=64-67 ;; [2]) cpus=72-75 ;; esac numactl --physcpubind=$cpus $@