浏览代码

SCRIPTS: Reorganized the structure of scripts

Now the scripts are divided in multiple folders to have a better
structure and not all in the same directory.

Also changed some details in the scripts.
Andrea Gussoni 7 年之前
父节点
当前提交
059fe440f2

+ 4 - 4
utils/Makefile

@@ -3,16 +3,16 @@
 all: requirements runtime benchmark power_measurement
 
 requirements:
-					./install-requirements.sh
+					deploy/install-requirements.sh
 
 runtime:
-					./get-and-compile-runtime.sh
+					deploy/get-and-compile-runtime.sh
 
 benchmark:
-					./get-and-compile-benchmark.sh
+					deploy/get-and-compile-benchmark.sh
 
 power_measurement:
-					./get-and-compile-power-utility.sh
+					deploy/get-and-compile-power-utility.sh
 
 clean:
 	        rm -rf build

+ 0 - 0
utils/deploy.sh → utils/deploy/deploy.sh


+ 2 - 1
utils/get-and-compile-benchmark.sh → utils/deploy/get-and-compile-benchmark.sh

@@ -18,7 +18,8 @@ cd rodinia-benchmark
 git checkout wip/platform-unification
 
 # Copy the script that time the benchmark in the benchmark directory
-cp $BASE_DIR/time-and-save.sh .
+cp $BASE_DIR/deploy/time-and-save.sh .
+cp -r $BASE_DIR/plot .
 
 # Compile the benchmarks
 make clean

+ 1 - 1
utils/get-and-compile-power-utility.sh → utils/deploy/get-and-compile-power-utility.sh

@@ -38,4 +38,4 @@ cp linux/SmartPower $BASE_DIR/build/rodinia-benchmark/
 
 # Add an udev rule that allows to communicate with the power measurement device even if the user is not root
 cd $BASE_DIR
-sudo cp libusb.rules /etc/udev/rules.d/99-hiid.rules
+sudo cp deploy/libusb.rules /etc/udev/rules.d/99-hiid.rules

+ 4 - 1
utils/get-and-compile-runtime.sh → utils/deploy/get-and-compile-runtime.sh

@@ -27,7 +27,10 @@ make clean
 cmake -DLLC_HOST_CPU=cortex-a15 ../
 make clean
 make -j8
-#sudo make install
+
+# Require user intervent to install the runtime
+read -p "Press enter to continue and install the runtime in the default path on the system, otherwise interrupt the process"
+sudo make install
 
 # Add the .icd file that enable the ocl-icd loader to identify the mali platform
 echo "/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so" | sudo tee /etc/OpenCL/vendors/mali.icd

+ 0 - 0
utils/install-requirements.sh → utils/deploy/install-requirements.sh


+ 0 - 0
utils/libusb.rules → utils/deploy/libusb.rules


+ 0 - 0
utils/time-and-save.sh → utils/deploy/time-and-save.sh


+ 0 - 0
utils/analyze.py → utils/plot/analyze.py


+ 0 - 0
utils/gnuplot.gnu → utils/plot/gnuplot.gnu


+ 7 - 10
utils/plot.py → utils/plot/plot.py

@@ -4,14 +4,15 @@ import matplotlib.mlab as mlab
 import matplotlib.pyplot as plt
 import matplotlib.patches as mpatches
 import seaborn
-seaborn.set()
 import os
 
+seaborn.set()
+
 # Helper function to attach labels to the bars
 def autolabel(subplot, bars):
     for bar in bars:
-        height = bar.get_height()
-        subplot.text(bar.get_x() + bar.get_width()/2., 1.05*height, '%d' % int(height), ha='center', va='bottom')
+        height = round(bar.get_height(), 1)
+        subplot.text(bar.get_x() + bar.get_width()/2., 1.05*height, '%s' % height, ha='center', va='bottom')
 
 # Helper function to strip away the "opencl/" prefix and other stuff from all the names
 def stripNames (category, names):
@@ -33,13 +34,9 @@ averageTotal = {}
 stderrTotal = {}
 
 # Import data from file
-averageTotal['cpu'] = np.genfromtxt('results/cpu/average.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
-averageTotal['gpu-primary'] = np.genfromtxt('results/gpu-primary/average.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
-averageTotal['gpu-secondary'] = np.genfromtxt('results/gpu-secondary/average.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
-stderrTotal['cpu'] = np.genfromtxt('results/cpu/stderr.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
-stderrTotal['gpu-primary'] = np.genfromtxt('results/gpu-primary/stderr.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
-stderrTotal['gpu-secondary'] = np.genfromtxt('results/gpu-secondary/stderr.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
-
+for platform in platforms:
+    averageTotal[platform] = np.genfromtxt('results/' + platform + '/average.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
+    stderrTotal[platform] = np.genfromtxt('results/' + platform + '/stderr.csv', dtype=None, delimiter=',', names=['name', 'time', 'power'])
 
 # Create the folder where to store the charts, if it doesn't already exist
 if not os.path.exists('charts'):

+ 3 - 3
utils/preprocess.py → utils/plot/preprocess.py

@@ -22,9 +22,9 @@ def purgeDouble(platform):
 
             # If we are not at the first iteration, the values of two power measurement are equal but the times are really different, it means that the data collection duplicated erroneously a value, so we set to null that field
             if previousRow != [] and previousRow[2] == row[2] and (float(previousRow[1]) - float(row[1])) > 2.5:
-                print("duplicate found and removed in:")
-                print(previousRow)
-                print(row)
+                #print("duplicate found and removed in:")
+                #print(previousRow)
+                #print(row)
                 row[2] = ''
             else:
                 row = row