#! /bin/sh # #SBATCH -N4 -n4 --partition=fast # mpirun number of nodes # H="-n 4" # man awk: # rand() Return a random number N, between 0 and 1, such that 0 <= N < 1. # srand([expr]) Use expr as the new seed for the random number generator. # If no expr is provided, use the time of day. # seed=$(awk 'BEGIN { srand(); print int(rand()*lshift(1,31)); }' < /dev/null) # mpirun --bind-to none # default binding is to socket, which limits #cores used = #sockets # check using e.g. mpstat -P ALL 5 5 and see also --report-bindings date for NX in 27 28 29 30 31 32 33 do for T in 1 2 4 8 16 32 do echo "nx = $NX, t = $T" mpirun_args="$H --bind-to none -x OMP_NUM_THREADS=$T" cmd="mpirun $mpirun_args ./BV-omp -s$seed -r -c11 $NX" echo "$cmd" eval time -p "$cmd" done done date