edu.bonn.cs.net.jbarrier.barrier
Class DoubleTournamentReduction
java.lang.Object
edu.bonn.cs.net.jbarrier.barrier.AbstractBarrier
edu.bonn.cs.net.jbarrier.barrier.TournamentBarrier
edu.bonn.cs.net.jbarrier.barrier.DoubleTournamentReduction
- All Implemented Interfaces:
- Barrier, DoubleReduction
public class DoubleTournamentReduction
- extends TournamentBarrier
- implements DoubleReduction
Implementation of a tournament barrier algorithm including a double reduction.
- Version:
- 1.0
- Author:
- Patrick Peschlow, Ivan Castilla Rodriguez
Method Summary |
double |
await(int threadId,
double value)
Called by a party that reaches the barrier. |
protected void |
setUpParties()
Sets up the parties array required for this reduction subclass. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleTournamentReduction
public DoubleTournamentReduction(int numParties,
java.lang.Runnable barrierAction,
ReductionOperator reductor)
- Constructor.
- Parameters:
numParties
- the number of parties that must reach the barrier before the
barrier is trippedbarrierAction
- the command to execute when the barrier is tripped, or
null
if there is no actionreductor
- the reduction operator to use
DoubleTournamentReduction
public DoubleTournamentReduction(int numParties,
ReductionOperator reductor)
- Constructor.
- Parameters:
numParties
- the number of parties that must reach the barrier before the
barrier is trippedreductor
- the reduction operator to use
setUpParties
protected void setUpParties()
- Sets up the parties array required for this reduction subclass.
- Overrides:
setUpParties
in class TournamentBarrier
await
public double await(int threadId,
double value)
- Called by a party that reaches the barrier.
- Specified by:
await
in interface DoubleReduction
- Parameters:
threadId
- the ID of the partyvalue
- the value subject to the reduction
- Returns:
- the result of the reduction
Copyright 2010 Patrick Peschlow