[Swift-devel] [Bug 191] New: procedures invoked inside iterate{} don't get unique execution IDs

bugzilla-daemon at mcs.anl.gov bugzilla-daemon at mcs.anl.gov
Wed Apr 1 07:32:24 CDT 2009


https://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=191

           Summary: procedures invoked inside iterate{} don't get unique
                    execution IDs
           Product: Swift
           Version: unspecified
          Platform: PC
        OS/Version: Mac OS
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Log processing and plotting
        AssignedTo: benc at hawaga.org.uk
        ReportedBy: benc at hawaga.org.uk
                CC: swift-devel at ci.uchicago.edu


iterate {} is more serialised than I intended. It executes each body inside the
same single thread. Consequently, each iteration of the loop body does not end
up with a unique thread prefix, and then execute IDs, which are based on thread
ID, end up duplicated between invocations.

I made the following hack for specific purpose of provenance challenge 3, as it
provides enough uniqueness, albeit inelegantly, for that project. More
properly,  fixed bug 154 (iterate construct causes overserialisation of
execution) could make this problem go away.

Author: Ben Clifford <benc at hawaga.org.uk>
Date:   Tue Mar 31 16:20:41 2009 +0100

    make iterate give each iteration a unique thread ID. this is possibly
unsafe. in addition, it does not give
 a uique ID to the termination condition distinct from the body of the loop,
which can probably give non-unique
 IDs when procedure calls are made both in the loop body and in the termination
condition

diff --git a/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
b/src/org/griphyn/vdl/karajan/lib/Infin
iteCountingWhile.java
index 0d173c3..c6d4e89 100644
--- a/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
+++ b/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
@@ -9,6 +9,7 @@ package org.griphyn.vdl.karajan.lib;
 import java.util.Arrays;
 import java.util.List;

+import org.globus.cog.karajan.util.ThreadingContext;
 import org.globus.cog.karajan.workflow.nodes.*;
 import org.globus.cog.karajan.stack.VariableStack;
 import org.globus.cog.karajan.util.TypeUtil;
@@ -26,6 +27,8 @@ public class InfiniteCountingWhile extends Sequential {

        public void pre(VariableStack stack) throws ExecutionException {
                stack.setVar("#condition", new Condition());
+               ThreadingContext tc =
(ThreadingContext)stack.getVar("#thread");
+               stack.setVar("#thread", tc.split(666));
                stack.setVar(VAR, "$");
                String counterName = (String)stack.getVar(VAR);
                stack.setVar(counterName, Arrays.asList(new Integer[] {new
Integer(0)}));
@@ -54,6 +57,8 @@ public class InfiniteCountingWhile extends Sequential {
                }
                if (index >= elementCount()) {
                        // starting new iteration
+               ThreadingContext tc =
(ThreadingContext)stack.getVar("#thread");
+               stack.setVar("#thread", tc.split(666));
                        setIndex(stack, 1);
                        fn = (FlowElement) getElement(0);

-- 
Configure bugmail: https://bugzilla.mcs.anl.gov/swift/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are watching the assignee of the bug.
You are watching the reporter.



More information about the Swift-devel mailing list