[Swift-commit] r6061 - in SwiftApps/SciColSim: . benchmarks

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon Nov 19 13:26:06 CST 2012


Author: davidk
Date: 2012-11-19 13:26:06 -0600 (Mon, 19 Nov 2012)
New Revision: 6061

Modified:
   SwiftApps/SciColSim/Makefile
   SwiftApps/SciColSim/benchmarks/benchmark.sh
   SwiftApps/SciColSim/benchmarks/benchmark.swift
   SwiftApps/SciColSim/benchmarks/plot.gp
   SwiftApps/SciColSim/benchmarks/plot.sh
   SwiftApps/SciColSim/gengraphs.sh
Log:
Compile with profiling enabled
Update benchmark scripts to record memory usage
Various changes to the benchmarking scripts


Modified: SwiftApps/SciColSim/Makefile
===================================================================
--- SwiftApps/SciColSim/Makefile	2012-11-18 11:07:46 UTC (rev 6060)
+++ SwiftApps/SciColSim/Makefile	2012-11-19 19:26:06 UTC (rev 6061)
@@ -8,7 +8,7 @@
 	g++ -DP_OPENMP -static -O -fopenmp -I boost_1_47_0 -o openmp-optimizer optimizer.cpp
 
 graphsim: graphsim.cpp
-	g++ -DP_OPENMP -static -O -fopenmp -I boost_1_47_0 -o graphsim graphsim.cpp
+	g++ -DP_OPENMP -static -pg -O -fopenmp -I boost_1_47_0 -o graphsim graphsim.cpp
 
 clean:
 	@rm -rvf openmp-optimizer

Modified: SwiftApps/SciColSim/benchmarks/benchmark.sh
===================================================================
--- SwiftApps/SciColSim/benchmarks/benchmark.sh	2012-11-18 11:07:46 UTC (rev 6060)
+++ SwiftApps/SciColSim/benchmarks/benchmark.sh	2012-11-19 19:26:06 UTC (rev 6061)
@@ -2,18 +2,31 @@
 
 # Create run directory
 ORIGDIR=$PWD
-OUTPUT=$ORIGDIR/$3
+TIME_OUTPUT=$ORIGDIR/$3
+MEM_OUTPUT=$ORIGDIR/$4
+
 cd $HOME/SciColSim
 
+# Clean any previous run
 if [ -f "bestdb.txt" ]; then
    rm -f bestdb.txt
 fi
 
+# Run programs
 export OMP_NUM_THREADS=1 
-result=$( bin/timeout $2 ./graphsim 0 0 0 0 0 $1 40000 20 1 2 1 2. 0.01 1 0.3 2.3 0 0 0 0 0 m 1 | grep time | awk '{print $5}' )
+export WORK=$ORIGDIR
+tmpfile=$( mktemp -p . )
+tmpfile2=$( mktemp -p . )
+/usr/bin/time --format='Memory: %R' -a -o $tmpfile bin/timeout $2 ./graphsim 0 0 0 0 0 $1 40000 20 1 2 1 2. 0.01 1 0.3 2.3 0 0 0 0 0 m 1 > $tmpfile2
+memusage=$( grep Memory $tmpfile | awk '{print $2}' )
+timing=$( grep time $tmpfile2 | awk '{print $5}' )
+rm $tmpfile
+rm $tmpfile2
 
-if [ -n "$result" ]; then
-   echo $1 $result > $OUTPUT
+# Write results
+echo $1 $memusage > $MEM_OUTPUT
+if [ -n "$timing" ]; then
+   echo $1 $timing > $TIME_OUTPUT
 else
-   echo "$1 -1" > $OUTPUT
+   echo "$1 -1" > $TIME_OUTPUT
 fi

Modified: SwiftApps/SciColSim/benchmarks/benchmark.swift
===================================================================
--- SwiftApps/SciColSim/benchmarks/benchmark.swift	2012-11-18 11:07:46 UTC (rev 6060)
+++ SwiftApps/SciColSim/benchmarks/benchmark.swift	2012-11-19 19:26:06 UTC (rev 6061)
@@ -1,33 +1,38 @@
 type file;
 
 # Perform a single benchmark
