From ef41c44ca51033c5d48a251228b5ef309055c64f Mon Sep 17 00:00:00 2001
From: Jan Vales <e0726236@saturn.par.tuwien.ac.at>
Date: Sun, 29 Jan 2012 09:24:50 +0100
Subject: [PATCH] added scheduler variable to runall - also allow storage of
 multiple runs, so we can min() them against each other.

---
 prefix/runAll.sh | 43 +++++++++++++++++++++++++++++++++----------
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/prefix/runAll.sh b/prefix/runAll.sh
index 4967722..cbcdfaa 100755
--- a/prefix/runAll.sh
+++ b/prefix/runAll.sh
@@ -1,24 +1,47 @@
 #!/bin/bash
 
+#TODO: alle scheduler auswerten
+#TODO: werte der runs behalten (kein rm-rf stats) und bei jedem weiteren run soll parseDat.py alle vorhandenen runs auswerten und das minimum nehmen.
+#TODO: im notfall in bash auswerten, sollte python nicht einfach glob'ben können.
+#TODO: remove binname in output -> nonunique info - use raw filename instead.
+
 if [ ! -f numlist.bin ]; then
+	echo "generating numfile.bin"
 	dd if=/dev/urandom of=numlist.bin bs=1000 count=100000
 fi
 
+STARTTS="`date --iso-8601=minutes`"
+SCHEDULING="static dynamic guided runtime"
 ALGORITHMS="seq datapar recurse hillis_sum hillis_partial"
-RUNLIST="$(seq 100000 100000 1000000) $(seq 1000000 1000000 10000000) $(seq 10000000 10000000 100000000)"
+RUNLIST="$(seq 0 250000 1000000) $(seq 0 2500000 10000000)"
+# $(seq 0 25000000 100000000)"
 
+#TODO: siehe oben
 rm -rf stats
-mkdir -p stats
-touch stats/prefix.pre.dat
-
-ulimit -s unlimited
-for prog in $ALGORITHMS; do
-        echo $prog
-        for i in $RUNLIST; do
-                build/$prog -n $i | tee -a stats/prefix.pre.dat
-        done
+echo "STARTING: stats/raw/${STARTTS}"
+mkdir -p "stats/raw/${STARTTS}"
+
+for sched in $SCHEDULING; do
+        echo "***** sched: ${sched} *****"
+	OMP_SCHEDULE=sched
+	ulimit -s unlimited
+	for algo in $ALGORITHMS; do
+        	echo "*** algo: ${algo} ***"
+	        for i in $RUNLIST; do
+			if [ "$i" -eq "0" ] ; then
+				echo "* ignoring 0 run *"
+			else 
+        	        	build/$algo -n $i > "stats/raw/tmp" 2> /dev/null
+				cat "stats/raw/tmp"
+				mv stats/raw/tmp "stats/raw/${STARTTS}/${sched}_${algo}_n${i}"
+			fi
+        	done
+	done
 done
 
+echo "stats generation does not work - exitting"
+exit 0
+
 cd stats
 ./parseDat.py
 
-- 
2.43.0