IBM Streams 4.2

Example 8: Separate parallel channels

In this example of user-defined parallelism, the Src and Snk operators are inside the parallel region. There are no operators outside the parallel region.

The parallel transformation replicates the Src, A and Snk operators. Fusion places the siblings for each channel in a PE.
composite Comp8() {
  graph
    stream<Type> Src = Source() {}
    stream<Type> A   = Functor(Src) {}
    () as        Snk = Sink(A) {}
}

composite Main8 {
  graph
  @parallel(width=2)
    () as Out = Comp8() {
      config placement: partitionColocation(byChannel());
    }
}

The Logical and Physical stream graphs for Example 8.

Note that, depending on the fusion mode, explicit colocation only guarantees that operators which are specified to be colocated will be colocated, but not necessarily isolated from other operators. In this example, operators from different channels within the parallel region could be placed in the same PE.