[Swift-commit] r7594 - in trunk: bin libexec src/org/griphyn/vdl/karajan

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Sun Feb 16 08:55:52 CST 2014


Author: davidk
Date: 2014-02-16 08:55:52 -0600 (Sun, 16 Feb 2014)
New Revision: 7594

Modified:
   trunk/bin/swift
   trunk/bin/swiftrun
   trunk/libexec/swift-int-staging.k
   trunk/libexec/swift-int.k
   trunk/src/org/griphyn/vdl/karajan/Loader.java
   trunk/src/org/griphyn/vdl/karajan/SwiftRootScope.java
Log:
debug dir prefix


Modified: trunk/bin/swift
===================================================================
--- trunk/bin/swift	2014-02-16 14:13:38 UTC (rev 7593)
+++ trunk/bin/swift	2014-02-16 14:55:52 UTC (rev 7594)
@@ -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: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun	2014-02-16 14:13:38 UTC (rev 7593)
+++ trunk/bin/swiftrun	2014-02-16 14:55:52 UTC (rev 7594)
@@ -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: trunk/libexec/swift-int-staging.k
===================================================================
--- trunk/libexec/swift-int-staging.k	2014-02-16 14:13:38 UTC (rev 7593)
+++ trunk/libexec/swift-int-staging.k	2014-02-16 14:55:52 UTC (rev 7594)
@@ -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: trunk/libexec/swift-int.k
===================================================================
--- trunk/libexec/swift-int.k	2014-02-16 14:13:38 UTC (rev 7593)
+++ trunk/libexec/swift-int.k	2014-02-16 14:55:52 UTC (rev 7594)
@@ -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")
 
 namespace(swift) {
 
@@ -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: trunk/src/org/griphyn/vdl/karajan/Loader.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/Loader.java	2014-02-16 14:13:38 UTC (rev 7593)
+++ trunk/src/org/griphyn/vdl/karajan/Loader.java	2014-02-16 14:55:52 UTC (rev 7594)
@@ -178,7 +178,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: trunk/src/org/griphyn/vdl/karajan/SwiftRootScope.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/SwiftRootScope.java	2014-02-16 14:13:38 UTC (rev 7593)
+++ trunk/src/org/griphyn/vdl/karajan/SwiftRootScope.java	2014-02-16 14:55:52 UTC (rev 7594)
@@ -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