add script and input files to generate Latex Tables
authoradash <adash>
Sun, 13 Dec 2009 20:13:38 +0000 (20:13 +0000)
committeradash <adash>
Sun, 13 Dec 2009 20:13:38 +0000 (20:13 +0000)
13 files changed:
Robust/src/Benchmarks/Prefetch/logres/LatexTblGenerator.java [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/logres/LatexTblGenerator_RR.java [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/logres/average.txt [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/logres/bench.in [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/logres/bench.txt [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/logres/bench1.txt [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/logres/count.sh [new file with mode: 0755]
Robust/src/Benchmarks/Prefetch/logres/jgfmoldyn_preprocess.sh [new file with mode: 0755]
Robust/src/Benchmarks/Prefetch/logres/jgfsor_preprocess.sh [new file with mode: 0755]
Robust/src/Benchmarks/Prefetch/logres/rainforest_preprocess.sh [new file with mode: 0755]
Robust/src/Benchmarks/Prefetch/logres/reformat.sh [new file with mode: 0755]
Robust/src/Benchmarks/Prefetch/logres/run.sh [new file with mode: 0755]
Robust/src/Benchmarks/Prefetch/logres/spamfilter_preprocess.sh [new file with mode: 0755]

diff --git a/Robust/src/Benchmarks/Prefetch/logres/LatexTblGenerator.java b/Robust/src/Benchmarks/Prefetch/logres/LatexTblGenerator.java
new file mode 100644 (file)
index 0000000..13b6178
--- /dev/null
@@ -0,0 +1,227 @@
+/**
+  * compile: javac LatexTblGenerator.java
+  * run: java LatexTblGenerator res.txt bench.txt latexresults1.txt
+  *
+**/
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.text.DecimalFormat;
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class LatexTblGenerator {
+  String inputfile;
+  String outorderfile;
+  String outputfile;
+  FileInputStream inStream;
+  FileInputStream outorderStream;
+  File outFile;
+  
+  Vector<BenchInfo> m_benchinfos;
+  
+  class BenchInfo {
+    public String benchname;
+    public int thdnum;
+    public float exenpnc;
+    public float exen;
+
+    public BenchInfo(String benchname) {
+      this.benchname = benchname;
+      this.thdnum = -1;
+      this.exenpnc = -1;
+      this.exen = -1;
+    }
+  }
+
+  public LatexTblGenerator(String input,
+                           String outputorder,
+                           String output) {
+    try{
+      this.inputfile = input;
+      this.outputfile = output;
+      this.outorderfile = outputorder;
+      this.inStream = new FileInputStream(this.inputfile);
+      this.outorderStream = new FileInputStream(this.outorderfile);
+      this.outFile = new File(this.outputfile);
+      this.m_benchinfos = new Vector<BenchInfo>();
+    } catch(Exception e) {
+      e.printStackTrace();
+      System.exit(-1);
+    }
+  }
+
+  public void process() {
+    try{
+      FileWriter resultFile = new FileWriter(this.outFile);
+      PrintWriter outputFile = new PrintWriter(resultFile);
+
+      byte[] b = new byte[1024 * 100];
+      int length = this.inStream.read(b);
+      if(length < 0) {
+        System.out.print("No content in input file: " + this.inputfile + "\n");
+        System.exit(-1);
+      }
+      String inputdata = new String(b, 0, length);
+      Vector<Integer> thds = new Vector<Integer>();
+
+      // process average.txt
+      // format: benchname  # thread  Exe-NPNC  Exe-N
+      int inindex = inputdata.indexOf('\n');
+      String inline = null;
+      int tmpinindex = 0;
+      while((inindex != -1) ) {
+        inline = inputdata.substring(0, inindex);
+        inputdata = inputdata.substring(inindex + 1);
+        //System.out.println("inline= " + inline + "   inputdata= " + inputdata);
+        tmpinindex = inline.indexOf(' ');
+        String benchname = inline.substring(0, tmpinindex);
+        inline = inline.substring(tmpinindex + 1);
+        while(inline.startsWith(" ")) {
+          inline = inline.substring(1);
+        }
+        tmpinindex = inline.indexOf(' ');
+        int thdnum = Integer.parseInt(inline.substring(0, tmpinindex));
+        inline = inline.substring(tmpinindex + 1);
+        while(inline.startsWith(" ")) {
+          inline = inline.substring(1);
+        }
+        tmpinindex = inline.indexOf(' ');
+        float exenpnc = Float.parseFloat(inline.substring(0, tmpinindex));
+        inline = inline.substring(tmpinindex + 1);
+        while(inline.startsWith(" ")) {
+          inline = inline.substring(1);
+        }
+        tmpinindex = inline.indexOf(' ');
+        float exen = Float.parseFloat(inline.substring(0, tmpinindex));
+        BenchInfo newbench = new BenchInfo(benchname);
+        newbench.thdnum = thdnum;
+        newbench.exenpnc = exenpnc;
+        newbench.exen = exen;
+        this.m_benchinfos.addElement(newbench);
+        int i = 0;
+        for(; i < thds.size(); i++) {
+          if(thds.elementAt(i) > thdnum) {
+            thds.insertElementAt(thdnum, i);
+            break;
+          } else if(thds.elementAt(i) == thdnum) {
+            break;
+          }
+        }
+        if(i == thds.size()) {
+          thds.addElement(thdnum);
+        }
+        inindex = inputdata.indexOf('\n');
+      }
+      
+      // parse the output order
+      byte[] bb = new byte[1024 * 100];
+      int length2 = this.outorderStream.read(bb);
+      if(length2 < 0) {
+        System.out.print("No content in input file: " + this.outorderfile + "\n");
+        System.exit(-1);
+      }
+      String outorder = new String(bb, 0, length2);
+      Vector<String> out_benchs = new Vector<String>();
+      inindex = outorder.indexOf('\n');
+      while((inindex != -1) ) {
+        out_benchs.addElement(outorder.substring(0, inindex));
+        outorder = outorder.substring(inindex + 1);
+        //System.printString(inline + "\n");
+        inindex = outorder.indexOf('\n');
+      }
+      
+      // output average time tbl
+      // format:
+      /*
+       * {
+  \footnotesize
+  \begin{center}
+  \begin{tabular}{c|cc|cc|cc|cc|cc}
+  & \multicolumn{2}{|c|}{2D Conv} & \multicolumn{2}{|c|}{Moldyn} & \multicolumn{2}{|c|}{Matrix Multiply} & \multicolumn{2}{|c|}{SOR} & \multicolumn{2}{|c}{2DFFT}\\
+  \hline
+  & Base & Prefetch & Base & Prefetch & Base & Prefetch & Base & Prefetch & Base & Prefetch\\
+  1J & 69.59 & --- & 122.97s & --- & 104.67s & --- & 351.36s & --- & 9.99s & ---\\
+  1 & 73.39s & --- & 123.17s & --- & 105.79s & --- & 844.69s & --- & 14.40s & ---\\
+  2 & 39.56s & 35.58s & 62.69s & 62.46s & 62.06s & 60.08s & 445.1s & 405.93s & 9.85s & 8.70s\\
+  4 & 21.31s & 19.37s & 36.55s & 32.66s & 36.92s & 33.31s & 232.06s & 215.98s & 6.37s & 5.83s\\
+  8 & 12.29s & 11.31s & 21.15s & 20.40s & 23.63s & 20.01s & 128.17s & 111.87s & 5.08s & 4.74s\\
+  \end{tabular}
+  \end{center}
+  }
+       */
+      DecimalFormat df = new DecimalFormat("#.00");
+      
+      outputFile.println("Numerical Benchmark Results Tbl:");
+      outputFile.println("{");
+      outputFile.println("\\footnotesize");
+      outputFile.println("\\begin{center}");
+      outputFile.print("\\begin{tabular}{c");
+      for(int i = 0; i < out_benchs.size(); i++) {
+        outputFile.print("|cc");
+      }
+      for(int i = 0; i < out_benchs.size(); i++) {
+        outputFile.print("& \\multicolumn{2}{|c|}{");
+        outputFile.print(out_benchs.elementAt(i));
+        outputFile.print("} ");
+      }
+      outputFile.println("\\\\");
+      outputFile.println("\\hline");
+      for(int i = 0; i < out_benchs.size(); i++) {
+        outputFile.print("& Base & Prefetch ");
+      }
+      outputFile.println("\\\\");
+      for(int i = 0; i < thds.size(); i++) {
+        int thd = thds.elementAt(i);
+        if(thd == 0) {
+          outputFile.print("1J");
+        } else {
+          outputFile.print(thd);
+        }
+        for(int j = 0; j < out_benchs.size(); j++) {
+          String bench = out_benchs.elementAt(j);
+          outputFile.print(" & ");
+          int k = 0;
+          for(; k < this.m_benchinfos.size(); k++) {
+            BenchInfo info = this.m_benchinfos.elementAt(k);
+            if(info.benchname.equals(bench) && (info.thdnum == thd)) {
+              if(info.exenpnc != -1) {
+                outputFile.print(df.format(info.exenpnc) + "s & ");
+              } else {
+                outputFile.print("--- & ");
+              }
+              if(info.exen != -1) {
+                outputFile.print(df.format(info.exen) + "s");
+              } else {
+                outputFile.print("---");
+              }
+              break;
+            }
+          }
+          if(k == this.m_benchinfos.size()) {
+            // did not find the bench
+            outputFile.print("--- & ---");
+          }
+        }
+        outputFile.println("\\\\");
+      }
+      
+      outputFile.println("\\end{tabular}");
+      outputFile.println("\\end{center}");
+      outputFile.println("}");
+      outputFile.flush();
+
+    } catch(Exception e) {
+      e.printStackTrace();
+      System.exit(-1);
+    }
+  }
+
+  public static void main(String[] args) throws Exception {
+    LatexTblGenerator rpp = new LatexTblGenerator(args[0], args[1], args[2]);
+    rpp.process();
+  }
+
+}
diff --git a/Robust/src/Benchmarks/Prefetch/logres/LatexTblGenerator_RR.java b/Robust/src/Benchmarks/Prefetch/logres/LatexTblGenerator_RR.java
new file mode 100644 (file)
index 0000000..5005de3
--- /dev/null
@@ -0,0 +1,250 @@
+// compile: javac LatexTblGenerator_RR.java
+// run: java LatexTblGenerator_RR bench1.txt <outputfile>
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.text.DecimalFormat;
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class LatexTblGenerator_RR {
+  String inputfile;
+  String outorderfile;
+  String outputfile;
+  FileInputStream inStream;
+  FileInputStream outorderStream;
+  File outFile;
+  
+  Vector<BenchInfo> m_benchinfos;
+  
+  class BenchInfo {
+    public String benchname;
+    public int thdnum;
+    public long rrnpnc;
+    public long rrn;
+
+    public BenchInfo(String benchname) {
+      this.benchname = benchname;
+      this.thdnum = -1;
+      this.rrnpnc = -1;
+      this.rrnpnc = -1;
+    }
+  }
+
+  public LatexTblGenerator_RR(String outputorder,
+                              String output) {
+    try{
+      this.inputfile = null;
+      this.outputfile = output;
+      this.outorderfile = outputorder;
+      this.outorderStream = new FileInputStream(this.outorderfile);
+      this.outFile = new File(this.outputfile);
+      this.m_benchinfos = new Vector<BenchInfo>();
+    } catch(Exception e) {
+      e.printStackTrace();
+      System.exit(-1);
+    }
+  }
+
+  public void process() {
+    try{
+      FileWriter resultFile = new FileWriter(this.outFile);
+      PrintWriter outputFile = new PrintWriter(resultFile);
+      
+      // parse the output order
+      byte[] bb = new byte[1024 * 100];
+      int length2 = this.outorderStream.read(bb);
+      if(length2 < 0) {
+        System.out.print("No content in input file: " + this.outorderfile + "\n");
+        System.exit(-1);
+      }
+      String outorder = new String(bb, 0, length2);
+      Vector<String> out_benchs = new Vector<String>();
+      int inindex = outorder.indexOf('\n');
+      while((inindex != -1) ) {
+        out_benchs.addElement(outorder.substring(0, inindex));
+        outorder = outorder.substring(inindex + 1);
+        //System.printString(inline + "\n");
+        inindex = outorder.indexOf('\n');
+      }
+      bb = null;
+
+      Vector<Integer> thds = new Vector<Integer>();
+      for(int ii = 0; ii < out_benchs.size(); ii++) {
+        String benchname = out_benchs.elementAt(ii);
+        inputfile = "/tmp/adash/prefetch_rst/totalrst_" + benchname + ".txt";
+        this.inStream = new FileInputStream(this.inputfile);
+        
+        byte[] b = new byte[1024 * 100];
+        int length = this.inStream.read(b);
+        if(length < 0) {
+          System.out.print("No content in input file: " + this.inputfile + "\n");
+          System.exit(-1);
+        }
+        String inputdata = new String(b, 0, length);
+
+        // process totalrst_${bench}.txt
+        // format: THREAD   NPNC-RemoteRead NPNC-EXETime    NPNC-Abort  
+        //         NPNC-Commit % NPNC-Abort    N-RemoteRead    N-PrefetchHit   
+        //         N-EXETime   N-Abort N-Commit    % N-Abort   % Improvement   
+        //         % PrefetchHit
+        // omit the first line
+        inindex = inputdata.indexOf('\n');
+        inputdata = inputdata.substring(inindex + 1);
+        inindex = inputdata.indexOf('\n');
+        String inline = null;
+        int tmpinindex = 0;
+        while((inindex != -1) ) {
+          inline = inputdata.substring(0, inindex);
+          inputdata = inputdata.substring(inindex + 1);
+          //System.printString(inline + "\n");
+          tmpinindex = inline.indexOf('\t');
+          int thdnum = Integer.parseInt(inline.substring(0, tmpinindex)); // 1st colum
+          inline = inline.substring(tmpinindex + 1);
+          while(inline.startsWith(" ")) {
+            inline = inline.substring(1);
+          }
+          tmpinindex = inline.indexOf('\t');
+          long rrnpnc = Long.parseLong(inline.substring(0, tmpinindex));  // 2nd colum
+          inline = inline.substring(tmpinindex + 1);
+          while(inline.startsWith(" ")) {
+            inline = inline.substring(1);
+          }
+          tmpinindex = inline.indexOf('\t');  // 3rd colum
+          inline = inline.substring(tmpinindex + 1);
+          while(inline.startsWith(" ")) {
+            inline = inline.substring(1);
+          }
+          tmpinindex = inline.indexOf('\t');  // 4th colum
+          inline = inline.substring(tmpinindex + 1);
+          while(inline.startsWith(" ")) {
+            inline = inline.substring(1);
+          }
+          tmpinindex = inline.indexOf('\t');  // 5th colum
+          inline = inline.substring(tmpinindex + 1);
+          while(inline.startsWith(" ")) {
+            inline = inline.substring(1);
+          }
+          tmpinindex = inline.indexOf('\t');  // 6th colum
+          inline = inline.substring(tmpinindex + 1);
+          while(inline.startsWith(" ")) {
+            inline = inline.substring(1);
+          }
+          tmpinindex = inline.indexOf('\t');  
+          long rrn = Long.parseLong(inline.substring(0, tmpinindex));  // 7th colum
+          
+          BenchInfo newbench = new BenchInfo(benchname);
+          newbench.thdnum = thdnum;
+          newbench.rrnpnc = rrnpnc;
+          newbench.rrn = rrn;
+          this.m_benchinfos.addElement(newbench);
+          int i = 0;
+          if(!thds.contains(thdnum)) {
+            for(; i < thds.size(); i++) {
+              if(thds.elementAt(i) > thdnum) {
+                thds.insertElementAt(thdnum, i);
+                break;
+              } else if(thds.elementAt(i) == thdnum) {
+                break;
+              }
+            }
+            if(i == thds.size()) {
+              thds.addElement(thdnum);
+            }
+          }
+          inindex = inputdata.indexOf('\n');
+        }
+      }
+      
+      // output average time tbl
+      // format:
+      /*
+       * {
+  \footnotesize
+  \begin{center}
+  \begin{tabular}{c|cc|cc|cc|cc|cc}
+  & \multicolumn{2}{|c|}{2D Conv} & \multicolumn{2}{|c|}{Moldyn} & \multicolumn{2}{|c|}{Matrix Multiply} & \multicolumn{2}{|c|}{SOR} & \multicolumn{2}{|c}{2DFFT}\\
+  \hline
+  & Base & Prefetch & Base & Prefetch & Base & Prefetch & Base & Prefetch & Base & Prefetch\\
+  2 & 39.56s & 35.58s & 62.69s & 62.46s & 62.06s & 60.08s & 445.1s & 405.93s & 9.85s & 8.70s\\
+  4 & 21.31s & 19.37s & 36.55s & 32.66s & 36.92s & 33.31s & 232.06s & 215.98s & 6.37s & 5.83s\\
+  8 & 12.29s & 11.31s & 21.15s & 20.40s & 23.63s & 20.01s & 128.17s & 111.87s & 5.08s & 4.74s\\
+  \end{tabular}
+  \end{center}
+  }
+       */
+      DecimalFormat df = new DecimalFormat("#.00");
+      
+      outputFile.println("Remote Read Results Tbl:");
+      outputFile.println("{");
+      outputFile.println("\\footnotesize");
+      outputFile.println("\\begin{center}");
+      outputFile.print("\\begin{tabular}{c");
+      for(int i = 0; i < out_benchs.size(); i++) {
+        outputFile.print("|cc");
+      }
+      outputFile.println("}");
+      for(int i = 0; i < out_benchs.size(); i++) {
+        outputFile.print("& \\multicolumn{2}{|c|}{");
+        outputFile.print(out_benchs.elementAt(i));
+        outputFile.print("} ");
+      }
+      outputFile.println("\\\\");
+      outputFile.println("\\hline");
+      for(int i = 0; i < out_benchs.size(); i++) {
+        outputFile.print("& Base & Prefetch ");
+      }
+      outputFile.println("\\\\");
+      for(int i = 0; i < thds.size(); i++) {
+        int thd = thds.elementAt(i);
+        if(thd == 0) {
+          outputFile.print("1J");
+        } else {
+          outputFile.print(thd);
+        }
+        for(int j = 0; j < out_benchs.size(); j++) {
+          String bench = out_benchs.elementAt(j);
+          outputFile.print(" & ");
+          int k = 0;
+          for(; k < this.m_benchinfos.size(); k++) {
+            BenchInfo info = this.m_benchinfos.elementAt(k);
+            if(info.benchname.equals(bench) && (info.thdnum == thd)) {
+              if(info.rrnpnc != -1) {
+                outputFile.print(info.rrnpnc + " & ");
+              } else {
+                outputFile.print("--- & ");
+              }
+              if(info.rrn != -1) {
+                outputFile.print(info.rrn);
+              } else {
+                outputFile.print("---");
+              }
+              break;
+            }
+          }
+          if(k == this.m_benchinfos.size()) {
+            // did not find the bench
+            outputFile.print("--- & ---");
+          }
+        }
+        outputFile.println("\\\\");
+      }
+      
+      outputFile.println("\\end{tabular}");
+      outputFile.println("\\end{center}");
+      outputFile.println("}");
+      outputFile.flush();
+
+    } catch(Exception e) {
+      e.printStackTrace();
+      System.exit(-1);
+    }
+  }
+
+  public static void main(String[] args) throws Exception {
+    LatexTblGenerator_RR rpp = new LatexTblGenerator_RR(args[0], args[1]);
+    rpp.process();
+  }
+
+}
diff --git a/Robust/src/Benchmarks/Prefetch/logres/average.txt b/Robust/src/Benchmarks/Prefetch/logres/average.txt
new file mode 100644 (file)
index 0000000..74e9d02
--- /dev/null
@@ -0,0 +1,63 @@
+runlog/ChaseN.bin_remote_chase.txt 28.455
+runlog/ChaseNPNC.bin_local_chase.txt 1.929
+runlog/ChaseNPNC.bin_remote_chase.txt 105.159
+runlog/Convolution_javasingle_1000010002dconv.txt 34.198
+runlog/ConvolutionN.bin_2Thrd_1000010002dconv.txt 19.71
+runlog/ConvolutionN.bin_4Thrd_1000010002dconv.txt 10.746
+runlog/ConvolutionN.bin_8Thrd_1000010002dconv.txt 6.286
+runlog/ConvolutionNPNC.bin_2Thrd_1000010002dconv.txt 21.323
+runlog/ConvolutionNPNC.bin_4Thrd_1000010002dconv.txt 11.857
+runlog/ConvolutionNPNC.bin_8Thrd_1000010002dconv.txt 6.744
+runlog/ConvolutionNPNC.bin_local_1000010002dconv.txt 37.111
+runlog/fft2d_javasingle_15005fft2d.txt 16.288
+runlog/fft2dN.bin_2Thrd_15005fft2d.txt 14.81
+runlog/fft2dN.bin_4Thrd_15005fft2d.txt 9.794
+runlog/fft2dN.bin_8Thrd_15005fft2d.txt 7.694
+runlog/fft2dNPNC.bin_2Thrd_15005fft2d.txt 17.082
+runlog/fft2dNPNC.bin_4Thrd_15005fft2d.txt 11.152
+runlog/fft2dNPNC.bin_8Thrd_15005fft2d.txt 8.607
+runlog/fft2dNPNC.bin_local_15005fft2d.txt 25.089
+runlog/JGFMolDynBenchSizeB_javasingle_moldynverB.txt 103.096
+runlog/JGFMolDynBenchSizeBN.bin_2Thrd_moldynverB.txt 67.462
+runlog/JGFMolDynBenchSizeBN.bin_4Thrd_moldynverB.txt 32.72
+runlog/JGFMolDynBenchSizeBN.bin_8Thrd_moldynverB.txt 19.256
+runlog/JGFMolDynBenchSizeBNPNC.bin_2Thrd_moldynverB.txt 67.575
+runlog/JGFMolDynBenchSizeBNPNC.bin_4Thrd_moldynverB.txt 34.018
+runlog/JGFMolDynBenchSizeBNPNC.bin_8Thrd_moldynverB.txt 19.913
+runlog/JGFMolDynBenchSizeBNPNC.bin_local_moldynverB.txt 113.92
+runlog/MatrixMultiply_javasingle_65050mmver.txt 95.999
+runlog/MatrixMultiplyN.bin_2Thrd_65050mmver.txt 56.31
+runlog/MatrixMultiplyN.bin_4Thrd_65050mmver.txt 31.279
+runlog/MatrixMultiplyN.bin_8Thrd_65050mmver.txt 19.188
+runlog/MatrixMultiplyNPNC.bin_2Thrd_65050mmver.txt 58.616
+runlog/MatrixMultiplyNPNC.bin_4Thrd_65050mmver.txt 35.535
+runlog/MatrixMultiplyNPNC.bin_8Thrd_65050mmver.txt 23.611
+runlog/MatrixMultiplyNPNC.bin_local_65050mmver.txt 96.479
+runlog/RainForestN.bin_2Thrd_rainforest.txt 9.757
+runlog/RainForestN.bin_4Thrd_rainforest.txt 10.933
+runlog/RainForestN.bin_8Thrd_rainforest.txt 12.344
+runlog/RainForestNPC.bin_2Thrd_rainforest.txt 9.995
+runlog/RainForestNPC.bin_4Thrd_rainforest.txt 11.352
+runlog/RainForestNPC.bin_8Thrd_rainforest.txt 13.689
+runlog/RainForestNPNC.bin_2Thrd_rainforest.txt 10.216
+runlog/RainForestNPNC.bin_4Thrd_rainforest.txt 12.747
+runlog/RainForestNPNC.bin_8Thrd_rainforest.txt 16.725
+runlog/RainForestNPNC.bin_local_rainforest.txt 8.056
+runlog/SpamFilterN.bin_2Thrd_spamfilter2500.txt 2.952
+runlog/SpamFilterN.bin_4Thrd_spamfilter2500.txt 3.839
+runlog/SpamFilterN.bin_8Thrd_spamfilter2500.txt 5.329
+runlog/SpamFilterNPC.bin_2Thrd_spamfilter2500.txt 4.391
+runlog/SpamFilterNPC.bin_4Thrd_spamfilter2500.txt 5.174
+runlog/SpamFilterNPC.bin_8Thrd_spamfilter2500.txt 6.397
+runlog/SpamFilterNPNC.bin_2Thrd_spamfilter2500.txt 13.406
+runlog/SpamFilterNPNC.bin_4Thrd_spamfilter2500.txt 17.116
+runlog/SpamFilterNPNC.bin_8Thrd_spamfilter2500.txt 20.967
+runlog/SpamFilterNPNC.bin_local_spamfilter2500.txt 1.5
+runlog/JGFSORBenchSizeD_javasingle_sorverD.txt 239.051
+runlog/JGFSORBenchSizeDN.bin_2Thrd_sorverD.txt 360.978
+runlog/JGFSORBenchSizeDN.bin_4Thrd_sorverD.txt 183.134
+runlog/JGFSORBenchSizeDN.bin_8Thrd_sorverD.txt 98.005
+runlog/JGFSORBenchSizeDNPNC.bin_2Thrd_sorverD.txt 362.286
+runlog/JGFSORBenchSizeDNPNC.bin_4Thrd_sorverD.txt 183.662
+runlog/JGFSORBenchSizeDNPNC.bin_8Thrd_sorverD.txt 100.173
+runlog/JGFSORBenchSizeDNPNC.bin_local_sorverD.txt 646.864
diff --git a/Robust/src/Benchmarks/Prefetch/logres/bench.in b/Robust/src/Benchmarks/Prefetch/logres/bench.in
new file mode 100644 (file)
index 0000000..144237c
--- /dev/null
@@ -0,0 +1,7 @@
+RainForest N
+SpamFilter 2_e_500
+fft2d 1500_5 
+Convolution 1000_10000
+MatrixMultiply 650_50
+JGFMolDynBenchSizeB
+JGFSORBenchSizeD
diff --git a/Robust/src/Benchmarks/Prefetch/logres/bench.txt b/Robust/src/Benchmarks/Prefetch/logres/bench.txt
new file mode 100644 (file)
index 0000000..d57f3a9
--- /dev/null
@@ -0,0 +1,5 @@
+Convolution
+JGFMolDynBenchSizeB
+MatrixMultiply
+JGFSORBenchSizeD
+fft2d
diff --git a/Robust/src/Benchmarks/Prefetch/logres/bench1.txt b/Robust/src/Benchmarks/Prefetch/logres/bench1.txt
new file mode 100644 (file)
index 0000000..3d247c4
--- /dev/null
@@ -0,0 +1,7 @@
+SpamFilter
+RainForest
+Convolution
+JGFMolDynBenchSizeB
+MatrixMultiply
+JGFSORBenchSizeD
+fft2d
diff --git a/Robust/src/Benchmarks/Prefetch/logres/count.sh b/Robust/src/Benchmarks/Prefetch/logres/count.sh
new file mode 100755 (executable)
index 0000000..ea78b22
--- /dev/null
@@ -0,0 +1,148 @@
+#!/bin/sh
+printhelp() {
+       echo "Usage: ./count.sh < Input"
+}
+
+MAX_COUNT=`expr 8 \+ 1`
+
+INPUT_DIR=`pwd`
+RESULT_DIR=/tmp/adash/prefetch_rst
+OUTPUT=totalrst
+OUTPUTHELP=helper
+OUTPUTPREFETCH=prefetchrate
+
+FILE_NPNC=''
+FILE_N=''
+RR_NPNC=0
+PH_NPNC=0
+EXE_NPNC=0
+RR_N=0
+PH_N=0
+EXE_N=0
+IMPROVEMENT=0
+PREFETCHRATE=0
+A_NPNC=0
+SA_NPNC=0
+C_NPNC=0
+AR_NPNC=0
+TA_NPNC=0
+A_N=0
+SA_N=0
+C_N=0
+AR_N=0
+TA_N=0
+
+count=0
+thd=0
+mid=0
+max_mid=0
+
+if [ ! -d ${RESULT_DIR} ] ; then
+       mkdir ${RESULT_DIR}
+fi
+
+echo "Start"
+
+while read bench compileop ; do
+    echo "$bench"
+       echo "==== $bench ==== $compileop ===="  >> ${RESULT_DIR}/${OUTPUTHELP}_${bench}.txt
+       echo -e "# THREAD\tNPNC-RemoteRead\tNPNC-EXETime\tNPNC-Abort\tNPNC-Commit\t% NPNC-Abort\tN-RemoteRead\tN-PrefetchHit\tN-EXETime\tN-Abort\tN-Commit\t% N-Abort\t% Improvement\t% PrefetchHit"  >> ${RESULT_DIR}/${OUTPUT}_${bench}.txt
+       count=2
+
+       while [ "${count}" -lt "${MAX_COUNT}" ] 
+       do
+               echo "++++ $count ++++"  >> ${RESULT_DIR}/${OUTPUTHELP}_${bench}.txt
+               RR_NPNC=0
+               PH_NPNC=0
+               EXE_NPNC=0
+               RR_N=0
+               PH_N=0
+               EXE_N=0
+               IMPROVEMENT=0
+               PREFETCHRATE=0
+               A_NPNC=0
+               SA_NPNC=0
+               C_NPNC=0
+               AR_NPNC=0
+               TA_NPNC=0
+               A_N=0
+               SA_N=0
+               C_N=0
+               AR_N=0
+               TA_N=0
+
+               thd=${count}
+               mid=2
+               max_mid=`expr ${count} \+ 1`
+               while [ "${mid}" -lt "${max_mid}" ] 
+               do
+                       FILE_NPNC=${bench}NPNC.bin_${count}_${compileop}_thd_${thd}_dc-${mid}.txt
+                       FILE_N=${bench}N.bin_${count}_${compileop}_thd_${thd}_dc-${mid}.txt
+
+                       rrnpnc=`grep 'nRemoteReadSend' ${INPUT_DIR}/${FILE_NPNC} | awk '{print $3}'`
+                       RR_NPNC=`echo "scale=0; ${RR_NPNC} + ${rrnpnc}" | bc`
+                       phnpnc=`grep 'nprehashSearch' ${INPUT_DIR}/${FILE_NPNC} | awk '{print $3}'`
+                       PH_NPNC=`echo "scale=0; ${PH_NPNC} + ${phnpnc}" | bc`
+                       exenpnc=`grep 'executionTime' ${INPUT_DIR}/${FILE_NPNC} | awk '{print $3}'`
+                       EXE_NPNC=`echo "scale=4; ${EXE_NPNC} + ${exenpnc}" | bc`
+                       anpnc=`grep 'numTransAbort' ${INPUT_DIR}/${FILE_NPNC} | awk '{print $3}'`
+                       A_NPNC=`echo "scale=0; ${A_NPNC} + ${anpnc}" | bc`
+                       sanpnc=`grep 'nSoftAbort' ${INPUT_DIR}/${FILE_NPNC} | awk '{print $3}'`
+                       SA_NPNC=`echo "scale=0; ${SA_NPNC} + ${sanpnc}" | bc`
+                       cnpnc=`grep 'numTransCommit' ${INPUT_DIR}/${FILE_NPNC} | awk '{print $3}'`
+                       C_NPNC=`echo "scale=0; ${C_NPNC} + ${cnpnc}" | bc`
+
+                       rrn=`grep 'nRemoteReadSend' ${INPUT_DIR}/${FILE_N} | awk '{print $3}'`
+                       RR_N=`echo "scale=0; ${RR_N} + ${rrn}" | bc`
+                       phn=`grep 'nprehashSearch' ${INPUT_DIR}/${FILE_N} | awk '{print $3}'`
+                       PH_N=`echo "scale=0; ${PH_N} + ${phn}" | bc`
+                       exen=`grep 'executionTime' ${INPUT_DIR}/${FILE_N} | awk '{print $3}'`
+                       EXE_N=`echo "scale=4; ${EXE_N} + ${exen}" | bc`
+                       an=`grep 'numTransAbort' ${INPUT_DIR}/${FILE_N} | awk '{print $3}'`
+                       A_N=`echo "scale=0; ${A_N} + ${an}" | bc`
+                       san=`grep 'nSoftAbort' ${INPUT_DIR}/${FILE_N} | awk '{print $3}'`
+                       SA_N=`echo "scale=0; ${SA_N} + ${san}" | bc`
+                       cn=`grep 'numTransCommit' ${INPUT_DIR}/${FILE_N} | awk '{print $3}'`
+                       C_N=`echo "scale=0; ${C_N} + ${cn}" | bc`
+
+                       echo "mid: $mid, rrnpnc: $rrnpnc, phnpnc: $phnpnc, exenpnc: $exenpnc, anpnc: $anpnc, sanpnc: $sanpnc, cnpnc: $cnpnc, rrn: $rrn, phn: $phn, exen: $exen, an: $an, san: $san, cn: $cn"  >> ${RESULT_DIR}/${OUTPUTHELP}_${bench}.txt
+
+                       mid=`expr ${mid} \+ 1`
+               done
+
+               todiv=`expr ${count} \- 1`
+               RR_NPNC=`echo "scale=0; ${RR_NPNC} / ${todiv}" | bc`
+               PH_NPNC=`echo "scale=0; ${PH_NPNC} / ${todiv}" | bc`
+               EXE_NPNC=`echo "scale=4; ${EXE_NPNC} / ${todiv}" | bc`
+               A_NPNC=`echo "scale=0; ${A_NPNC} / ${todiv}" | bc`
+               SA_NPNC=`echo "scale=0; ${SA_NPNC} / ${todiv}" | bc`
+               C_NPNC=`echo "scale=0; ${C_NPNC} / ${todiv}" | bc`
+
+               RR_N=`echo "scale=0; ${RR_N} / ${todiv}" | bc`
+               PH_N=`echo "scale=0; ${PH_N} / ${todiv}" | bc`
+               EXE_N=`echo "scale=4; ${EXE_N} / ${todiv}" | bc`
+               A_N=`echo "scale=0; ${A_N} / ${todiv}" | bc`
+               SA_N=`echo "scale=0; ${SA_N} / ${todiv}" | bc`
+               C_N=`echo "scale=0; ${C_N} / ${todiv}" | bc`
+
+
+               echo "todiv: $todiv, RR_NPNC: $RR_NPNC, PH_NPNC: $PH_NPNC, EXE_NPNC: $EXE_NPNC, A_NPNC: $A_NPNC, SA_NPNC: $SA_NPNC, C_NPNC:$C_NPNC, RR_N: $RR_N, PH_N: $PH_N, EXE_N: $EXE_N, A_N: $A_N, SA_N: $SA_N, C_N: $C_N"  >> ${RESULT_DIR}/${OUTPUTHELP}_${bench}.txt
+               echo "+++++++++++"  >> ${RESULT_DIR}/${OUTPUTHELP}_${bench}.txt
+
+        IMPROVEMENT=`echo "scale=4; ${EXE_NPNC} - ${EXE_N}" | bc`
+               IMPROVEMENT=`echo "scale=2; ${IMPROVEMENT} * 100 / ${EXE_NPNC}" | bc`
+               PREFETCHRATE=`echo "scale=2; ${PH_N} * 100 / ${RR_NPNC}" | bc`
+        tmpvar=`echo "${A_NPNC} + ${C_NPNC}" | bc`
+               AR_NPNC=`echo "scale=2; ${A_NPNC} * 100 / $tmpvar " | bc`
+               TA_NAPC=`echo "scale=0; ${A_NPNC} + ${SA_NPNC}" | bc`
+               AR_N=`echo "scale=2; ${A_N} * 100 / (${A_N} + ${C_N})" | bc`
+               TA_N=`echo "scale=0; ${A_N} + ${SA_N}" | bc`
+       
+               echo -e "${thd}\t${RR_NPNC}\t${EXE_NPNC}\t${TA_NPNC}\t${C_NPNC}\t${AR_NPNC}\t${RR_N}\t${PH_N}\t${EXE_N}\t${TA_N}\t${C_N}\t${AR_N}\t${IMPROVEMENT}\t${PREFETCHRATE}"  >> ${RESULT_DIR}/${OUTPUT}_${bench}.txt
+
+               echo -e "${PREFETCHRATE}"  >> ${RESULT_DIR}/${OUTPUTPREFETCH}_thd_${count}.txt
+               
+               count=`expr ${count} \* 2`
+       done
+done
+echo "Finish"
diff --git a/Robust/src/Benchmarks/Prefetch/logres/jgfmoldyn_preprocess.sh b/Robust/src/Benchmarks/Prefetch/logres/jgfmoldyn_preprocess.sh
new file mode 100755 (executable)
index 0000000..d48e245
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+for file in `ls JGFMolDynBenchSizeB*`
+do
+  a=`echo $file`
+  b1=`echo $a | cut -f1 -d"_"`
+  b2=`echo $a | cut -f2 -d"_"`
+  b3=`echo $a | cut -f3 -d"_"`
+  b4=`echo $a | cut -f4 -d"_"`
+  b5=`echo $a | cut -f5 -d"_"`
+  c=${b1}_${b2}__${b3}_${b4}_${b5}
+  mv $file $c
+done
diff --git a/Robust/src/Benchmarks/Prefetch/logres/jgfsor_preprocess.sh b/Robust/src/Benchmarks/Prefetch/logres/jgfsor_preprocess.sh
new file mode 100755 (executable)
index 0000000..87c2157
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+for file in `ls JGFSORBenchSizeD*`
+do
+  a=`echo $file`
+  b1=`echo $a | cut -f1 -d"_"`
+  b2=`echo $a | cut -f2 -d"_"`
+  b3=`echo $a | cut -f3 -d"_"`
+  b4=`echo $a | cut -f4 -d"_"`
+  b5=`echo $a | cut -f5 -d"_"`
+  c=${b1}_${b2}__${b3}_${b4}_${b5}
+  mv $file $c
+done
diff --git a/Robust/src/Benchmarks/Prefetch/logres/rainforest_preprocess.sh b/Robust/src/Benchmarks/Prefetch/logres/rainforest_preprocess.sh
new file mode 100755 (executable)
index 0000000..aa2f2ed
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+for file in `ls RainForest*`
+do
+  a=`echo $file | sed 's/-N/N/'`
+  b1=`echo $a | cut -f1 -d"_"`
+  b2=`echo $a | cut -f2 -d"_"`
+  b3=`echo $a | cut -f3 -d"_"`
+  b4=`echo $a | cut -f4 -d"_"`
+  b5=`echo $a | cut -f5 -d"_"`
+  b6=`echo $a | cut -f6 -d"_"`
+  c=${b1}_${b3}_${b2}_${b4}_${b5}_${b6}
+  echo $c
+  mv $file $c
+done
diff --git a/Robust/src/Benchmarks/Prefetch/logres/reformat.sh b/Robust/src/Benchmarks/Prefetch/logres/reformat.sh
new file mode 100755 (executable)
index 0000000..771eda1
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+benchmarks='fft2d Convolution JGFMolDynBenchSizeB MatrixMultiply RainForest SpamFilter JGFSORBenchSizeD'
+FILENAME=res.txt
+cond=`expr 8 \+ 1`
+rm res.txt
+#echo "++Benchmark---NumThread---ExecTimeNPNC---ExecTimeN---PrefetchImprov%---SpeedUp++" >> $FILENAME
+
+for bm in $benchmarks
+do
+    t1=0
+    t1=`grep ${bm}_javasingle average.txt | awk '{print $2}'`
+    echo "${bm} 0 $t1 -1 -1" >>  $FILENAME
+    t2=0
+    t2=`grep ${bm}NPNC.bin_local average.txt | awk '{print $2}'`
+    echo "${bm} 1 $t2 -1 -1" >>  $FILENAME
+    thrdid=2
+    while [ "${thrdid}" -lt "$cond" ] 
+      do
+        t3=`grep ${bm}N.bin_${thrdid}Thrd average.txt | awk '{print $2}'`
+        t4=`grep ${bm}NPNC.bin_${thrdid}Thrd average.txt | awk '{print $2}'`
+        t5=`echo "scale=2; ((${t4} - ${t3}) / ${t4}) * 100" | bc`
+        t6=0
+        if [ ${thrdid} -eq 8 ]; then
+          t6=`echo "scale=2; (${t1} / ${t3})" | bc`
+        fi
+        echo "${bm} ${thrdid} $t4 $t3 $t5 $t6" >> $FILENAME
+        thrdid=`expr $thrdid \+ $thrdid`
+      done
+done
diff --git a/Robust/src/Benchmarks/Prefetch/logres/run.sh b/Robust/src/Benchmarks/Prefetch/logres/run.sh
new file mode 100755 (executable)
index 0000000..db870ee
--- /dev/null
@@ -0,0 +1,5 @@
+#./rainforest_preprocess.sh
+#./spamfilter_preprocess.sh
+#./jgfmoldyn_preprocess.sh
+#./jgfsor_preprocess.sh
+./count.sh < bench.in
diff --git a/Robust/src/Benchmarks/Prefetch/logres/spamfilter_preprocess.sh b/Robust/src/Benchmarks/Prefetch/logres/spamfilter_preprocess.sh
new file mode 100755 (executable)
index 0000000..b04549c
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+for file in `ls SpamFilter*`
+do
+  a=`echo $file | sed 's/-e/e/'| sed 's/-t_//'`
+  b1=`echo $a | cut -f1 -d"_"`
+  b2=`echo $a | cut -f2 -d"_"`
+  b3=`echo $a | cut -f3 -d"_"`
+  b4=`echo $a | cut -f4 -d"_"`
+  b5=`echo $a | cut -f5 -d"_"`
+  b6=`echo $a | cut -f6 -d"_"`
+  b7=`echo $a | cut -f7 -d"_"`
+  b8=`echo $a | cut -f8 -d"_"`
+  c=${b1}_${b5}_${b2}_${b3}_${b4}_${b6}_${b7}_${b8}
+  echo $c
+  mv $file $c
+done