#!/bin/bash
#location of HPL 
HPL_DIR=`pwd`

# Number of CPU cores
CPU_CORES_PER_GPU=5

export OMP_NUM_THREADS=$CPU_CORES_PER_GPU
export MKL_NUM_THREADS=$CPU_CORES_PER_GPU
export LD_LIBRARY_PATH=$HPL_DIR:$LD_LIBRARY_PATH

export CUDA_DEVICE_MAX_CONNECTIONS=16
export TRSM_CUTOFF=16000
export GPU_DGEMM_SPLIT=1

lrank=$OMPI_COMM_WORLD_LOCAL_RANK

case ${lrank} in
[0])
  export CUDA_VISIBLE_DEVICES=0
  numactl --cpunodebind=1 $HPL_DIR/xhpl
  ;;
esac

