--- /dev/null
+import java.io.*;
+
+class analyze {
+ public static int NUM=30;
+ public static void main(String files[]) throws Exception {
+ int M=files.length-1;
+ String[][] names=new String[NUM][M];
+ long[][] times=new long[NUM][M];
+ long[][] aborts=new long[NUM][M];
+ long[][] commits=new long[NUM][M];
+ long[][] stalltime=new long[NUM][M];
+ long[][] backofftime=new long[NUM][M];
+ long[][] abortedtime=new long[NUM][M];
+ for(int i=0;i<(files.length-1);i++) {
+ BufferedReader br=new BufferedReader(new FileReader(files[i+1]));
+ String x;
+ int count=0;
+ while((x=br.readLine())!=null) {
+ int index=x.indexOf('=');
+ names[count][i]=x.substring(0, index);
+ String n=x.substring(index+1, x.length());
+ times[count][i]=Long.parseLong(n);
+ {
+ x=br.readLine();
+ int i1=x.indexOf('=');
+ int i2=x.indexOf(' ');
+ int i3=x.indexOf('=', i2);
+ String saborts=x.substring(i1+1, i2);
+ String scommits=x.substring(i3+1, x.length());
+ aborts[count][i]=Long.parseLong(saborts);
+ commits[count][i]=Long.parseLong(scommits);
+ }
+ {
+ x=br.readLine();
+ int i1=x.indexOf('=');
+ int i2=x.indexOf(' ');
+ int i3=x.indexOf('=', i2);
+ String stall=x.substring(i1+1, i2);
+ String backoff=x.substring(i3+1, x.length());
+ stalltime[count][i]=Long.parseLong(stall)/(2<<i);
+ backofftime[count][i]=Long.parseLong(backoff)/(2<<i);
+ }
+
+ {
+ x=br.readLine();
+ int i1=x.indexOf('=');
+ String abortedt=x.substring(i1+1, x.length());
+ abortedtime[count][i]=Long.parseLong(abortedt)/(2<<i);
+ }
+
+ count++;
+ }
+ }
+ String names2[]={"Lazy", "Fast", "Aggressive", "Suicide", "Timestamp", "Random", "Karma", "Polite", "Eruption", "AggressiveTime", "Fixed", "AggressiveFixed"};
+ if (files[0].equals("combined")) {
+ for(int j=0;j<M;j++) {
+ int numthreads=2<<j;
+ FileWriter fw=new FileWriter("file"+numthreads+".dat");
+ fw.write("version aborttime stalltime backofftime baseline\n");
+ for(int i=0;i<names2.length;i++) {
+ long totaltime=times[i][j];
+ long abortt=abortedtime[i][j];
+ long stallt=stalltime[i][j];
+ long backofft=backofftime[i][j];
+ long baset=totaltime-abortt-stallt-backofft;
+ fw.write(names2[i]+" "+abortt+" "+stallt+" "+backofft+" "+baset+"\n");
+ }
+ fw.close();
+ }
+ } else {
+ /* Do individual printing. */
+ System.out.print("X");
+ for(int i=0;i<names2.length;i++) {
+ System.out.print(" "+names2[i]);
+ }
+ System.out.println("");
+ int x=2;
+ for(int j=0;j<M;j++) {
+ System.out.print(x);x*=2;
+ for(int i=0;names[i][0]!=null;i++) {
+ if (files[0].equals("time")) {
+ System.out.print(" "+times[i][j]);
+ } else if (files[0].equals("abortpercent")) {
+ double percent=((double)aborts[i][j])/((double)(commits[i][j]+aborts[i][j]));
+ System.out.print(" "+percent);
+ } else if (files[0].equals("aborttime")) {
+ System.out.print(" "+abortedtime[i][j]);
+ } else if (files[0].equals("stalltime")) {
+ System.out.print(" "+stalltime[i][j]);
+ } else if (files[0].equals("backofftime")) {
+ System.out.print(" "+backofftime[i][j]);
+ }
+ }
+ System.out.println("");
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+set bar 1.000000
+set xlabel "Number of Threads"
+set ylabel "Abort Percentage"
+set terminal postscript enhanced eps "Times-Roman" 25
+set boxwidth 0.9 absolute
+set style fill pattern 0.00 border -1
+set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
+set key inside right top vertical Left reverse enhanced autotitles columnhead nobox
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set datafile missing '-'
+#set style data linespoints
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set style data histograms
+set xtics border in scale 1,0.5 nomirror offset character 0, 0, 0
+set xtics norangelimit
+set xrange [-.7:3.7]
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set grid ytics
+set yrange [ 0 : * ] noreverse nowriteback
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set locale "C"
+set output "fileabortpercent.eps"
+plot 'fileabortpercent.dat' using 2:xticlabels(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col, '' u 6 ti col, '' u 7 ti col, '' u 8 ti col, '' u 9 ti col, '' u 10 ti col, '' u 11 ti col, '' u 12 ti col, '' u 13 ti col
--- /dev/null
+set bar 1.000000
+set xlabel "Number of Threads"
+set ylabel "Abort Time(Clock Cycles)"
+set terminal postscript enhanced eps "Times-Roman" 25
+set boxwidth 0.9 absolute
+set style fill pattern 0.00 border -1
+set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
+set key inside right top vertical Left reverse enhanced autotitles columnhead nobox
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set datafile missing '-'
+#set style data linespoints
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set style data histograms
+set xtics border in scale 1,0.5 nomirror offset character 0, 0, 0
+set xtics norangelimit
+set xrange [-.7:3.7]
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set grid ytics
+set yrange [ 0 : * ] noreverse nowriteback
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set locale "C"
+set output "fileaborttime.eps"
+plot 'fileaborttime.dat' using 2:xticlabels(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col, '' u 6 ti col, '' u 7 ti col, '' u 8 ti col, '' u 9 ti col, '' u 10 ti col, '' u 11 ti col, '' u 12 ti col, '' u 13 ti col
--- /dev/null
+for i in KMeans Labyrinth3D Genome Vacation Yada Intruder Bayes SSCA2
+do
+java analyze time log${i}_2filter2 log${i}_4filter2 log${i}_8filter2 > filetime.dat
+gnuplot plottime.txt
+mv filetime.eps ${i}time.eps
+java analyze abortpercent log${i}_2filter2 log${i}_4filter2 log${i}_8filter2 > fileabortpercent.dat
+gnuplot plotabortpercent.txt
+mv fileabortpercent.eps ${i}abortpercent.eps
+java analyze aborttime log${i}_2filter2 log${i}_4filter2 log${i}_8filter2 > fileaborttime.dat
+gnuplot plotaborttime.txt
+mv fileaborttime.eps ${i}aborttime.eps
+java analyze stalltime log${i}_2filter2 log${i}_4filter2 log${i}_8filter2 > filestalltime.dat
+gnuplot plotstalltime.txt
+mv filestalltime.eps ${i}stalltime.eps
+java analyze backofftime log${i}_2filter2 log${i}_4filter2 log${i}_8filter2 > filebackofftime.dat
+gnuplot plotbackofftime.txt
+mv filebackofftime.eps ${i}backofftime.eps
+done
\ No newline at end of file
--- /dev/null
+set bar 1.000000
+set xlabel "Number of Threads"
+set ylabel "Backoff Time(Clock Cycles)"
+set terminal postscript enhanced eps "Times-Roman" 25
+set boxwidth 0.9 absolute
+set style fill pattern 0.00 border -1
+set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
+set key inside right top vertical Left reverse enhanced autotitles columnhead nobox
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set datafile missing '-'
+#set style data linespoints
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set style data histograms
+set xtics border in scale 1,0.5 nomirror offset character 0, 0, 0
+set xtics norangelimit
+set xrange [-.7:3.7]
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set grid ytics
+set yrange [ 0 : * ] noreverse nowriteback
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set locale "C"
+set output "filebackofftime.eps"
+plot 'filebackofftime.dat' using 2:xticlabels(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col, '' u 6 ti col, '' u 7 ti col, '' u 8 ti col, '' u 9 ti col, '' u 10 ti col, '' u 11 ti col, '' u 12 ti col, '' u 13 ti col
--- /dev/null
+set bar 1.000000
+set xlabel "Number of Threads"
+set ylabel "Clock Cycles"
+set terminal postscript enhanced eps "Times-Roman" 15
+set style fill pattern 4 border -1
+set key off
+set style histogram rows
+set datafile missing '-'
+set style data histograms
+set xtics nomirror rotate by -45 scale 0
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set grid ytics
+set yrange [ 0 : * ] noreverse nowriteback
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set locale "C"
+set output "filecombined.eps"
+plot newhistogram "2", 'file2.dat' using 2:xtic(1) ti col with histogram fs pattern 0 ls 0, '' u 3 ti col with histogram fs pattern 1 ls 0, '' u 4 ti col with histogram fs pattern 2 ls 0, '' u 5 ti col with histogram fill pattern 4 ls 0, \
+newhistogram "4", 'file4.dat' using 2:xtic(1) ti col with histogram fs pattern 0 ls 0, '' u 3 ti col with histogram fs pattern 1 ls 0, '' u 4 ti col with histogram fs pattern 2 ls 0, '' u 5 ti col with histogram fs pattern 4 ls 0, \
+newhistogram "8", 'file8.dat' using 2:xtic(1) ti col with histogram fs pattern 0 ls 0, '' u 3 ti col with histogram fs pattern 1 ls 0, '' u 4 ti col with histogram fs pattern 2 ls 0, '' u 5 ti col with histogram fs pattern 4 ls 0
--- /dev/null
+set bar 1.000000
+set xlabel "Number of Threads"
+set ylabel "Stall Time(Clock Cycles)"
+set terminal postscript enhanced eps "Times-Roman" 25
+set boxwidth 0.9 absolute
+set style fill pattern 0.00 border -1
+set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
+set key inside right top vertical Left reverse enhanced autotitles columnhead nobox
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set datafile missing '-'
+#set style data linespoints
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set style data histograms
+set xtics border in scale 1,0.5 nomirror offset character 0, 0, 0
+set xtics norangelimit
+set xrange [-.7:3.7]
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set grid ytics
+set yrange [ 0 : * ] noreverse nowriteback
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set locale "C"
+set output "filestalltime.eps"
+plot 'filestalltime.dat' using 2:xticlabels(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col, '' u 6 ti col, '' u 7 ti col, '' u 8 ti col, '' u 9 ti col, '' u 10 ti col, '' u 11 ti col, '' u 12 ti col, '' u 13 ti col
--- /dev/null
+set bar 1.000000
+set xlabel "Number of Threads"
+set ylabel "Clock Cycles"
+set terminal postscript enhanced eps "Times-Roman" 25
+set boxwidth 0.9 absolute
+set style fill pattern 0.00 border -1
+set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
+set key inside right top vertical Left reverse enhanced autotitles columnhead nobox
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set datafile missing '-'
+#set style data linespoints
+set style histogram clustered gap 2 title offset character 0, 0, 0
+set style data histograms
+set xtics border in scale 1,0.5 nomirror offset character 0, 0, 0
+set xtics norangelimit
+set xrange [-.7:3.7]
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set grid ytics
+set yrange [ 0 : * ] noreverse nowriteback
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set locale "C"
+set output "filetime.eps"
+plot 'filetime.dat' using 2:xticlabels(1) ti col, '' u 3 ti col, '' u 4 ti col, '' u 5 ti col, '' u 6 ti col, '' u 7 ti col, '' u 8 ti col, '' u 9 ti col, '' u 10 ti col, '' u 11 ti col, '' u 12 ti col, '' u 13 ti col
--- /dev/null
+#!/bin/bash
+for i in KMeans Labyrinth3D Genome Vacation Yada Intruder Bayes SSCA2
+#for i in Vacation Yada Intruder Bayes SSCA2
+do
+for t in 2 4 8
+do
+cat log${i}_${t}_p1 log${i}_${t}_p2 log${i}_${t}_p3 log${i}_${t}_p4 log${i}_${t}_p5 > log${i}_${t}
+done
+done
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+for i in KMeans Labyrinth3D Genome Vacation Yada Intruder Bayes SSCA2
+#for i in Vacation Yada Intruder Bayes SSCA2
+do
+for t in 2 4 8
+do
+grep -e Abort -e Stall log${i}_${t} > log${i}_${t}filter2
+done
+done
\ No newline at end of file