Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 95 additions & 25 deletions coremark_pro/coremark_pro_run
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
coremark_pro_version="v1.1.2743"
commit="none"
test_name_run="coremark_pro"
test_name="coremark_pro"
arguments="$@"

exit_out()
Expand Down Expand Up @@ -103,8 +103,8 @@ $curdir/test_tools/gather_data ${curdir}
pull_data()
{
pro_file=`mktemp /tmp/pro_reduce_data.XXXXX`
test_name=${1}
grep "^${test_name}" coremark_pro_run* | cut -d':' -f2 > ${pro_file}
sub_test_name=${1}
grep "^${sub_test_name}" coremark_pro_run* | cut -d':' -f2 > ${pro_file}
multicore=0.0
singlecore=0.0
scaling=0.0
Expand All @@ -123,7 +123,7 @@ pull_data()
multicore=`echo "${multicore}/${iterations}" | bc -l`
singlecore=`echo "${singlecore}/${iterations}" | bc -l`
scaling=`echo "${scaling}/${iterations}" | bc -l`
printf "%-47s %10.2f %10.2f %10.2f\n" $test_name $multicore $singlecore $scaling >> $summary_file
printf "%-47s %10.2f %10.2f %10.2f\n" $sub_test_name $multicore $singlecore $scaling >> $summary_file
}

produce_summary_report()
Expand Down Expand Up @@ -155,8 +155,8 @@ produce_summary_report()
if [[ ${line} == "CoreMark"* ]]; then
found=0
fi
test_name=`echo $line | awk '{print $1}'`
pull_data $test_name
sub_test_name=`echo $line | awk '{print $1}'`
pull_data $sub_test_name
continue
fi
if [[ $line == "------"* ]]; then
Expand All @@ -168,12 +168,13 @@ produce_summary_report()

generate_csv_file()
{
start_time="${1}"
end_time="${2}"
#
# Create the csv file.
#

$TOOLS_BIN/test_header_info --front_matter --results_file results.csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $coremark_pro_version --test_name $test_name
echo Test:Multi iterations:Single Iterations:Scaling >> results.csv
$TOOLS_BIN/test_header_info --front_matter --results_file results.csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $coremark_pro_version --test_name $test_name --field_header "Test,Multi iterations,Single Iterations,Scaling"
items="^cjpeg-rose7-preset ^core ^linear_alg-mid-100x100-sp ^loops-all-mid-10k-sp ^nnet_test ^parser-125k ^radix2-big-64k ^sha-test ^zip-test"
for i in $items; do
multi_iter=0.0
Expand All @@ -194,22 +195,25 @@ generate_csv_file()
single_iter=`echo "scale = 2;$single_iter / ${samples}.00" | bc -l`
scaling=`echo "scale = 2;$scaling / ${samples}.00" | bc -l`
name=`echo $i | sed "s/\^//g"`
echo $name:$multi_iter:$single_iter:$scaling >> results.csv
data_string=$(build_data_string "${name}" "${multi_iter}" "${single_iter}" "${scaling}" "${start_time}" "${end_time}")
echo "${data_string}" >> results.csv
done
}

save_results()
{
value=`grep CoreMark-PRO coremark_pro.summary | head -1`
value_out=`echo $value | cut -d' ' -f2,3 | sed "s/ /:/g"`
echo "Score:${value_out}" >> results.csv
value_out1=`echo $value | cut -d' ' -f2`
value_out2=`echo $value | cut -d' ' -f3`
data_string=$(build_data_string "Score" "${value_out1}" "${value_out2}" "0" "0" "${start_time}" "${end_time}")
echo "$data_string" >> results.csv
grep -q ":::" results.csv
if [ $? -eq 0 ]; then
echo Failed > test_results_report
else
echo Ran > test_results_report
fi
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report" --results results.csv --test_name coremark_pro --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report" --results results.csv --test_name $test_name --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user
}

#
Expand Down Expand Up @@ -261,6 +265,27 @@ update_build_options()
popd >/dev/null
}

