File indexing completed on 2023-03-17 11:22:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 source xeon_scripts/init-env.sh
0030 source xeon_scripts/stress-test-common.sh
0031
0032
0033
0034
0035
0036
0037 ben_arch=${1}
0038 no_turbo=${2:-1}
0039 min_duration=${3:-1800}
0040 sleep_time=${4:-300}
0041 base_nevents=${5:-120}
0042
0043
0044 if [[ "${ben_arch}" == "SNB" ]]
0045 then
0046 mOpt="-j 12"
0047 maxcore=12
0048 declare -a instruction_sets=(SSE3 AVX)
0049 declare -a thread_combo_arr=("1 1" "6 6" "12 6" "12 12" "24 6" "24 12" "24 24")
0050 declare -a njob_arr=("12" "24")
0051 elif [[ "${ben_arch}" == "KNL" ]]
0052 then
0053 mOpt="-j 64"
0054 maxcore=64
0055 declare -a instruction_sets=(SSE3 AVX AVX2 AVX512)
0056 declare -a thread_combo_arr=("1 1" "32 32" "64 32" "64 64" "128 32" "128 64" "128 128" "256 32" "256 64" "256 128" "256 256")
0057 declare -a njob_arr=("32" "64" "128" "256")
0058 elif [[ "${ben_arch}" == "SKL-SP" ]]
0059 then
0060 mOpt="-j 32"
0061 maxcore=32
0062 declare -a instruction_sets=(SSE3 AVX AVX2 AVX512)
0063 declare -a thread_combo_arr=("1 1" "16 16" "32 16" "32 32" "48 16" "48 32" "64 16" "64 32" "64 64")
0064 declare -a njob_arr=("32" "64")
0065 else
0066 echo "${ben_arch} is not a valid architecture! Exiting..."
0067 exit
0068 fi
0069
0070
0071 dir=/data2/slava77/samples/
0072 subdir=2021/11834.0_TTbar_14TeV+2021/AVE_50_BX01_25ns/
0073 file=memoryFile.fv6.default.211008-c6b7c67.bin
0074
0075
0076 seeds="--cmssw-n2seeds"
0077 algo="--build-ce"
0078 opts="--silent --remove-dup --use-dead-modules --backward-fit"
0079 base_exe="./mkFit/mkFit --input-file ${dir}/${subdir}/${file} ${seeds} ${algo} ${opts}"
0080
0081
0082 base_outname="stress_test"
0083 output_file="${base_outname}_results.${ext}"
0084
0085
0086 echo "${no_turbo}" | PATH=/bin sudo /usr/bin/tee /sys/devices/system/cpu/intel_pstate/no_turbo > /dev/null 2>&1
0087
0088
0089
0090
0091
0092
0093 for instruction_set in "${instruction_sets[@]}"
0094 do
0095
0096 make distclean
0097 make ${mOpt} ${!instruction_set}
0098
0099
0100 for thread_combo in "${thread_combo_arr[@]}"
0101 do echo "${thread_combo}" | while read -r nth nev
0102 do
0103
0104 ncore=$( GetNCore "${nth}" "${maxcore}" )
0105 nproc=$(( ${base_nevents} * ${ncore} ))
0106
0107
0108 test_label="${instruction_set}_${nth_label}${nth}_${nev_label}${nev}"
0109 echo "Running stress test for: ${test_label}..."
0110
0111
0112 test_exe="${base_exe} --num-thr ${nth} --num-thr-ev ${nev}"
0113
0114
0115 tmp_output_file="${base_outname}_${test_label}.${tmp_ext}"
0116
0117
0118 { time MkFitLoop "${min_duration}" "${test_exe}" "${nproc}" "1" > /dev/null 2>&1 ; } 2> "${tmp_output_file}"
0119
0120
0121 sleep "${sleep_time}"
0122
0123
0124 AppendTmpFile "${tmp_output_file}" "${ncore}" "${nproc}" "${nloop}"
0125 done
0126 done
0127
0128
0129 for njob in "${njob_arr[@]}"
0130 do
0131
0132 ncore=$( GetNCore "${njob}" "${maxcore}" )
0133 nproc=$(( ${base_nevents} * ${ncore} ))
0134
0135
0136 test_label="${instruction_set}_${njob_label}${njob}"
0137 echo "Running stress test for: ${test_label}..."
0138
0139
0140 test_exe="${base_exe} --num-thr 1 --num-thr-ev 1"
0141
0142
0143 tmp_output_file="${base_outname}_${test_label}.${tmp_ext}"
0144
0145
0146 { time MkFitLoop "${min_duration}" "${test_exe}" "${nproc}" "${njob}" > /dev/null 2>&1 ; } 2> "${tmp_output_file}"
0147
0148
0149 AppendTmpFile "${tmp_output_file}" "${ncore}" "${nproc}" "${nloop}"
0150
0151
0152 sleep "${sleep_time}"
0153 done
0154
0155 done
0156
0157
0158
0159
0160
0161
0162 > "${output_file}"
0163 echo -e "Stress test meta-data\n" >> "${output_file}"
0164 echo "ben_arch: ${ben_arch}" >> "${output_file}"
0165 echo "no_turbo: ${no_turbo}" >> "${output_file}"
0166 echo "min_duration [s]: ${min_duration}" >> "${output_file}"
0167 echo "sleep_time [s]: ${sleep_time}" >> "${output_file}"
0168 echo "base_exe: ${base_exe}" >> "${output_file}"
0169 echo "base_nevents: ${base_nevents}" >> "${output_file}"
0170 echo -e "\nResults\n" >> "${output_file}"
0171
0172
0173 for instruction_set in "${instruction_sets[@]}"
0174 do
0175
0176 for thread_combo in "${thread_combo_arr[@]}"
0177 do echo "${thread_combo}" | while read -r nth nev
0178 do
0179
0180 test_label="${instruction_set}_${nth_label}${nth}_${nev_label}${nev}"
0181 echo "Computing time for: ${test_label}"
0182
0183
0184 tmp_output_file="${base_outname}_${test_label}.${tmp_ext}"
0185
0186
0187 DumpIntoFile "${tmp_output_file}" "${output_file}"
0188 done
0189 done
0190
0191
0192 for njob in "${njob_arr[@]}"
0193 do
0194
0195 test_label="${instruction_set}_${njob_label}${njob}"
0196 echo "Computing time for: ${test_label}"
0197
0198
0199 tmp_output_file="${base_outname}_${test_label}.${tmp_ext}"
0200
0201
0202 DumpIntoFile "${tmp_output_file}" "${output_file}"
0203 done
0204
0205 done
0206
0207
0208
0209
0210
0211 make distclean
0212 echo 1 | PATH=/bin sudo /usr/bin/tee /sys/devices/system/cpu/intel_pstate/no_turbo > /dev/null 2>&1
0213
0214
0215
0216
0217
0218 echo "Finished stress test!"