File indexing completed on 2024-04-06 12:28:25
0001
0002
0003 source xeon_scripts/stress-test-common.sh
0004
0005
0006
0007
0008
0009 function MkFitThroughput ()
0010 {
0011 local test_exe=${1}
0012 local nproc=${2}
0013 local njob=${3}
0014 local tmp_output_file=${4}
0015
0016
0017 for (( ijob = 0 ; ijob < ${njob} ; ijob++ ))
0018 do
0019
0020 { time ${test_exe} --num-events ${nproc} > /dev/null 2>&1 ; } 2> "${tmp_output_file}.${ijob}" &
0021 done
0022
0023
0024 wait
0025 }
0026 export -f MkFitThroughput
0027
0028
0029
0030
0031
0032 function DumpIntoFileThroughput ()
0033 {
0034 local tmp_output_file=${1}
0035 local output_file=${2}
0036
0037
0038 total_time=0
0039 while read -ra time_arr
0040 do
0041 local tmp_time=${time_arr[1]}
0042 local mins=$( echo "${tmp_time}" | cut -d "m" -f 1 )
0043 local secs=$( echo "${tmp_time}" | cut -d "m" -f 2 | cut -d "s" -f 1 )
0044 local total_time=$( bc -l <<< "${total_time} + ${mins} * 60 + ${secs}" )
0045 done < <(fgrep "real" "${tmp_output_file}")
0046
0047
0048 local ncore=$( grep "${ncore_label}" "${tmp_output_file}" | cut -d " " -f 2 )
0049
0050
0051 local njob=$( grep "${nloop_label}" "${tmp_output_file}" | cut -d " " -f 2 )
0052 local nproc=$( grep "${nproc_label}" "${tmp_output_file}" | cut -d " " -f 2 )
0053
0054
0055 local throughput=$( bc -l <<< "(${njob} * ${nproc}) / ${total_time}" )
0056
0057
0058 echo "${test_label} ${throughput}" >> "${output_file}"
0059 }
0060 export -f DumpIntoFileThroughput