Skip to content
Snippets Groups Projects
Commit 6d8cadea authored by ESCOBAR MUNOZ Juan's avatar ESCOBAR MUNOZ Juan
Browse files

Juan 01/02/2023:set_rocm_bind_device, new script for better bing GPU & CPU on ADASTRA

parent 81c93705
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#set -x
GPUSID=(4 5 2 3 6 7 0 1)
Gpuinfo='rocm-smi -i'
NB_DEVICE=${NB_DEVICE:-$( ${Gpuinfo} | grep GPU | wc -l )}
[ ${NB_DEVICE} -eq 0 ] && NB_DEVICE=1
export LIP=${OMPI_COMM_WORLD_LOCAL_RANK:-${SLURM_LOCALID}}
export IP=${OMPI_COMM_WORLD_RANK:-${SLURM_PROCID}}
export NP=${OMPI_COMM_WORLD_SIZE:-${SLURM_NTASKS}}
export NN=${OMPI_MCA_orte_num_nodes:-${SLURM_NNODES}}
export NPN=$(( 1 + (NP-1)/ NN ))
export HN=$( hostname )
export IG=$(( LIP / ( 1 + (NPN-1) / NB_DEVICE ) ))
export ROCR_VISIBLE_DEVICES=${GPUSID[${IG}]}
echo LIP=${LIP} IP=${IP} NP=${NP} NN=${NN} NPN=${NPN} NG=${NB_DEVICE} IG=${IG} GPU=${ROCR_VISIBLE_DEVICES} ${HN} `taskset -pc $$`
exec $*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment