[Swift-commit] r5583 - SwiftApps/SciColSim

jonmon at ci.uchicago.edu jonmon at ci.uchicago.edu
Fri Feb 10 16:10:58 CST 2012


Author: jonmon
Date: 2012-02-10 16:10:57 -0600 (Fri, 10 Feb 2012)
New Revision: 5583

Modified:
   SwiftApps/SciColSim/swiftopt.sh
Log:
some error supressing and mac compatability fixes



Modified: SwiftApps/SciColSim/swiftopt.sh
===================================================================
--- SwiftApps/SciColSim/swiftopt.sh	2012-02-10 22:01:30 UTC (rev 5582)
+++ SwiftApps/SciColSim/swiftopt.sh	2012-02-10 22:10:57 UTC (rev 5583)
@@ -1,5 +1,7 @@
 #! /bin/sh
 
+#TODO: Fix espcape code nonense, seems to be passing in -n -e to swift
+
 # Usage: swiftopt.sh [-s sitename] [-p paramfile] [-n # for dryrun ]
 
 usage="$0 [-s sitename] [-p paramfile] [-n] # -n for dryrun: just print params and time estimates"
@@ -11,7 +13,16 @@
 ram=2000M
 dryrun=
 
+# check to see if the following check is even necessary on a linux distro
+system=`uname | grep Darwin`
 
+if [ $system == "Darwin" ];
+then
+    escapecode=$(echo '\033')
+else
+    escapecode=$(echo -n -e '\033')
+fi
+
 # Process command line arguments
 
 while [ $# -gt 0 ]; do
@@ -31,10 +42,17 @@
 else
   cat nextrun | awk '{ printf("%03d\n", $1+1)}' >newrun
 fi
-runid=$(cat newrun)
-mv newrun nextrun
+runid=$(cat newrun 2> /dev/null)
+mv newrun nextrun 2> /dev/null
 rundir=run${runid}
-mkdir $rundir
+#Exit if rundir already exits. Something is funky
+if [ -d $rundir ];
+then
+    echo "$rundir already exists! exiting." >&2
+    exit 2
+else
+    mkdir $rundir
+fi
 
 # Get optimization parameters
 
@@ -42,8 +60,8 @@
 sed -e '/^  */d' -e 's/#.*//' -e 's/  */=/' <params/$paramfile >$rundir/params.annealing
 source $rundir/params.annealing
 
-e33="-e33=$(echo -n -e '\033')"
-swift=../swift/bin/swift # relative to runNNN/ dirs
+#swift=../swift/bin/swift # relative to runNNN/ dirs
+swift=swift
 
 echo Optimization run $runid: site=$execsite paramfile=$paramfile
 
@@ -73,7 +91,8 @@
 
 cd $rundir
 
-SWIFT_HEAP_MAX=$ram SWIFT_LIB=.. $swift >> swift.out 2>&1 -tc.file tc -sites.file $execsite.xml -config cf ../annealing.swift $e33 \
+SWIFT_HEAP_MAX=$ram SWIFT_LIB=.. $swift >> swift.out 2>&1 -tc.file tc -sites.file $execsite.xml -config cf ../annealing.swift -e33="$escapecode" \
+#SWIFT_HEAP_MAX=$ram SWIFT_LIB=.. $swift 2>&1 -tc.file tc -sites.file $execsite.xml -config cf ../annealing.swift -e33="$escapecode" \
                                          \
 -minrange=$min_target_innovation         \
 -maxrange=$max_target_innovation         \
@@ -92,9 +111,9 @@
 -nworkers=$nworkers                      \
 -rerunsperapp=$reruns_per_opt_invocation
 
-exit 
+exit $?
 
- at arg("nworkers","4")
+ at Arg("nworkers","4")
 @arg("rerunsperapp", "100")
 @arg("seed", "0" )          FIXME
 @arg("minrange", "58")




More information about the Swift-commit mailing list