-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·37 lines (28 loc) · 1.12 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -e
unset MKL_ENABLE_INSTRUCTIONS
export MKL_ENABLE_INSTRUCTIONS=AVX512_E1
#export MKL_VERBOSE=1
unset KMP_AFFINITY
export KMP_AFFINITY="granularity=fine,compact,0,0" # when HT if OFF
# export KMP_AFFINITY="granularity=fine,compact,1,0" # when HT is ON
total_cores=$(lscpu | grep 'CPU(s):' | head -1 | awk '{print $2}')
core_per_socker=$(lscpu | grep "Core(s) per socket" | awk '{print $4}')
core_num=$total_cores
# core_num=$core_per_socker
# core_num=1
core_idx=$[$core_num-2]
core_range='0-'${core_idx}
echo $core_range
unset OMP_NUM_THREADS
unset MKL_NUM_THREADS
export OMP_NUM_THREADS=${core_num}
export MKL_NUM_THREADS=${core_num}
./build.sh
output_dir=./build/output
#taskset -c ${core_range} numactl -l ${output_dir}/unit_test/test_axpy
#taskset -c ${core_range} numactl -l ${output_dir}/unit_test/test_gemm_mkl
#taskset -c ${core_range} numactl -l ${output_dir}/unit_test/test_convolution
#taskset -c ${core_range} numactl -l ${output_dir}/benchmark/bench_axpy
#taskset -c ${core_range} numactl -l ${output_dir}/benchmark/bench_gemm_mkl
#taskset -c ${core_range} numactl -l ${output_dir}/benchmark/bench_convolution