Class IterationHeadTask<X,​Y,​S extends Function,​OT>

  • Type Parameters:
    X - The type of the bulk partial solution / solution set and the final output.
    Y - The type of the feed-back data set (bulk partial solution / workset). For bulk iterations, Y is the same as X
    All Implemented Interfaces:
    Terminable, CheckpointableTask, CoordinatedTask, TaskInvokable, TaskContext<S,​OT>

    public class IterationHeadTask<X,​Y,​S extends Function,​OT>
    extends AbstractIterativeTask<S,​OT>
    The head is responsible for coordinating an iteration and can run a Driver inside. It will read the initial input and establish a BlockingBackChannel to the iteration's tail. After successfully processing the input, it will send EndOfSuperstep events to its outputs. It must also be connected to a synchronization task and after each superstep, it will wait until it receives an AllWorkersDoneEvent from the sync, which signals that all other heads have also finished their iteration. Starting with the second iteration, the input for the head is the output of the tail, transmitted through the backchannel. Once the iteration is done, the head will send a TerminationEvent to all it's connected tasks, signaling them to shutdown.

    Assumption on the ordering of the outputs: - The first n output gates write to channels that go to the tasks of the step function. - The next m output gates to the tasks that consume the final solution. - The last output gate connects to the synchronization task.

    • Constructor Detail

      • IterationHeadTask

        public IterationHeadTask​(Environment environment)
        Create an Invokable task and set its environment.
        Parameters:
        environment - The environment assigned to this invokable.