|
@@ -0,0 +1,110 @@
|
|
|
+#! /bin/bash
|
|
|
+
|
|
|
+# This script takes one argument.
|
|
|
+
|
|
|
+# 1st argument is the classifier name from:
|
|
|
+# AdaBoostClassifier
|
|
|
+# BayesianRidge
|
|
|
+# GaussianProcessClassifier
|
|
|
+# GaussianProcessRegressor
|
|
|
+# KernelRidge
|
|
|
+# Lars
|
|
|
+# Lasso
|
|
|
+# LinearDiscriminantAnalysis
|
|
|
+# LinearRegression
|
|
|
+# LogisticRegression
|
|
|
+# PassiveAggressiveClassifier
|
|
|
+# Perceptron
|
|
|
+# QuadraticDiscriminantAnalysis
|
|
|
+# RandomForestClassifier
|
|
|
+# RandomForestRegressor
|
|
|
+# RidgeRegression
|
|
|
+# SGDClassifier
|
|
|
+# SGDRegressor
|
|
|
+# SVC
|
|
|
+# SVR
|
|
|
+# VotingClassifier
|
|
|
+
|
|
|
+#for bench in $(ls datasets | grep data | awk -F. '{print $1}')
|
|
|
+for bench in 784x40000 784x30000 784x15000 392x40000 392x30000 392x15000 196x40000 196x30000 784x7500
|
|
|
+do
|
|
|
+
|
|
|
+ mkdir -p cat-results/$1/${bench}
|
|
|
+
|
|
|
+ for way in 2 4 8 12 18 20
|
|
|
+ do
|
|
|
+ if (( $way == 2 ))
|
|
|
+ then
|
|
|
+ pqos -r -e "llc:1=0x00003;llc:2=0xffffc;"
|
|
|
+ elif (( $way == 4 ))
|
|
|
+ then
|
|
|
+ pqos -r -e "llc:1=0x0000f;llc:2=0xffff0;"
|
|
|
+ elif (( $way == 8 ))
|
|
|
+ then
|
|
|
+ pqos -r -e "llc:1=0x000ff;llc:2=0xfff00;"
|
|
|
+ elif (( $way == 12 ))
|
|
|
+ then
|
|
|
+ pqos -r -e "llc:1=0x00fff;llc:2=0xff000;"
|
|
|
+ elif (( $way == 18 ))
|
|
|
+ then
|
|
|
+ pqos -r -e "llc:1=0x3ffff;llc:2=0xc0000;"
|
|
|
+ elif (( $way == 20 ))
|
|
|
+ then
|
|
|
+ pqos -r -e "llc:1=0xfffff;llc:2=0xfffff;"
|
|
|
+ fi
|
|
|
+
|
|
|
+ pqos -a "llc:1=0;llc:2=1-47;"
|
|
|
+
|
|
|
+ mkdir -p cat-results/$1/${bench}/${way}-way
|
|
|
+
|
|
|
+ for (( x = 0; x < 10; x++ ))
|
|
|
+ do
|
|
|
+ ts=$(date +"%s")
|
|
|
+ mkdir -p cat-results/$1/${bench}/${way}-way/${ts}
|
|
|
+ touch cat-results/$1/${bench}/${way}-way/${ts}/${ts}.log
|
|
|
+ echo -n "Starting monitoring performance counters... " | tee -a cat-results/$1/${bench}/${way}-way/${ts}/${ts}.log
|
|
|
+ ./pcm.x 0.1 -r -csv=pcm.csv 1>&- 2>&- &
|
|
|
+ pcm_pid=$!
|
|
|
+ sleep 1s
|
|
|
+ echo "Success" | tee -a cat-results/$1/${bench}/${way}-way/${ts}/${ts}.log
|
|
|
+ sleep 5s
|
|
|
+
|
|
|
+ # Now let us also start our real application!
|
|
|
+ dataset="${bench}.data"
|
|
|
+ labels="${bench}.labels"
|
|
|
+ ram=1500m
|
|
|
+ id=0
|
|
|
+
|
|
|
+ docker run --rm \
|
|
|
+ -e CLF=$1 \
|
|
|
+ -e OMP_NUM_THREADS=1 \
|
|
|
+ -e RAM_SIZE=${ram} \
|
|
|
+ -e INPUT_DATA=${dataset} \
|
|
|
+ -e INPUT_LABELS=${labels} \
|
|
|
+ --memory="${ram}" \
|
|
|
+ --memory-swap="1000000m" \
|
|
|
+ --cpus=1 \
|
|
|
+ --cpuset-cpus=$id \
|
|
|
+ -v $(pwd):/shared pl4tinum/bench-profiling:0.1
|
|
|
+
|
|
|
+ echo -n "Killing pcm script... " | tee -a cat-results/$1/${bench}/${way}-way/${ts}/${ts}.log
|
|
|
+ kill -9 ${pcm_pid}
|
|
|
+ sleep 1s
|
|
|
+ echo "Done" | tee -a cat-results/$1/${bench}/${way}-way/${ts}/${ts}.log
|
|
|
+
|
|
|
+ #copy results to folder
|
|
|
+ echo "Moving output files"
|
|
|
+ echo "pcm.csv -> cat-results/$1/${bench}/${way}-way/${ts}/pcm.csv"
|
|
|
+ mv pcm.csv cat-results/$1/${bench}/${way}-way/${ts}/pcm.csv
|
|
|
+ sleep 0.1s
|
|
|
+ for i in $(find ./results/$1/ -maxdepth 1 -type f -printf "%f\n")
|
|
|
+ do
|
|
|
+ echo "results/$1/$i -> cat-results/$1/${bench}/${way}-way/${ts}/$i"
|
|
|
+ mv results/$1/$i cat-results/$1/${bench}/${way}-way/${ts}/$i
|
|
|
+ sleep 0.1s
|
|
|
+ done
|
|
|
+ echo "Done!"
|
|
|
+ sleep 2s
|
|
|
+ done
|
|
|
+ done
|
|
|
+done
|