Permalink
Browse files

require data directory argument to genTable.sh;

this removes the requirement to copy shell scripts around.
Also, process all the job summaries in one R invocation.
  • Loading branch information...
1 parent 0b9ffc8 commit 02974a3e174d79cfb61786ab331691c4f854c8da @pyrovski pyrovski committed Apr 20, 2012
Showing with 56 additions and 49 deletions.
  1. +1 −4 parse-scripts/README
  2. +17 −20 parse-scripts/genTable.sh
  3. +21 −21 parse-scripts/parsePowerData.sh
  4. +17 −4 parse-scripts/parse_rapl.sh
View
@@ -1,7 +1,4 @@
-To use the parse scripts, copy the three .sh files into a top-level directory
-that contains the data (a directory that contains all the 2012* for that benchmark).
-
-Run genTable.sh
+Run genTable.sh <data directory>
It should create table.out, which contains the power as well as timing data and general info.
View
@@ -5,9 +5,14 @@
#find . -name 'out.dat*' -print | sort -n > tmp
#cat tmp | xargs grep seconds | cut -d "=" -f 2 | sed 's/[ \t]*//g' > .time
+if [ -z "$1" ] ; then
+ echo "Usage: $0 <result directory>"
+ exit 1
+fi
+execDir=`dirname $0`
-find . -name 'info*' -print | sort -n > tmp2
+find $1 -name 'info*' -print | sort -n > tmp2
cat tmp2 | xargs grep cores | cut -d ":" -f 3 | sed 's/[ \t]*//g' > .cores
cat tmp2 | xargs grep nodes | cut -d ":" -f 3 |sed 's/[ \t]*//g' > .nodes
cat tmp2 | xargs grep MHz | sed -n '1~16p' | cut -d ":" -f 3 > .freq
@@ -16,29 +21,21 @@ paste -d ' ' .freq .nodes .cores > .info
#Now go to each directory and run the genData and parse_rapl scripts locally
-for d in `ls | grep 2012`
+rm -f clamp_data node_data.R.*
+i=0
+for d in `find $1 -name '2012*'`
do
- cd $d
- sh ../parsePowerData.sh
- #node_data.R should now exist
- ../parse_rapl.sh node_data.R
- #row.out should now exist
- cd ..
+ i=`expr $i + 1`
+ sh $execDir/parsePowerData.sh $d `printf "%04u" $i`
+ #node_data.R.$i should now exist
done;
+$execDir/parse_rapl.sh `ls node_data.R.*|sort -g` > row.out
+#row.out should now exist
-
-
-find . -name 'row.out*' -print > tmp3
-cat tmp3 |xargs sed 's/$//g' >> .power-table
-
-find . -name 'clamp_data*' -print > tmp4
-cat tmp4 |xargs cat >> .clamp-table
-
-
-paste -d ' ' .info .clamp-table .power-table > .final-table
+paste -d ' ' .info clamp_data row.out > .final-table
sed '1 i freq nodes cores pkg-clamp-0 pkg-clamp-1 dram-clamp-0 dram-clamp-1 avg-time avg-pkg-0 avg-pp0-0 avg-dram-0 avg-pkg-1 avg-pp0-1 avg-dram-1 tot-pkg-0 tot-pp0-0 tot-dram-0 tot-pkg-1 tot-pp0-1 tot-dram-1' .final-table > table.out
-rm tmp2 tmp3 tmp4
-rm .freq .cores .nodes .power-table .final-table .clamp-table
+#rm tmp2 tmp3 tmp4
+#rm .freq .cores .nodes .power-table .final-table .clamp-table
@@ -6,36 +6,36 @@
########################
-cat rzmerl* | grep ZZZ | cut -d " " -f 2 > .elapsed
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 2 > .elapsed
-cat rzmerl* | grep ZZZ | cut -d " " -f 3 > .PKG_W_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 4 > .PP0_W_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 5 > .DRAM_W_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 3 > .PKG_W_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 4 > .PP0_W_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 5 > .DRAM_W_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 60 > .PKG_W_1
-cat rzmerl* | grep ZZZ | cut -d " " -f 61 > .PP0_W_1
-cat rzmerl* | grep ZZZ | cut -d " " -f 62 > .DRAM_W_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 60 > .PKG_W_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 61 > .PP0_W_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 62 > .DRAM_W_1
paste -d ' ' .elapsed .PKG_W_0 .PP0_W_0 .DRAM_W_0 .PKG_W_1 .PP0_W_1 .DRAM_W_1 > .node_data
-sed '1 i elapsed PKG_W_0 PP0_W_0 DRAM_W_0 PKG_W_1 PP0_W_1 DRAM_W_1' .node_data > node_data.R
+sed '1 i elapsed PKG_W_0 PP0_W_0 DRAM_W_0 PKG_W_1 PP0_W_1 DRAM_W_1' .node_data > node_data.R.$2
########################
#Clamp and Enable information, just to be sure we're not beating around the bush here.
########################
-cat rzmerl* | grep ZZZ | cut -d " " -f 37 > .PKG_C_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 36 > .PKG_E_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 37 > .PKG_C_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 36 > .PKG_E_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 53 > .DRAM_C_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 52 > .DRAM_E_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 53 > .DRAM_C_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 52 > .DRAM_E_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 94 > .PKG_C_1
-cat rzmerl* | grep ZZZ | cut -d " " -f 93 > .PKG_E_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 94 > .PKG_C_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 93 > .PKG_E_1
-cat rzmerl* | grep ZZZ | cut -d " " -f 110 > .DRAM_C_1
-cat rzmerl* | grep ZZZ | cut -d " " -f 109 > .DRAM_E_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 110 > .DRAM_C_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 109 > .DRAM_E_1
paste -d ' ' .PKG_C_0 .PKG_E_0 .DRAM_C_0 .DRAM_E_0 .PKG_C_1 .PKG_E_1 .DRAM_C_1 .DRAM_E_1 > .en_bits
@@ -46,19 +46,19 @@ sed '1 i PKG_C_0 PKG_E_0 DRAM_C_0 DRAM_E_0 PKG_C_1 PKG_E_1 DRAM_C_1 DRAM_E_1' .e
#General Clamp Data
########################
-cat rzmerl* | grep ZZZ | cut -d " " -f 43 > .PKG_Lim1_W_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 100 > .PKG_Lim1_W_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 43 > .PKG_Lim1_W_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 100 > .PKG_Lim1_W_1
-cat rzmerl* | grep ZZZ | cut -d " " -f 59 > .DRAM_Lim1_W_0
-cat rzmerl* | grep ZZZ | cut -d " " -f 116 > .DRAM_Lim1_W_1
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 59 > .DRAM_Lim1_W_0
+cat $1/rzmerl* | grep ZZZ | cut -d " " -f 116 > .DRAM_Lim1_W_1
paste -d ' ' .PKG_Lim1_W_0 .PKG_Lim1_W_1 .DRAM_Lim1_W_0 .DRAM_Lim1_W_1 > .c_data
#Don't insert the header so you can just pick this data up and the top level script can add in the header.
#sed '1 i PKG_Lim1_W_0 PKG_Lim1_W_1 DRAM_Lim1_W_0 DRAM_Lim1_W_1' .c_data > clamp_data
#only grab one node, everything else is uniform
-cat .c_data | head -1 > clamp_data
+head -1 .c_data >> clamp_data
####################
@@ -1,6 +1,19 @@
#!/usr/bin/env Rscript
args <- commandArgs(trailingOnly = TRUE)
-a = read.table(args[1], header=T);
-x <- c(mean(a$elapsed), mean(a$PKG_W_0), mean(a$PP0_W_0), mean(a$DRAM_W_0), mean(a$PKG_W_1), mean(a$PP0_W_1), mean(a$DRAM_W_1), sum(a$PKG_W_0), sum(a$PP0_W_0), sum(a$DRAM_W_0), sum(a$PKG_W_1), sum(a$PP0_W_1), sum(a$DRAM_W_1))
-write.table(x, "row.out", eol=" ", col.names=FALSE, row.names=FALSE)
-
+for(i in args){
+a = read.table(i, header=T);
+x <- c(mean(a$elapsed),
+ mean(a$PKG_W_0),
+ mean(a$PP0_W_0),
+ mean(a$DRAM_W_0),
+ mean(a$PKG_W_1),
+ mean(a$PP0_W_1),
+ mean(a$DRAM_W_1),
+ sum(a$PKG_W_0),
+ sum(a$PP0_W_0),
+ sum(a$DRAM_W_0),
+ sum(a$PKG_W_1),
+ sum(a$PP0_W_1),
+ sum(a$DRAM_W_1))
+write.table(t(x), "", col.names=FALSE, row.names=FALSE)
+}

0 comments on commit 02974a3

Please sign in to comment.