[Swift-commit] r6660 - in trunk/src/org/griphyn/vdl/karajan: . lib

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Thu Jul 18 14:48:48 CDT 2013


Author: hategan
Date: 2013-07-18 14:48:48 -0500 (Thu, 18 Jul 2013)
New Revision: 6660

Modified:
   trunk/src/org/griphyn/vdl/karajan/HangChecker.java
   trunk/src/org/griphyn/vdl/karajan/lib/CurrentThread.java
   trunk/src/org/griphyn/vdl/karajan/lib/Operators.java
   trunk/src/org/griphyn/vdl/karajan/lib/Parameterlog.java
   trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java
   trunk/src/org/griphyn/vdl/karajan/lib/Tracer.java
   trunk/src/org/griphyn/vdl/karajan/lib/UnitStart.java
Log:
use the new qualified thread name accessor method and route all requests for the thread name through SwiftFunction in case it will diverge from the native karajan scheme

Modified: trunk/src/org/griphyn/vdl/karajan/HangChecker.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/HangChecker.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/HangChecker.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -43,6 +43,7 @@
 import org.globus.cog.karajan.compiled.nodes.Node;
 import org.globus.cog.karajan.compiled.nodes.grid.SchedulerNode;
 import org.globus.cog.karajan.scheduler.WeightedHostScoreScheduler;
+import org.griphyn.vdl.karajan.lib.SwiftFunction;
 import org.griphyn.vdl.mapping.DSHandle;
 import org.griphyn.vdl.mapping.MappingParam;
 import org.griphyn.vdl.mapping.Path;
@@ -121,7 +122,7 @@
 
     public static void dumpThread(PrintStream pw, LWThread thr, DSHandle handle) {
         try {
-            pw.println("Thread: " + thr.getName() 
+            pw.println("Thread: " + SwiftFunction.getThreadPrefix(thr) 
                 + (handle == null ? "" : ", waiting on " + varWithLine(handle)));
 
             for (String t : getSwiftTrace(thr)) {

Modified: trunk/src/org/griphyn/vdl/karajan/lib/CurrentThread.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/CurrentThread.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/lib/CurrentThread.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -25,6 +25,6 @@
 
     @Override
     public void run(LWThread thr) {
-    	cr_vargs.append(thr.getStack(), thr.getName());
+    	cr_vargs.append(thr.getStack(), SwiftFunction.getThreadPrefix(thr));
     }
 }

Modified: trunk/src/org/griphyn/vdl/karajan/lib/Operators.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/Operators.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/lib/Operators.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -276,7 +276,7 @@
 
 	private static void logBinaryProvenance(String name, DSHandle v1, DSHandle v2, DSHandle result) throws ExecutionException {
 		if (PROVENANCE_ENABLED) {
-			String thread = LWThread.currentThread().getName();
+			String thread = SwiftFunction.getThreadPrefix();
 			String lhsid = v1.getIdentifier();
 			String rhsid = v2.getIdentifier();
 			String rid = result.getIdentifier();
@@ -287,7 +287,7 @@
 
 	private static void logUnaryProvenance(String name, DSHandle v, DSHandle r) throws ExecutionException {
 		if (PROVENANCE_ENABLED) {
-			String thread = LWThread.currentThread().getName();
+			String thread = SwiftFunction.getThreadPrefix();
 			String vid = v.getIdentifier();
 			String rid = r.getIdentifier();
 			provenanceLogger.info("UNARYOPERATOR thread=" + thread + " operator=" + name + 

Modified: trunk/src/org/griphyn/vdl/karajan/lib/Parameterlog.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/Parameterlog.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/lib/Parameterlog.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -71,7 +71,7 @@
         }
         if (run) {
             super.run(thr);
-            logger.info("PARAM thread=" + thr.getName() + " direction="
+            logger.info("PARAM thread=" + SwiftFunction.getThreadPrefix(thr) + " direction="
                     + direction.getValue(stack) + " variable=" + variable.getValue(stack)
                     + " provenanceid=" + id.getValue(stack));
         }

Modified: trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -123,9 +123,13 @@
 	 * depends on the fact that iteration variable is named '$' in this
 	 * particular implementation.
 	 */
-	public static String getThreadPrefix() throws ExecutionException {
-		return LWThread.currentThread().getName();
+	public static String getThreadPrefix() {
+		return getThreadPrefix(LWThread.currentThread());
 	}
+		
+	public static String getThreadPrefix(LWThread thr) {
+	    return thr.getQualifiedName();
+	}
 
 	// TODO - is this needed any more? its doing some type inferencing and
 	// object creation and dequoting of strings, but the necessary behaviour
@@ -141,7 +145,7 @@
 	// this is only used by VDL new (and really should only be used by
 	// VDL new, and should perhaps move to the VDL new source?)
 
-	protected Object internalValue(Type type, Object value) {
+    protected Object internalValue(Type type, Object value) {
 		if (Types.FLOAT.equals(type)) {
 			return new Double(TypeUtil.toDouble(value));
 		}

Modified: trunk/src/org/griphyn/vdl/karajan/lib/Tracer.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/Tracer.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/lib/Tracer.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -154,7 +154,7 @@
     }
     
     private String threadName(LWThread thr) throws VariableNotFoundException {
-        return thr.getName();
+        return SwiftFunction.getThreadPrefix(thr);
     }
     
     private static Tracer disabledTracer, enabledTracer;

Modified: trunk/src/org/griphyn/vdl/karajan/lib/UnitStart.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/UnitStart.java	2013-07-17 21:53:21 UTC (rev 6659)
+++ trunk/src/org/griphyn/vdl/karajan/lib/UnitStart.java	2013-07-18 19:48:48 UTC (rev 6660)
@@ -165,40 +165,41 @@
     protected static void log(boolean start, String type, LWThread thread,
             String name, String line) {
         if (logger.isInfoEnabled()) {
+            String threadName = SwiftFunction.getThreadPrefix(thread);
             if (type.equals("COMPOUND")) {
                 logger.info((start ? "START" : "END") + type + " thread="
-                        + thread.getName() + " name=" + name);
+                        + threadName + " name=" + name);
             }
             else {
                 if (logger.isDebugEnabled()) {
                     if (type.equals("PROCEDURE")) {
                         if (start) {
                             logger.debug("PROCEDURE line=" + line + " thread="
-                                    + thread.getName() + " name=" + name);
+                                    + threadName + " name=" + name);
                         }
                         else {
                             logger.debug("PROCEDURE_END line=" + line
                                     + " thread="
-                                    + thread.getName() + " name=" + name);
+                                    + threadName + " name=" + name);
                         }
                     }
                     else if (type.equals("FOREACH_IT")) {
                         logger.debug("FOREACH_IT_" + (start ? "START" : "END")
                                 + " line=" + line + " thread="
-                                + thread.getName());
+                                + threadName);
                         if (start) {
-                            logger.debug("SCOPE thread=" + thread.getName());
+                            logger.debug("SCOPE thread=" + threadName);
                         }
                     }
                     else if (type.equals("INTERNALPROC")) {
                         logger.debug("INTERNALPROC_"
                                 + (start ? "START" : "END")
-                                + " thread=" + thread.getName() + " name="
+                                + " thread=" + threadName + " name="
                                 + name);
                     }
                     else if (type.equals("CONDITION_BLOCK")) {
                         if (start) {
-                            logger.debug("SCOPE thread=" + thread.getName());
+                            logger.debug("SCOPE thread=" + threadName);
                         }
                     }
                 }




More information about the Swift-commit mailing list