public int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { // Check that all input depths are the same int depth = getChildAt(0).getIterationDepth(inputDepths); for (IterationStrategyNode childNode : getChildren()) { if (childNode.getIterationDepth(inputDepths) != depth) { throw new IterationTypeMismatchException( "Mismatched input types for dot product node"); } } return depth; }
public int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { if (isLeaf()) { // No children! throw new IterationTypeMismatchException("Cross product with no children"); } int temp = 0; for (IterationStrategyNode child : getChildren()) { temp += child.getIterationDepth(inputDepths); } return temp; }
public synchronized int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { int temp = 0; for (IterationStrategyNode child : getChildren()) { temp += child.getIterationDepth(inputDepths); } return temp; }
private IterationStrategyImpl getISDot(int depthA, int depthB) { IterationStrategyImpl is1 = new IterationStrategyImpl(); NamedInputPortNode nipn1 = new NamedInputPortNode("a", depthA); NamedInputPortNode nipn2 = new NamedInputPortNode("b", depthB); is1.addInput(nipn1); is1.addInput(nipn2); DotProduct dp = new DotProduct(); nipn1.setParent(dp); nipn2.setParent(dp); dp.setParent(is1.getTerminal()); return is1; }
@Before public void makeNodes() throws Exception { root = new DummyTerminalNode(); input1 = new NamedInputPortNode("input1", 1); input2 = new NamedInputPortNode("input2", 2); crossProduct1 = new CrossProduct(); crossProduct2 = new CrossProduct(); dotProduct1 = new DotProduct(); dotProduct2 = new DotProduct(); }
public int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { // Check that all input depths are the same int depth = getChildren().get(0).getIterationDepth(inputDepths); for (IterationStrategyNode childNode : getChildren()) { if (childNode.getIterationDepth(inputDepths) != depth) { throw new IterationTypeMismatchException( "Mismatched input types for dot product node"); } } return depth; }
/** * Push the specified completion event to the parent node */ protected final void pushCompletion(Completion completion) { if (parent != null) { parent.receiveCompletion(parent.getIndex(this), completion); } }
protected CompletionState getCompletionState(String owningProcess) { if (ownerToCompletion.containsKey(owningProcess)) { return ownerToCompletion.get(owningProcess); } else { CompletionState cs = new CompletionState(getChildCount()); ownerToCompletion.put(owningProcess, cs); return cs; } }
/** * Implements IterationStrategyNode */ protected final synchronized void addChild( AbstractIterationStrategyNode newChild) { newChild.setParent(this); }
/** * If this node receives a job it will always be pushed without modification * up to the parent */ public void receiveJob(int inputIndex, Job newJob) { pushJob(newJob); }
/** * Completion events are passed straight through the same as jobs */ public void receiveCompletion(int inputIndex, Completion completion) { pushCompletion(completion); }
public void removeFromParent() { if (parent != null) { IterationStrategyNode oldParent = parent; parent = null; oldParent.remove(this); } }
@Before public void makeNodes() throws Exception { root = new DummyTerminalNode(); input1 = new NamedInputPortNode("input1", 1); input2 = new NamedInputPortNode("input2", 2); crossProduct1 = new CrossProduct(); crossProduct2 = new CrossProduct(); dotProduct1 = new DotProduct(); dotProduct2 = new DotProduct(); }
public synchronized int getIterationDepth(Map<String, Integer> inputDepths) throws IterationTypeMismatchException { int temp = 0; for (IterationStrategyNode child : getChildren()) { temp += child.getIterationDepth(inputDepths); } return temp; }
/** * Push the specified completion event to the parent node */ protected final void pushCompletion(Completion completion) { if (parent != null) { parent.receiveCompletion(parent.getIndex(this), completion); } }
private CompletionState getCompletionState(String owningProcess) { synchronized (ownerToCompletion) { if (ownerToCompletion.containsKey(owningProcess)) { return ownerToCompletion.get(owningProcess); } else { CompletionState cs = new CompletionState(getChildCount()); ownerToCompletion.put(owningProcess, cs); return cs; } } }
/** * If this node receives a job it will always be pushed without modification * up to the parent */ public void receiveJob(int inputIndex, Job newJob) { pushJob(newJob); }
/** * Completion events are passed straight through the same as jobs */ public void receiveCompletion(int inputIndex, Completion completion) { pushCompletion(completion); }
public void removeFromParent() { if (parent != null) { IterationStrategyNode oldParent = parent; parent = null; oldParent.remove(this); } }
/** * If this node receives a job it will always be pushed without modification * up to the parent */ public void receiveJob(int inputIndex, Job newJob) { pushJob(newJob); }