[Swift-commit] r7593 - in branches/release-0.95: bin libexec src/org/griphyn/vdl/karajan

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Sun Feb 16 08:13:39 CST 2014


Author: davidk
Date: 2014-02-16 08:13:38 -0600 (Sun, 16 Feb 2014)
New Revision: 7593

Modified:
   branches/release-0.95/bin/swift
   branches/release-0.95/bin/swiftrun
   branches/release-0.95/libexec/swift-int-staging.k
   branches/release-0.95/libexec/swift-int.k
   branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java
   branches/release-0.95/src/org/griphyn/vdl/karajan/SwiftRootScope.java
Log:
Allow a debug directory prefix, so debug directory can go directly inside of run directory without having to move things over at the end of a run


Modified: branches/release-0.95/bin/swift
===================================================================
--- branches/release-0.95/bin/swift	2014-02-15 23:57:10 UTC (rev 7592)
+++ branches/release-0.95/bin/swift	2014-02-16 14:13:38 UTC (rev 7593)
@@ -168,6 +168,9 @@
       elif [[ "$cmd" == *-swiftoutlog=* ]]; then
          SWIFTOUTLOG=$( echo $cmd | cut -d'=' -f2 )
          CMDLINE=$( echo $CMDLINE | sed s@$cmd@@g ) 
+      elif [[ "$cmd" == *-Ddebug.dir.prefix=* ]]; then
+         OPTIONS="$OPTIONS $cmd"
+         CMDLINE=$( echo $CMDLINE | sed s@$cmd@@g )
       fi
    done
 fi
@@ -194,8 +197,8 @@
 	$BASH -c "echo $KEY $USERID $SCRIPTID $SCRIPTLENGTH $return_code 1 > /dev/udp/$LISTENER/$PORT" > /dev/null 2>&1 &
 fi
 
-mv *.d/ $( ls -1rtd run*/ 2>/dev/null |tail -1 ) > /dev/null 2>&1
 rm *.swiftx *.kml > /dev/null 2>&1
+
 exit $return_code
 
 # Local Variables:

Modified: branches/release-0.95/bin/swiftrun
===================================================================
--- branches/release-0.95/bin/swiftrun	2014-02-15 23:57:10 UTC (rev 7592)
+++ branches/release-0.95/bin/swiftrun	2014-02-16 14:13:38 UTC (rev 7593)
@@ -466,6 +466,7 @@
 push(@new_swift_args, "-Drestart.log.name=$run_directory/restart.log");
 push(@new_swift_args, "-swiftoutlog=$run_directory/swift.out");
 push(@new_swift_args, "-runid " . basename($run_directory));
+push(@new_swift_args, "-Ddebug.dir.prefix=" . basename($run_directory));  
 push( @new_swift_args, sprintf( "-logfile $run_directory/run%03s.log", $run_number ));
 
 # Write swift configuration files

Modified: branches/release-0.95/libexec/swift-int-staging.k
===================================================================
--- branches/release-0.95/libexec/swift-int-staging.k	2014-02-15 23:57:10 UTC (rev 7592)
+++ branches/release-0.95/libexec/swift-int-staging.k	2014-02-16 14:13:38 UTC (rev 7593)
@@ -8,6 +8,7 @@
 SWIFT:SCRIPT_NAME := contextAttribute("SWIFT:SCRIPT_NAME")
 SWIFT:RUN_ID := contextAttribute("SWIFT:RUN_ID")
 SWIFT:HOME := contextAttribute("SWIFT:HOME")
