The template considered in this chapter uses this communication structure in an SPMD fashion, with each task executing Algorithm 11.1 . A local state variable is first set to be the supplied input data.
Computation then proceeds in steps.
In each step, each task first exchanges its local state with one of its neighbors in the hypercube and then combines the message received from the neighbor with state to generate a new state . A particular parallel algorithm is defined by the operator OP used to combine state and message at each step in the template.