diff --git a/test/memory_validation/run_scripts/global.cfg b/test/memory_validation/run_scripts/global.cfg index 387600bb3a..347be6f85f 100644 --- a/test/memory_validation/run_scripts/global.cfg +++ b/test/memory_validation/run_scripts/global.cfg @@ -48,3 +48,13 @@ function getColIds echo $colIds } +# check to make sure the profiling file has been generated +function checkProfRun +{ + rstfile=$1; logfile=$2 + if [ ! -f $rstfile ]; then + printf "${RED}ERROR: $rstfile not generated. See $logfile ...${NC}\n" + exit; + fi +} + diff --git a/test/memory_validation/run_scripts/test_cache_miss.sh b/test/memory_validation/run_scripts/test_cache_miss.sh index fd4b592b6a..20c25e3c87 100755 --- a/test/memory_validation/run_scripts/test_cache_miss.sh +++ b/test/memory_validation/run_scripts/test_cache_miss.sh @@ -74,16 +74,20 @@ function one_run local M=$3 local level=$4 rst_sym="N${N}_s${s}_M${M}k" - rst_file="${rst_sym}.csv" - #echo "$N: $s -- $OUT_DIR/$rst_file" + rst_file=$OUT_DIR/"${rst_sym}.csv" + #echo "$N: $s -- $rst_file" printf "\n Traverse %7s-int array in %5s-int stride with %4s accesses" \ $N $s "${M}K" ${ROCP_PATH}rocprof -i ${BASE_DIR}/../pmc_config_files/cache_pmc.txt -o \ - ${BASE_DIR}/../$OUT_DIR/$rst_file $PATH_CACHE_BENCH/cache $s $N $M \ + ${BASE_DIR}/../$rst_file $PATH_CACHE_BENCH/cache $s $N $M \ >> $log_file - colIds=$(getColIds $OUT_DIR/$rst_file) - sed -i 's/(.*)/(args)/g' $OUT_DIR/$rst_file + # check the profiling result + checkProfRun $rst_file $log_file + + colIds=$(getColIds $rst_file) + + sed -i 's/(.*)/(args)/g' $rst_file totTcpRds=0; totTcpWrs=0 # tcp rds/wrs missTcpRds=0; missTcpWrs=0 # tcp rd/wr misses @@ -93,7 +97,7 @@ function one_run for kern in $kerns do - values=`grep $kern $OUT_DIR/$rst_file | sed 's/,/ /g'` + values=`grep $kern $rst_file | sed 's/,/ /g'` for colIdStr in $colIds do colId=`echo $colIdStr | cut -f1 -d'|'` diff --git a/test/memory_validation/run_scripts/test_fetchwrite_size.sh b/test/memory_validation/run_scripts/test_fetchwrite_size.sh index 1d876fb28b..63dedd6e16 100755 --- a/test/memory_validation/run_scripts/test_fetchwrite_size.sh +++ b/test/memory_validation/run_scripts/test_fetchwrite_size.sh @@ -45,21 +45,25 @@ function one_run local M=$3 local level=$4 rst_sym="N${N}_s${s}_M${M}k" - rst_file="${rst_sym}.csv" - #echo "$N: $s -- $OUT_DIR/$rst_file" + rst_file=$OUT_DIR/"${rst_sym}.csv" + #echo "$N: $s -- $rst_file" printf "\n Traverse %5s-int array in %5s-int stride with %4s accesses" \ $N $s "${M}K" ${ROCP_PATH}rocprof -i ${BASE_DIR}/../pmc_config_files/cache_pmc.txt -o \ - ${BASE_DIR}/../$OUT_DIR/$rst_file $PATH_CACHE_BENCH/cache $s $N $M \ + ${BASE_DIR}/../$rst_file $PATH_CACHE_BENCH/cache $s $N $M \ >> $log_file - colIds=$(getColIds $OUT_DIR/$rst_file) - sed -i 's/(.*)/(args)/g' $OUT_DIR/$rst_file + # check the profiling result + checkProfRun $rst_file $log_file + + colIds=$(getColIds $rst_file) + + sed -i 's/(.*)/(args)/g' $rst_file for kern in $kerns do mc32wrs=0; fetchsize=0; writesize=0 - values=`grep $kern $OUT_DIR/$rst_file | sed 's/,/ /g'` + values=`grep $kern $rst_file | sed 's/,/ /g'` for colIdStr in $colIds do colId=`echo $colIdStr | cut -f1 -d'|'`