#!/bin/bash # Usage: mpirun -n MV2_USE_AFFINITY=0 MV2_ENABLE_AFFINITY=0 ./launch python test_script.py export CUDA_DEVICE_ORDER=PCI_BUS_ID 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 $@