scripts to convert data automatically into CSV file for reading into excel...no addin...
authorbdemsky <bdemsky>
Sat, 14 Nov 2009 11:57:27 +0000 (11:57 +0000)
committerbdemsky <bdemsky>
Sat, 14 Nov 2009 11:57:27 +0000 (11:57 +0000)
Robust/src/Benchmarks/SingleTM/add.java [new file with mode: 0644]
Robust/src/Benchmarks/SingleTM/toprocess [new file with mode: 0755]

diff --git a/Robust/src/Benchmarks/SingleTM/add.java b/Robust/src/Benchmarks/SingleTM/add.java
new file mode 100644 (file)
index 0000000..b00f56a
--- /dev/null
@@ -0,0 +1,40 @@
+import java.io.*;
+public class add {
+    public static void main(String args[]) {
+       String filename=args[0];
+       try {
+           BufferedReader br=new BufferedReader(new FileReader(filename));
+           long vals[]=new long[1000];
+           int numvals=0;
+           String nextline=null;
+           while((nextline=br.readLine())!=null) {
+               long v;
+               int start=nextline.indexOf("TIME=")+5;
+               String num=nextline.substring(start, nextline.length());
+               v=Long.parseLong(num);
+               vals[numvals++]=v;
+           }
+           long sum=0;
+           for(int i=0;i<numvals;i++) {
+               sum+=vals[i];
+           }
+           double ave=((double)sum)/numvals;
+           double diff=0;
+           for(int i=0;i<numvals;i++) {
+               double delta=vals[i]-ave;
+               diff+=delta*delta;
+           }
+           diff=diff/(numvals-1);
+           double std=Math.sqrt(diff);
+           double err=std/Math.sqrt(numvals);
+           if (args.length==1)
+               System.out.println(ave);
+           else
+               System.out.println(err);
+       } catch (Exception e) {
+           e.printStackTrace();
+       }
+    }
+
+
+}
\ No newline at end of file
diff --git a/Robust/src/Benchmarks/SingleTM/toprocess b/Robust/src/Benchmarks/SingleTM/toprocess
new file mode 100755 (executable)
index 0000000..81ec544
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+for bm in KMeans.bin Labyrinth.bin SSCA2.bin Genome.bin Vacation.bin yada.bin Intruder.bin Bayes.bin
+do
+echo Benchmark $bm >> spreadsheet
+echo type, 1, 2, 4, 8 >> spreadsheet
+for type in FIS FISAR DEB OPTSTM LOCK DV HYDV
+do
+line=$type
+stddevline=""
+for num in 1 2 4 8
+do
+cat log/${bm}_${num}_${type}_* | grep TIME= > tmpfile
+ave=`java add tmpfile`
+stddev=`java add tmpfile stddev`
+line="$line, $ave"
+stddevline="$stddevline, $stddev"
+done
+echo ${line}${stddevline} >> spreadsheet
+done
+done
\ No newline at end of file