#! /bin/sh # # testing # n=6 echo "OMP_NUM_THREADS = $OMP_NUM_THREADS" for i in $(seq 0 $((n-1))) do cmd="./states-omp $n $i" #cmd="./states-omp-bad $n $i" echo "$cmd" #eval "$cmd" | egrep 'start|count' #eval "$cmd" | egrep 'count' | sort eval "$cmd" | sort -k2n -k4n done exit 0 # run states-omp with OMP_NUM_THREADS = number of cores # lscpu=$(lscpu | egrep '^(Core|Socket)') cores=$(echo "$lscpu" | awk 'BEGIN { cores=1; } { cores *= $NF; } END { print cores; }') export "OMP_NUM_THREADS=$cores" echo "OMP_NUM_THREADS = $OMP_NUM_THREADS" ./states-omp "$@"