## ## This file contains the different commands that were used ## to generate the results for the publication : ## Increasing the Degree of Parallelism Using Speculative Execution in Task-based Runtime Systems ## It is strongly recommanded to read them and use them ## knowing what they intend to do. ##  function clonerepo() { git clone --single-branch --branch=master https://gitlab.inria.fr/bramas/spetabaru.git cd spetabaru git checkout -b peerj0 tags/v0.15 } ######################################################################### ######################################################################### function allocjob() { # Alloc a node on slurm/plafrim salloc -N 1 --time=12:00:00 --exclusive -p longq } ######################################################################### ######################################################################### function loadmodules() { module purge module load slurm/17.11 compiler/gcc/7.3.0 build/cmake/3.13.0 } ######################################################################### ######################################################################### function buildall() { cmake .. make -j 4 make test } ######################################################################### ######################################################################### function runMC() { # Run all MC simulations for nbiter in 1 5 10 25 50 100 ; do echo "$nbiter" for (( idx=0 ; idx < 5 ; ++idx )) ; do echo " $idx" NBLOOPS=$nbiter NBTHREADS=5 NBPARTICLES=2000 ./Examples/MC/mc >> mc$nbiter.output done done } ######################################################################### ######################################################################### function runREMC() { # Run all REMC simulations for nbiter in 1 5 10 25 50 100 ; do echo "$nbiter" nbthreads=5 echo " $nbthreads" for (( idx=0 ; idx < 5 ; ++idx )) ; do echo " $idx" NBLOOPS=$nbiter NBTHREADS=$nbthreads NBPARTICLES=2000 ./Examples/MC/remc >> ./remc$nbiter-$nbthreads.output done for nbthreads in 10 15 20 25 ; do echo " $nbthreads" for (( idx=0 ; idx < 5 ; ++idx )) ; do echo " $idx" REMCNOSEQ=FALSE NBLOOPS=$nbiter NBTHREADS=$nbthreads NBPARTICLES=2000 ./Examples/MC/remc >> ./remc$nbiter-$nbthreads.output done done done } ######################################################################### ######################################################################### function generateMctableAvg() { allvalues=$(cat "mc$1.output" | grep "$2 =" | cut -d'=' -f 2 | xargs | tr " " "\n" | tr "." ",") avg=$(echo -e "$allvalues" | datamash --no-strict mean 1) echo $avg | tr "," "." } function generateMctableDev() { allvalues=$(cat "mc$1.output" | grep "$2 =" | cut -d'=' -f 2 | xargs | tr " " "\n" | tr "." ",") dev=$(echo -e "$allvalues" | datamash sstdev 1) echo $dev | tr "," "." } function generateMCtable() { echo "generateMCtable" allloops=$(cat mc*.output | grep "NbLoops =" | cut -d'=' -f 2 | sort -n | uniq | xargs) echo "All loops = $allloops" ##################################### echo "# nbloops seq task spec spec-reject spec-max1 spec-max2 spec-max3 spec-max4 spec-max5" > MC.tex for lp in $allloops ; do echo -ne "$lp" >> MC.tex for type in "seq" "task" "spec" "spec-reject" "spec-max-1" "spec-max-2" "spec-max-3" "spec-max-4" "spec-max-5" ; do avg=$(generateMctableAvg "$lp" "$type") dev=$(generateMctableDev "$lp" "$type") echo -ne "\t$avg" >> MC.tex done echo "" >> MC.tex done ##################################### echo "# nbloops task spec spec-reject spec-max1 spec-max2 spec-max3 spec-max4 spec-max5" > MCspeedup.tex for lp in $allloops ; do echo -ne "$lp" >> MCspeedup.tex avgseq=$(generateMctableAvg "$lp" "seq") for type in "task" "spec" "spec-reject" "spec-max-1" "spec-max-2" "spec-max-3" "spec-max-4" "spec-max-5" ; do speedup=$(echo $avgseq/$(generateMctableAvg "$lp" "$type") | bc -l) echo -ne "\t$speedup" >> MCspeedup.tex done echo "" >> MCspeedup.tex done } ######################################################################### ######################################################################### function generateRemctableAvg() { allvalues=$(cat "remc$1-$2.output" | grep "$3 =" | cut -d'=' -f 2 | xargs | tr " " "\n" | tr "." ",") avg=$(echo -e "$allvalues" | datamash --no-strict mean 1) echo $avg | tr "," "." } function generateRemctableDev() { allvalues=$(cat "remc$1-$2.output" | grep "$3 =" | cut -d'=' -f 2 | xargs | tr " " "\n" | tr "." ",") dev=$(echo -e "$allvalues" | datamash sstdev 1) echo $dev | tr "," "." } function generateREMCtable() { echo "generateREMCtable" allloops=$(cat remc*.output | grep "NbLoops =" | cut -d'=' -f 2 | sort -n | uniq | xargs) allthreads=$(cat remc*.output | grep "NumThreads =" | cut -d'=' -f 2 | sort -n | uniq | xargs) minnumthreads=$(echo "$allthreads" | tr " " "\n" | datamash --no-strict min 1) echo "All loops = $allloops" echo "All threads = $allthreads" echo "Min num threads = $minnumthreads" ##################################### echo -ne "# nbloops" > REMC.tex for th in $allthreads ; do for type in "seq" "task" "spec" "spec-reject" "spec-max-1" "spec-max-2" "spec-max-3" "spec-max-4" "spec-max-5" ; do if [[ "$th" == "$minnumthreads" ]] || [[ ( "$type" != "seq" && "$type" != "task" ) ]] ; then echo -ne "\t$type-$th" >> REMC.tex fi done done echo "" >> REMC.tex for lp in $allloops ; do echo -ne "$lp" >> REMC.tex for th in $allthreads ; do for type in "seq" "task" "spec" "spec-reject" "spec-max-1" "spec-max-2" "spec-max-3" "spec-max-4" "spec-max-5" ; do if [[ "$th" == "$minnumthreads" ]] || [[ ( "$type" != "seq" && "$type" != "task" ) ]] ; then avg=$(generateRemctableAvg "$lp" "$th" "$type") dev=$(generateRemctableDev "$lp" "$th" "$type") echo -ne "\t$avg" >> REMC.tex fi done done echo "" >> REMC.tex done ##################################### echo -ne "# nbloops" > REMCspeedup.tex for th in $allthreads ; do for type in "spec" "spec-reject" "spec-max-1" "spec-max-2" "spec-max-3" "spec-max-4" "spec-max-5" ; do echo -ne "\t$type-$th" >> REMCspeedup.tex done done echo "" >> REMCspeedup.tex for lp in $allloops ; do echo -ne "$lp" >> REMCspeedup.tex avgseq=$(generateRemctableAvg "$lp" "$minnumthreads" "task") for th in $allthreads ; do for type in "spec" "spec-reject" "spec-max-1" "spec-max-2" "spec-max-3" "spec-max-4" "spec-max-5" ; do speedup=$(echo $avgseq/$(generateRemctableAvg "$lp" "$th" "$type") | bc -l) echo -ne "\t$speedup" >> REMCspeedup.tex done done echo "" >> REMCspeedup.tex done }