[Swift-commit] r6040 - SwiftApps/SciColSim/benchmarks

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Wed Nov 14 00:32:29 CST 2012


Author: davidk
Date: 2012-11-14 00:32:29 -0600 (Wed, 14 Nov 2012)
New Revision: 6040

Modified:
   SwiftApps/SciColSim/benchmarks/benchmark.sh
   SwiftApps/SciColSim/benchmarks/benchmark.swift
Log:
Timeouts


Modified: SwiftApps/SciColSim/benchmarks/benchmark.sh
===================================================================
--- SwiftApps/SciColSim/benchmarks/benchmark.sh	2012-11-14 02:15:28 UTC (rev 6039)
+++ SwiftApps/SciColSim/benchmarks/benchmark.sh	2012-11-14 06:32:29 UTC (rev 6040)
@@ -1,8 +1,30 @@
-#!/bin/bash
+#!/bin/bash -x
 
+cleanup()
+{
+    kill -s 0 $a || echo -1  >> $OUTPUT
+    trap - ALRM 
+    kill -ALRM $a 2>/dev/null
+    kill $! 2>/dev/null && 
+    exit 0 
+}
+
+watchit()
+{
+    trap "cleanup" ALRM
+    sleep $1 & wait
+    kill -ALRM $$
+}
+
 # Create run directory
+ORIGDIR=$PWD
+OUTPUT=$ORIGDIR/$3
 cd /home/davidk/SciColSim
 
-# Run testgraph
-echo -n "$1 "
-./testgraph.py $1 |grep time | awk '{print $5}'
+watchit $2& a=$!
+trap "cleanup" ALRM INT
+echo -n "$1 " > $OUTPUT
+./testgraph.py $1 |grep time | awk '{print $5}' >> $OUTPUT & wait $!; RET=$?
+kill -ALRM $a
+wait $a
+exit $RET

Modified: SwiftApps/SciColSim/benchmarks/benchmark.swift
===================================================================
--- SwiftApps/SciColSim/benchmarks/benchmark.swift	2012-11-14 02:15:28 UTC (rev 6039)
+++ SwiftApps/SciColSim/benchmarks/benchmark.swift	2012-11-14 06:32:29 UTC (rev 6040)
@@ -1,9 +1,9 @@
 type file;
 
 # Perform a single benchmark
-app (file o, file e) benchmark (int target_innovation)
+app (file o, file e) benchmark (int target_innovation, int tl)
 {
-  benchmark target_innovation stdout=@o stderr=@e;
+  benchmark target_innovation tl @filename(o) stderr=@e;
 }
 
 # Create a plot from an array of result files
@@ -12,9 +12,10 @@
    plot @filename(png);
 }
 
-int target_innovation_start=100;
-int target_innovation_stop=1000;
-int step=100;
+int target_innovation_start=1;
+int target_innovation_stop=10;
+int step=1;
+int time_limit=10;
 
 # Run benchmark
 #file graphs[] <filesys_mapper; location="graph", pattern="*">;
@@ -24,7 +25,7 @@
 foreach ti,tidx in [target_innovation_start:target_innovation_stop:step] {
    file out <single_file_mapper; file=@strcat("results/benchmark-", ti, ".out")>;
    file error <single_file_mapper; file=@strcat("errors/errors-", ti, ".err")>;
-   (out, error) = benchmark(ti);
+   (out, error) = benchmark(ti, time_limit);
    results[tidx] = out;
 }
 file png <"results/plot.png">;




More information about the Swift-commit mailing list