[Swift-commit] r8019 - in trunk/src/org/griphyn/vdl: karajan/lib mapping mapping/nodes
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Sun Jul 13 02:37:20 CDT 2014
Author: hategan
Date: 2014-07-13 02:37:19 -0500 (Sun, 13 Jul 2014)
New Revision: 8019
Modified:
trunk/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
trunk/src/org/griphyn/vdl/mapping/OpenArrayEntries.java
trunk/src/org/griphyn/vdl/mapping/nodes/AbstractDataNode.java
trunk/src/org/griphyn/vdl/mapping/nodes/AbstractFutureArrayDataNode.java
trunk/src/org/griphyn/vdl/mapping/nodes/InitMapper.java
Log:
fixed future notification loops (see r4024 in cog)
Modified: trunk/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2014-07-13 07:35:49 UTC (rev 8018)
+++ trunk/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2014-07-13 07:37:19 UTC (rev 8019)
@@ -288,7 +288,7 @@
}
catch (ConditionalYield y) {
helper.resetItUpdated();
- y.getFuture().addListener(this);
+ y.getFuture().addListener(this, y);
throw new ConditionalYield(helper);
}
}
@@ -323,7 +323,7 @@
private boolean itUpdated;
@Override
- public synchronized void addListener(FutureListener l) {
+ public synchronized void addListener(FutureListener l, ConditionalYield y) {
if (itUpdated) {
l.futureUpdated(this);
}
Modified: trunk/src/org/griphyn/vdl/mapping/OpenArrayEntries.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/OpenArrayEntries.java 2014-07-13 07:35:49 UTC (rev 8018)
+++ trunk/src/org/griphyn/vdl/mapping/OpenArrayEntries.java 2014-07-13 07:37:19 UTC (rev 8019)
@@ -46,7 +46,7 @@
return false;
}
else {
- throw new ConditionalYield(source);
+ throw new ConditionalYield(source, keyList.size());
}
}
}
@@ -64,7 +64,7 @@
throw new NoSuchElementException();
}
else {
- throw new ConditionalYield(source);
+ throw new ConditionalYield(source, keyList.size());
}
}
}
Modified: trunk/src/org/griphyn/vdl/mapping/nodes/AbstractDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/nodes/AbstractDataNode.java 2014-07-13 07:35:49 UTC (rev 8018)
+++ trunk/src/org/griphyn/vdl/mapping/nodes/AbstractDataNode.java 2014-07-13 07:37:19 UTC (rev 8019)
@@ -25,6 +25,7 @@
import java.util.List;
import java.util.Map;
+import k.rt.ConditionalYield;
import k.rt.FutureListener;
import k.rt.FutureValue;
@@ -446,12 +447,8 @@
public void addListener(DSHandleListener listener) {
throw new UnsupportedOperationException();
}
-
- public void addListener(FutureListener l) {
- addListener(l, true);
- }
-
- public void addListener(FutureListener l, boolean partialUpdates) {
+
+ public void addListener(FutureListener l, ConditionalYield y) {
boolean closed;
WaitingThreadsMonitor.addThread(l, this);
synchronized(this) {
Modified: trunk/src/org/griphyn/vdl/mapping/nodes/AbstractFutureArrayDataNode.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/nodes/AbstractFutureArrayDataNode.java 2014-07-13 07:35:49 UTC (rev 8018)
+++ trunk/src/org/griphyn/vdl/mapping/nodes/AbstractFutureArrayDataNode.java 2014-07-13 07:37:19 UTC (rev 8019)
@@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;
+import k.rt.ConditionalYield;
import k.rt.FutureListener;
import org.globus.cog.karajan.futures.FutureNotYetAvailable;
@@ -77,12 +78,12 @@
}
@Override
- public void addListener(FutureListener l, boolean partialUpdates) {
+ public void addListener(FutureListener l, ConditionalYield y) {
boolean shouldNotify;
WaitingThreadsMonitor.addThread(l, this);
synchronized(this) {
shouldNotify = addListener0(l);
- if (keyList != null && partialUpdates) {
+ if (keyList != null && y.getSequence() != keyList.size()) {
shouldNotify = true;
}
}
Modified: trunk/src/org/griphyn/vdl/mapping/nodes/InitMapper.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/nodes/InitMapper.java 2014-07-13 07:35:49 UTC (rev 8018)
+++ trunk/src/org/griphyn/vdl/mapping/nodes/InitMapper.java 2014-07-13 07:37:19 UTC (rev 8019)
@@ -107,7 +107,7 @@
this.node = node;
waitingMapperParam = mapper.getFirstOpenParameter();
if (waitingMapperParam != null) {
- waitingMapperParam.addListener(this);
+ waitingMapperParam.addListener(this, null);
if (variableTracer.isEnabled()) {
variableTracer.trace(node.getThread(), node.getLine(), node.getName() + " WAIT "
+ Tracer.getVarName(waitingMapperParam));
More information about the Swift-commit
mailing list