[Swift-commit] r5762 - in SwiftApps/DSSAT/benchmark-release: . bin plots

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Fri Apr 27 15:27:13 CDT 2012


Author: davidk
Date: 2012-04-27 15:27:13 -0500 (Fri, 27 Apr 2012)
New Revision: 5762

Added:
   SwiftApps/DSSAT/benchmark-release/RunDSSAT.orig.swift
   SwiftApps/DSSAT/benchmark-release/plots/
   SwiftApps/DSSAT/benchmark-release/plots/extract4plots
   SwiftApps/DSSAT/benchmark-release/plots/plotit.gp
Modified:
   SwiftApps/DSSAT/benchmark-release/RunDSSAT.swift
   SwiftApps/DSSAT/benchmark-release/bin/RunDSSAT.sh
Log:
Script to plot based on progress bar
Updated wrapper and swift scripts to use strings rather than files


Added: SwiftApps/DSSAT/benchmark-release/RunDSSAT.orig.swift
===================================================================
--- SwiftApps/DSSAT/benchmark-release/RunDSSAT.orig.swift	                        (rev 0)
+++ SwiftApps/DSSAT/benchmark-release/RunDSSAT.orig.swift	2012-04-27 20:27:13 UTC (rev 5762)
@@ -0,0 +1,25 @@
+type file;
+
+app (file output) RunDSSAT (file input[], string _refdatapath, string _campaignpath, string _binpath)
+{
+  RunDSSAT @output @input _refdatapath _campaignpath _binpath;
+}
+
+//This is unused at the moment since it was used to check bad cells (bad cell means that the cell doesn't have soil files)
+app (file output) gridCheck (string path)
+{
+  gridCheck @output path;
+}
+
+string gridLists[] = readData("gridList.txt");
+
+//string campaign="grid_ccsm3_a2_bcsd";
+
+foreach g,i in gridLists{
+ file in1[] <filesys_mapper; location=@strcat(@arg("cmppath","/scratch/ketan/dssat/data/grid_ccsm3_a2_bcsd"), "/", gridLists[i]), pattern="*">;
+ file out<single_file_mapper; file=@strcat("output/", gridLists[i], "output.tar")>;
+ out = RunDSSAT(in1, @arg("refdata","/home/ketan/see/DSSAT/campaigns/common"), @arg("campaign", "/home/ketan/see/DSSAT/campaigns/GCM/ccsm3_a2_bcsd"), @arg("bindata","/home/ketan/see/DSSAT/bin"));
+
+}
+
+

Modified: SwiftApps/DSSAT/benchmark-release/RunDSSAT.swift
===================================================================
--- SwiftApps/DSSAT/benchmark-release/RunDSSAT.swift	2012-04-27 20:04:06 UTC (rev 5761)
+++ SwiftApps/DSSAT/benchmark-release/RunDSSAT.swift	2012-04-27 20:27:13 UTC (rev 5762)
@@ -1,8 +1,8 @@
 type file;
 
-app (file output) RunDSSAT (file input[], string _refdatapath, string _campaignpath, string _binpath)
+app (file output) RunDSSAT (file input[])
 {
-  RunDSSAT @output @input _refdatapath _campaignpath _binpath;
+  RunDSSAT @output @input ;
 }
 
 //This is unused at the moment since it was used to check bad cells (bad cell means that the cell doesn't have soil files)
@@ -11,15 +11,21 @@
   gridCheck @output path;
 }
 
+//gridList.txt contains the list of good grid cells
+//file gl <"gridList.txt">;
+
+//gridCheck app discards empty grid cells or those containing unusable files 
+//gl = gridCheck(@arg("path","/gpfs/pads/projects/CI-SES000031/data/dssat/grid/"));
+
 string gridLists[] = readData("gridList.txt");
 
