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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Sat Jun 7 08:00:09 CDT 2008


Author: benc
Date: 2008-06-07 08:00:09 -0500 (Sat, 07 Jun 2008)
New Revision: 2052

Added:
   trunk/tests/language-behaviour/086-iterate-concurrent.swift
Modified:
   trunk/resources/Karajan.stg
   trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
Log:
fix bug 142 - concurrent mapper should now work inside iterate{}. tests added for that, and also to check that concurrent mapper + restarts + iterate{} works.

Modified: trunk/resources/Karajan.stg
===================================================================
--- trunk/resources/Karajan.stg	2008-06-06 22:40:15 UTC (rev 2051)
+++ trunk/resources/Karajan.stg	2008-06-07 13:00:09 UTC (rev 2052)
@@ -160,8 +160,11 @@
 iterate(declarations,statements,cond,var) ::= <<
 
 <vdl:infinitecountingwhile>
+  <set names="\$\$">
+    <each items="{\$}"/>
+  </set>
   <set name="$var$">
-    <vdl:new type="int" value="{\$}" />
+    <vdl:new type="int" value="{\$\$}" />
   </set>
   $sub_comp(declarations=declarations, statements=statements)$
   <sys:if>

Modified: trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java	2008-06-06 22:40:15 UTC (rev 2051)
+++ trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java	2008-06-07 13:00:09 UTC (rev 2052)
@@ -6,6 +6,9 @@
 
 package org.griphyn.vdl.karajan.lib;
 
+import java.util.Arrays;
+import java.util.List;
+
 import org.globus.cog.karajan.arguments.Arg;
 import org.globus.cog.karajan.workflow.nodes.*;
 import org.globus.cog.karajan.stack.VariableStack;
@@ -26,7 +29,7 @@
 		stack.setVar("#condition", new Condition());
 		stack.setVar(VAR, "$");
 		String counterName = (String)stack.getVar(VAR);
-		stack.setVar(counterName, new Integer(0)); // should be DSHandle-wrapped
+		stack.setVar(counterName, Arrays.asList(new Integer[] {new Integer(0)}));
 		super.pre(stack);
 	}
 
@@ -56,9 +59,11 @@
 			fn = (FlowElement) getElement(0);
 
 			String counterName = (String) stack.getVar(VAR);
-			int i = ((Integer)stack.getVar(counterName)).intValue();
+			List l = (List)stack.getVar(counterName);
+			Integer wrappedi = (Integer)l.get(0);
+			int i = wrappedi.intValue();
 			i++;
-			stack.setVar(counterName, new Integer(i)); // should be DSHandle-wrapped
+			stack.setVar(counterName, Arrays.asList(new Integer[] {new Integer(i)}));
 		}
 		else {
 			fn = (FlowElement) getElement(index++);

Added: trunk/tests/language-behaviour/086-iterate-concurrent.swift
===================================================================
--- trunk/tests/language-behaviour/086-iterate-concurrent.swift	                        (rev 0)
+++ trunk/tests/language-behaviour/086-iterate-concurrent.swift	2008-06-07 13:00:09 UTC (rev 2052)
@@ -0,0 +1,14 @@
+type messagefile;
+
+(messagefile t) greeting() { 
+    app {
+        echo "hello" stdout=@filename(t);
+    }
+}
+
+iterate i {
+  messagefile outfile;
+  outfile = greeting();
+} until(i>10);
+
+




More information about the Swift-commit mailing list