-app (file o, file e) benchmark (int target_innovation, int tl)
+app (file timef, file memf, file errorf) benchmark (int target_innovation, int tl)
 {
-  benchmark target_innovation tl @filename(o) stderr=@e;
+  benchmark target_innovation tl @filename(timef) @filename(memf) stderr=@errorf;
 }
 
 # Create a plot from an array of result files
-app (file png) plot (file in1[], file gpl)
+app (file png) plot (file in1[], file in2[], file gpl)
 {
    plot @filename(png);
 }
 
 int target_innovation_start=1;
-int target_innovation_stop=10;
-int step=1;
-int time_limit=10;
+int target_innovation_stop=12000;
+int step=1000;
+int time_limit=86300;
 
 # Run benchmark
 #file graphs[] <filesys_mapper; location="graph", pattern="*">;
 file graph <"movie-graph.txt">;
 
-file results[];
+file timeresults[];
+file memresults[];
+
 foreach ti,tidx in [target_innovation_start:target_innovation_stop:step] {
-   file out <single_file_mapper; file=@strcat("results/benchmark-", ti, ".out")>;
+   file times <single_file_mapper; file=@strcat("times/times-", ti, ".out")>;
+   file mem <single_file_mapper; file=@strcat("mem/mem-", ti, ".out")>;
    file error <single_file_mapper; file=@strcat("errors/errors-", ti, ".err")>;
-   (out, error) = benchmark(ti, time_limit);
-   results[tidx] = out;
+   (times, mem, error) = benchmark(ti, time_limit);
+   timeresults[tidx] = times;
+   memresults[tidx] = mem;
 }
+
 file png <"results/plot.png">;
 file gp <"plot.gp">;
-png = plot(results, gp);
+png = plot(memresults, timeresults, gp);

Modified: SwiftApps/SciColSim/benchmarks/plot.gp
===================================================================
--- SwiftApps/SciColSim/benchmarks/plot.gp	2012-11-18 11:07:46 UTC (rev 6060)
+++ SwiftApps/SciColSim/benchmarks/plot.gp	2012-11-19 19:26:06 UTC (rev 6061)
@@ -5,5 +5,4 @@
 set xlabel "Target Innovation"
 set ylabel "Time in Seconds"
 set title "`basename $PLOT_OUTPUT .png`"
-plot "results.txt" using 1:2 with line
-
+plot "results.txt" using 1:2 with linespoints

Modified: SwiftApps/SciColSim/benchmarks/plot.sh
===================================================================
--- SwiftApps/SciColSim/benchmarks/plot.sh	2012-11-18 11:07:46 UTC (rev 6060)
+++ SwiftApps/SciColSim/benchmarks/plot.sh	2012-11-19 19:26:06 UTC (rev 6061)
@@ -2,5 +2,5 @@
 
 export PLOT_OUTPUT=$1
 export PLOT_TITLE=$( basename $( dirname $1 ))
-find . -name *.out -exec cat {} \; | sort -n > results.txt
+find . -name *.out -exec cat {} \; | sort -n | grep -v -- "-1" > results.txt
 gnuplot plot.gp

Modified: SwiftApps/SciColSim/gengraphs.sh
===================================================================
--- SwiftApps/SciColSim/gengraphs.sh	2012-11-18 11:07:46 UTC (rev 6060)
+++ SwiftApps/SciColSim/gengraphs.sh	2012-11-19 19:26:06 UTC (rev 6061)
@@ -6,4 +6,16 @@
   ./trimgraph.sh $s 1.0 > graph/$s.100
   ./trimgraph.sh $s 0.1 > graph/$s.10
   ./trimgraph.sh  $s 0.5 > graph/$s.50
-done
\ No newline at end of file
+done
+
+# Runtime, ram, science results (single floating pointer number called loss) for each param
+# Params = nodes, edges, and ti
+# As edges/nodes increase, time increases
+# 1000 osg jobs between 10 seconds and 24 hours
+# Example: iterate over ti in units of 100, graph sizes should be 
+# Automate, return eof when timed out, set max run time
+# Ability to see gprof output
+# Once with control structure he needs, then one run with large size to show hockey stick
+# Generate a table, then generate a graph
+# Email uc3 and midway account information
+




More information about the Swift-commit mailing list