فهرست منبع

SCRIPTS: Modified benchmark results store

Now we store the benchmark in a dedicated directory, taking care of
diving them in two subfolders (CPU and GPU). In this way we improve
overall structure and we do not clobber the base directory with files.
Andrea Gussoni 8 سال پیش
والد
کامیت
f31f61cf3d
1فایلهای تغییر یافته به همراه17 افزوده شده و 1 حذف شده
  1. 17 1
      utils/time-and-save.sh

+ 17 - 1
utils/time-and-save.sh

@@ -6,8 +6,24 @@ BASE_PATH=$(pwd)
 # Local variable to store if cpu or gpu directed benchmark
 TYPE=$3
 
+# Check if we need to create the directories to store the results
+if [ ! -d "results" ]; then
+    mkdir results
+fi
+
+if [ ! -d "results/$TYPE" ]; then
+    mkdir results/$TYPE
+fi
+
 # Enter in the directory passed as first parameter, then execute run and save the results in the file passed as second parameter
 cd $1
 BENCH_NAME=$1
+
+# Start the actual benchmark
 BENCH_TIME=`(/usr/bin/time -f "%e" ./run-$TYPE) 2>&1 > /dev/zero | tail -1`
-echo "$BENCH_NAME $BENCH_TIME" >> $BASE_PATH/$2
+
+# Save execution time in the log
+echo "$BENCH_NAME $BENCH_TIME" >> $BASE_PATH/results/$TYPE/$2
+
+# Sleep in order to give time to the power measurement script to reset.
+sleep 5