-//string campaign="grid_ccsm3_a2_bcsd";
+foreach g,i in gridLists
+{
+//file out<single_file_mapper;file=@strcat("output/",gridLists[i],"output.tar")>;
+file out<concurrent_mapper;prefix="output", suffix=".tar">;
 
-foreach g,i in gridLists{
- file in1[] <filesys_mapper; location=@strcat(@arg("cmppath","/scratch/ketan/dssat/data/grid_ccsm3_a2_bcsd"), "/", gridLists[i]), pattern="*">;
- file out<single_file_mapper; file=@strcat("output/", gridLists[i], "output.tar")>;
- out = RunDSSAT(in1, @arg("refdata","/home/ketan/see/DSSAT/campaigns/common"), @arg("campaign", "/home/ketan/see/DSSAT/campaigns/GCM/ccsm3_a2_bcsd"), @arg("bindata","/home/ketan/see/DSSAT/bin"));
+file in1[] <filesys_mapper;location=@strcat(@arg("path","/gpfs/pads/projects/CI-SES000031/data/dssat/grid/"), gridLists[i]), pattern="*">;
 
+out = RunDSSAT(in1);
 }
 
-

Modified: SwiftApps/DSSAT/benchmark-release/bin/RunDSSAT.sh
===================================================================
--- SwiftApps/DSSAT/benchmark-release/bin/RunDSSAT.sh	2012-04-27 20:04:06 UTC (rev 5761)
+++ SwiftApps/DSSAT/benchmark-release/bin/RunDSSAT.sh	2012-04-27 20:27:13 UTC (rev 5762)
@@ -4,43 +4,29 @@
 mkdir run
 cd run
 mkdir data
-
 out=$1
-indata=$2
-refdata=$3
-campaign=$4
-binpath=$5
 
 #copy files of grid cell into data directory
 for i in $2
 do
-  cp ../$i data
-#echo "commented"
+  cp ../$i data;
 done
+                                              
+cp /gpfs/pads/projects/CI-SES000031/csm/sim/* data          
+cp /gpfs/pads/projects/CI-SES000031/csm/*.CDE data
 
-#cp -v $2/* data
+cp /gpfs/pads/projects/CI-SES000031/csm/dssat.papia/bin/*.EXE .
+cd data                                                             
 
-cp  $refdata/* data
-cp  $campaign/*.MZX data
-cp  $binpath/*.EXE .
-
-cd data
-
-../DSSAT040.EXE A X1234567.MZX &> RESULT.OUT
-exit_status=$?
-
+../DSSAT040.EXE A H1234567.MZX > RESULT.OUT
+ 
 cd ..
 mkdir output
 
-cp data/*.OUT output
+mv data/*.OUT output
+mv data/RESULT.OUT output
 
 tar cf ../$out output
 
-if [ "$exit_status" -ne 0 ]; then
-    echo $2 | awk '{ print $1 }' >> FailedList.txt
-fi
-
-sleep 20
-
 exit
 

Added: SwiftApps/DSSAT/benchmark-release/plots/extract4plots
===================================================================
--- SwiftApps/DSSAT/benchmark-release/plots/extract4plots	                        (rev 0)
+++ SwiftApps/DSSAT/benchmark-release/plots/extract4plots	2012-04-27 20:27:13 UTC (rev 5762)
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+#usage: ./extract4plots <swift.outfile>
+
+SWIFTOUTFILE=$1
+
+#extract start time
+TMPDATE=`grep -i progress $SWIFTOUTFILE | head -n 1 | cut -f4-9 -d ' '`
+START_TIME=`date +%s -d "$TMPDATE"`
+
+#extract end time
+TMPDATE=`grep -i progress $SWIFTOUTFILE | tail -n 1 | cut -f4-9 -d ' '`
+END_TIME=`date +%s -d "$TMPDATE"`
+
+#duration
+DIFFTIME=$((END_TIME - START_TIME))
+
+#extract active runs in a file
+grep -o -i "Active:[0-9]*" $SWIFTOUTFILE | awk -F: '{print $2}' > active.txt
+
+#extract successful completions in a file
+grep -o -i "Successfully:[0-9]*" $SWIFTOUTFILE | awk -F: '{print $2}' > cumulative.txt
+
+#prepare tics
+activelines=`wc -l active.txt | awk '{print $1}'`
+cumulines=`wc -l cumulative.txt | awk '{print $1}'`
+
+activelinespertic=`echo "scale=5 ; $DIFFTIME / $activelines" | bc`
+seq 0 $activelinespertic $DIFFTIME > activetics.txt
+
+cumulinespertic=`echo "scale=5 ; $DIFFTIME / $cumulines" | bc`
+seq 0 $cumulinespertic $DIFFTIME > cumultics.txt
+
+#final plot data
+paste activetics.txt active.txt > plot_active.txt
+paste cumultics.txt cumulative.txt > plot_cumulative.txt
+
+grep  "T =" $SWIFTOUTFILE | awk '{print $6}' | cut -c8- | sed 's/....$//' > T.data
+
+grep multi_annealing $SWIFTOUTFILE | grep "1;30" | awk '{print $3}' | cut -c11- | sed 's/....$//' > anneal.data
+
+grep returning $SWIFTOUTFILE | awk '{print $3, $4, $5, $6}' | sed -e 's/'ci='//' -e 's/'cj='//' -e 's/'r.loss='//' -e 's/'r.sdev='//' | sort -t' ' -k 1,2n > multiloss.txt


Property changes on: SwiftApps/DSSAT/benchmark-release/plots/extract4plots
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/DSSAT/benchmark-release/plots/plotit.gp
===================================================================
--- SwiftApps/DSSAT/benchmark-release/plots/plotit.gp	                        (rev 0)
+++ SwiftApps/DSSAT/benchmark-release/plots/plotit.gp	2012-04-27 20:27:13 UTC (rev 5762)
@@ -0,0 +1,48 @@
+#To be run as a gnuplot script as follows:
+
+# $ gnuplot plotit.gp
+
+set terminal png enhanced 
+#set term postscript eps enhanced 
+#set terminal svg enhanced size 1000 1000
+#set style line 1 linecolor rgb "blue"
+set output "activeplot.png"
+set nokey
+set xlabel "Time in sec"
+set ylabel "number of active jobs"
+set title "Active jobs"
+plot "plot_active.txt" using 1:2 with line
+
+#multiplies the active jobs by 24 to take into account the number of openmp
+#procs running on Beagle
+set output "cumulativeplot-openmp.png"
+set xlabel "Time in seconds"
+set ylabel "number of completed jobs"
+set title "Cumulative SciColSim-openMP jobs"
+plot "plot_cumulative.txt" using 1:($2*24) with lines
+
+set output "cumulativeplot.png"
+set xlabel "Time in seconds"
+set ylabel "number of completed jobs"
+set title "Cumulative jobs"
+plot "plot_cumulative.txt" using 1:2 with lines
+
+set output "scs.png"
+set xlabel "Evolution"
+set ylabel "Value of T"
+set title "SciColSim evolution Results"
+plot "T.data" using 1 with lines 
+
+set output "scs_loss.png"
+set title "SciColSim evolution loss Results"
+set xlabel "Evolution"
+set ylabel "Value of loss(AR)"
+plot "anneal.data" using 1 with lines 
+
+set output "multiloss.png"
+set title "SciColSim evolution loss Results"
+set key auto
+set yrange [0:200]
+set xlabel "Evolution"
+set ylabel "loss"
+plot "multiloss.txt" using 3 with lines title "multiloss mean val",  "multiloss.txt" using ($3+$4) with lines title "+stddev", "multiloss.txt" using ($3-$4) with lines title "-stddev"




More information about the Swift-commit mailing list