Example 7: Replicated sources
In this example of user-defined parallelism, no operators from outside the parallel region are fused with the operators in the parallel region. The parallel region has no incoming streams.
The parallel transformation replicates operators Src and A. No splitters are necessary since there is no stream feeding the parallel region. Fusion places each sibling of operators Src and A from each channel in their own PEs. Fusion places the Snk operator in its own PE.
composite Comp7(output A) {
graph
stream<Type> Src = Source() {}
stream<Type> A = Functor(Src) {}
}
composite Main7 {
graph
@parallel(width=2)
stream<Type> Out = Comp7() {
config placement: partitionColocation(byChannel());
}
() as Snk = Sink(Out) {
config placement: partitionIsolation;
}
}

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.