record_pcp_results()
{
test="$1"
results=$2
multi=$3

metric_name=`echo "${test}" | sed "s/-//g" | sed "s/ //g" | awk '{print $1}'`
#
# Only if we have results for the test.
#
grep -q "^${test}" $results
if [[ $? -eq 0 ]]; then
if [[ $multi -eq 1 ]]; then
value=`grep "^${test}" $results | awk '{print $2}'`
else
value=`grep "^${test}" $results | awk '{print $3}'`
fi
results2pcp_add_value "${metric_name}:${value}"
fi
}

run_coremark_pro()
{
if [ ! -d coremark-pro ]; then
Expand All @@ -286,6 +311,15 @@ run_coremark_pro()

if [ $to_use_pcp -eq 1 ]; then
source $TOOLS_BIN/pcp/pcp_commands.inc
#
# Create the openmetrics file.
#
rm -f ${run_dir}/openmetrics_coremark_pro_reset.txt
while IFS= read -r line
do
metric=`echo $line | sed "s/-//g"`
echo "${metric} NaN" >> ${run_dir}/openmetrics_coremark_pro_reset.txt
done < "${run_dir}/openmetrics_coremark_pro_base.txt"
setup_pcp
pcp_cfg=$TOOLS_BIN/pcp/default.cfg
pcp_dir=/tmp/pcp_coremark-pro_$(date +%Y.%m.%d-%H.%M.%S)
Expand All @@ -311,46 +345,82 @@ run_coremark_pro()
fi
numb_cpus=`cat /proc/cpuinfo | grep processor | wc -l`
for iter in $(seq 1 1 $to_times_to_run); do

#If we're using PCP, snap a chalk line at the start of the iteration and log the run number
if [[ $to_use_pcp -eq 1 ]]; then
start_pcp_subset
result2pcp iteration ${run_number}
start_pcp_subset
result2pcp iteration ${iter}
fi


start_time=$(retrieve_time_stamp)
make_flags="TARGET=linux64 XCMD=-c${numb_cpus} certify-all"
padded_iter=$(format_iteration_number $iter $to_times_to_run)
make -s $make_flags > coremark_pro_run_${padded_iter}
if [ $? -ne 0 ]; then
exit_out "Run failed, make $make_flags" 1
fi

# If we're using PCP, snap the chalk line at the end of the iteration
end_time=$(retrieve_time_stamp)
#
# If record the results.
#
if [[ $to_use_pcp -eq 1 ]]; then
stop_pcp_subset
#
# Single first
#
results2pcp_add_value "iteration:${iter}"
results2pcp_add_value "multicore:0"
while IFS= read -r line
do
record_pcp_results "$line" coremark_pro_run_${iter} 0
done < "${run_dir}/openmetrics_coremark_pro_base.txt"
#
# Commit it.
#
results2pcp_add_value_commit
#
# Clear it.
#
reset_pcp_om
stop_pcp_subset
start_pcp_subset
#
# Now multi
#
results2pcp_add_value "iteration:${iter}"
results2pcp_add_value "multicore:1"
while IFS= read -r line
do
record_pcp_results "$line" coremark_pro_run_${iter} 1
done < "${run_dir}/openmetrics_coremark_pro_base.txt"
#
# Commit it.
#
results2pcp_add_value_commit
#
# Clear it.
#
reset_pcp_om
fi
done

# If we're using PCP, stop logging
if [[ $to_use_pcp -eq 1 ]]; then
echo "Stop PCP"
stop_pcp
fi
if [[ $to_use_pcp -eq 1 ]]; then
stop_pcp_subset
stop_pcp
fi

for iter in $(seq 1 1 $to_times_to_run); do
produce_summary_report $iter $to_times_to_run
done

generate_csv_file
generate_csv_file "$start_time" "$end_time"
save_results


if [ $to_use_pcp -eq 1 ]; then
shutdown_pcp
fi

${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report,$pcp_dir" --results results.csv --test_name coremark_pro --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report,$pcp_dir" --results results.csv --test_name $test_name --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user
popd > /dev/null
}

Expand Down
17 changes: 17 additions & 0 deletions coremark_pro/openmetrics_coremark_pro_base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
iteration
running
numthread
runtime
throughput
latency
multicore
cjpeg-rose7-preset
core
linear_alg-mid-100x100-sp
loops-all-mid-10k-sp
nnet_test
parser-125k
radix2-big-64k
sha-test
zip-test
CoreMark-PRO