+SWIFT:DEBUG_DIR_PREFIX := contextAttribute("SWIFT:DEBUG_DIR_PREFIX")
 
 WRAPPER_TRANSFER_MODE :=
 	if (configProperty("wrapperlog.always.transfer") == "true", 
@@ -22,7 +23,7 @@
 namespace(swift) {
 
 	initDDir := function() {
-		"{SWIFT:SCRIPT_NAME}-{SWIFT:RUN_ID}.d"
+		"{SWIFT:DEBUG_DIR_PREFIX}{SWIFT:SCRIPT_NAME}-{SWIFT:RUN_ID}.d"
 	}
 	
 	inFiles := function(stageins) {

Modified: branches/release-0.95/libexec/swift-int.k
===================================================================
--- branches/release-0.95/libexec/swift-int.k	2014-02-15 23:57:10 UTC (rev 7592)
+++ branches/release-0.95/libexec/swift-int.k	2014-02-16 14:13:38 UTC (rev 7593)
@@ -6,6 +6,7 @@
  */
  
 SWIFT:SCRIPT_NAME := contextAttribute("SWIFT:SCRIPT_NAME")
+SWIFT:DEBUG_DIR_PREFIX := contextAttribute("SWIFT:DEBUG_DIR_PREFIX")
 SWIFT:RUN_ID := contextAttribute("SWIFT:RUN_ID")
 SWIFT:HOME := contextAttribute("SWIFT:HOME")
 
@@ -100,7 +101,7 @@
 	}
 
 	initDDir := function() {
-		ddir := "{SWIFT:SCRIPT_NAME}-{SWIFT:RUN_ID}.d"
+		ddir := "{SWIFT:DEBUG_DIR_PREFIX}{SWIFT:SCRIPT_NAME}-{SWIFT:RUN_ID}.d"
 		
 		once(ddir) {
 			if(!file:exists(ddir)) {
@@ -326,7 +327,7 @@
 		recfile := "{jobid}-info"
 		srcdir := dircat("{wfdir}/info/", jobdir)
 		try {
-			task:transfer(recfile, srchost=rhost, srcdir=srcdir, destdir="{SWIFT:SCRIPT_NAME}-{SWIFT:RUN_ID}.d/")
+			task:transfer(recfile, srchost=rhost, srcdir=srcdir, destdir="{SWIFT:DEBUG_DIR_PREFIX}{SWIFT:SCRIPT_NAME}-{SWIFT:RUN_ID}.d/")
 		}
 		else catch (exception) {
 			maybe(file:remove(recfile))

Modified: branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java
===================================================================
--- branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java	2014-02-15 23:57:10 UTC (rev 7592)
+++ branches/release-0.95/src/org/griphyn/vdl/karajan/Loader.java	2014-02-16 14:13:38 UTC (rev 7593)
@@ -148,7 +148,18 @@
             context.setAttribute("SWIFT:RUN_ID", runID);
             context.setAttribute("SWIFT:DRY_RUN", ap.isPresent(ARG_DRYRUN));
             context.setAttribute("SWIFT:HOME", System.getProperty("swift.home"));
-            
+
+            String debugDirPrefix = System.getProperty("debug.dir.prefix");
+            if (debugDirPrefix == null) {
+               debugDirPrefix = "";
+            } 
+
+            else if (debugDirPrefix.charAt(debugDirPrefix.length() - 1) != File.separatorChar) {
+	       debugDirPrefix += File.separatorChar;
+	    }
+
+	    context.setAttribute("SWIFT:DEBUG_DIR_PREFIX", debugDirPrefix);
+
             Main root = compileKarajan(tree, context);
             root.setFileName(projectName);
 

Modified: branches/release-0.95/src/org/griphyn/vdl/karajan/SwiftRootScope.java
===================================================================
--- branches/release-0.95/src/org/griphyn/vdl/karajan/SwiftRootScope.java	2014-02-15 23:57:10 UTC (rev 7592)
+++ branches/release-0.95/src/org/griphyn/vdl/karajan/SwiftRootScope.java	2014-02-16 14:13:38 UTC (rev 7593)
@@ -31,5 +31,6 @@
         addVar("SWIFT:RUN_ID", context.getAttribute("SWIFT:RUN_ID"));
         addVar("SWIFT:SCRIPT_NAME", context.getAttribute("SWIFT:SCRIPT_NAME"));
         addVar("SWIFT:PARSED_ARGS", FnArg.parseArgs(context.getArguments()));
+        addVar("SWIFT:DEBUG_DIR_PREFIX", context.getAttribute("SWIFT:DEBUG_DIR_PREFIX"));
     }
 }




More information about the Swift-commit mailing list