[Swift-commit] r2892 - in trunk: libexec resources src/org/griphyn/vdl/karajan/lib tests/language-behaviour

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Apr 29 04:58:49 CDT 2009


Author: benc
Date: 2009-04-29 04:58:49 -0500 (Wed, 29 Apr 2009)
New Revision: 2892

Added:
   trunk/src/org/griphyn/vdl/karajan/lib/SequentialWithID.java
   trunk/tests/language-behaviour/00241-nested-single-compound.out.expected
   trunk/tests/language-behaviour/00241-nested-single-compound.swift
Modified:
   trunk/libexec/vdl-lib.xml
   trunk/resources/Karajan.stg
   trunk/tests/language-behaviour/run
Log:
Make nested compound procedures and application procedures nested inside
compound procedures get a unique thread ID.

Test that this is the case.

Modified: trunk/libexec/vdl-lib.xml
===================================================================
--- trunk/libexec/vdl-lib.xml	2009-04-29 09:55:04 UTC (rev 2891)
+++ trunk/libexec/vdl-lib.xml	2009-04-29 09:58:49 UTC (rev 2892)
@@ -29,6 +29,7 @@
   <namespace prefix="vdl">
 	<export name="vdl:getdatasetprovenanceid"><elementDef classname="org.griphyn.vdl.karajan.lib.GetDatasetProvenanceID"/></export>
 	<export name="infinitecountingwhile"><elementDef classname="org.griphyn.vdl.karajan.lib.InfiniteCountingWhile"/></export>
+	<export name="sequentialwithid"><elementDef classname="org.griphyn.vdl.karajan.lib.SequentialWithID"/></export>
 	<export name="startprogressticker"><elementDef classname="org.griphyn.vdl.karajan.lib.RuntimeStats"/></export>
 	<export name="stopprogressticker"><elementDef classname="org.griphyn.vdl.karajan.lib.RuntimeStats"/></export>
 	<export name="initprogressstate"><elementDef classname="org.griphyn.vdl.karajan.lib.RuntimeStats"/></export>

Modified: trunk/resources/Karajan.stg
===================================================================
--- trunk/resources/Karajan.stg	2009-04-29 09:55:04 UTC (rev 2891)
+++ trunk/resources/Karajan.stg	2009-04-29 09:58:49 UTC (rev 2892)
@@ -166,7 +166,9 @@
   $statements;separator="\n"$
 </parallel>
 $else$
-$statements$
+<sequentialWithID>
+  $statements$
+</sequentialWithID>
 $endif$
 >>
 

Added: trunk/src/org/griphyn/vdl/karajan/lib/SequentialWithID.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SequentialWithID.java	                        (rev 0)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SequentialWithID.java	2009-04-29 09:58:49 UTC (rev 2892)
@@ -0,0 +1,22 @@
+package org.griphyn.vdl.karajan.lib;
+
+import org.globus.cog.karajan.workflow.nodes.Sequential;
+import org.globus.cog.karajan.stack.VariableStack;
+import org.globus.cog.karajan.util.ThreadingContext;
+import org.globus.cog.karajan.workflow.ExecutionException;
+
+
+/** launch a single child, giving it a new thread ID, but without starting
+    an entire karajan thread
+*/
+
+public class SequentialWithID extends Sequential {
+
+    protected void executeChildren(VariableStack stack) throws ExecutionException {
+        ThreadingContext tc = (ThreadingContext)stack.getVar("#thread");
+        stack.setVar("#thread", tc.split(1));
+        super.executeChildren(stack);
+    }
+
+}
+

Added: trunk/tests/language-behaviour/00241-nested-single-compound.out.expected
===================================================================
--- trunk/tests/language-behaviour/00241-nested-single-compound.out.expected	                        (rev 0)
+++ trunk/tests/language-behaviour/00241-nested-single-compound.out.expected	2009-04-29 09:58:49 UTC (rev 2892)
@@ -0,0 +1 @@
+f

Added: trunk/tests/language-behaviour/00241-nested-single-compound.swift
===================================================================
--- trunk/tests/language-behaviour/00241-nested-single-compound.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/00241-nested-single-compound.swift	2009-04-29 09:58:49 UTC (rev 2892)
@@ -0,0 +1,21 @@
+type file;
+
+(file t) greeting(string m) { 
+    app {
+        echo m stdout=@filename(t);
+    }
+}
+
+(file first) compound() {
+  first = greeting("f");
+}
+
+(file first) compoundB() {
+  first = compound();
+}
+
+file a <"00241-nested-single-compound.out">;
+
+a = compoundB();
+
+

Modified: trunk/tests/language-behaviour/run
===================================================================
--- trunk/tests/language-behaviour/run	2009-04-29 09:55:04 UTC (rev 2891)
+++ trunk/tests/language-behaviour/run	2009-04-29 09:58:49 UTC (rev 2892)
@@ -88,14 +88,13 @@
     fi
 
     # check that all execute and execute2 IDs are unique
-    swift-plot-log ${t}-*.log execute.transitions
-    if [ "$( cat execute.transitions | grep ' START ' | cut -d ' ' -f 2 | sort | uniq -d)" != "" ]; then
-      echo EXECUTE IDS NOT UNIQUE
+    swift-plot-log ${t}-*.log execute.transitions compound.transitions
+    if [ "$( cat compound.transitions execute.transitions | grep ' START ' | cut -d ' ' -f 2 | sort | uniq -d)" != "" ]; then
+      echo EXECUTE AND COMPOUND IDS NOT UNIQUE
       exit 3
     fi
 
 
-
   done
   echo "Test passed at $(date)"
   if [ "$SUB" == "" ]; then




More information about the Swift-commit mailing list