Parallel region restrictions
While the
@parallel
annotation can be applied to most operators,
there are some limitations. The following conditions are not allowed in parallel regions,
and the compiler will generate an error if it encounters them.
- A punctuation-expecting input port cannot be downstream from a parallel region without having a
punctuation-generating operator between it and the parallel region. SPL does not permit fan-ins on
input ports that expect punctuations. A fan-in on an operator input port means that more
than one stream connects to it. Placing
@parallel
on an operator invocation implies that fan-ins are permitted on the input ports that are immediately outside the parallel region. If those input ports expect punctuations, they would violate the SPL ban on punctuation-expecting fan-ins. - A parallel region cannot contain only
Import
orExport
operator invocations. The following invocation of anImport
operator is not allowed:@parallel(width=5) stream<Type> Data = Import() { param applicationName: "sample::Main"; streamId: "myName" + (rstring)getChannel(); }
Import
andExport
operators can only be replicated when they are invoked inside of a replicated composite operator, and they are used only in that replicated composite operator. For anImport
, that means the operator which consumes its output stream must be inside of the replicated composite operator, and for anExport
that means its input stream must come from an operator inside of the replicated composite operator. Import
andExport
operators that are not in a parallel region cannot communicate directly with operators inside of a parallel region. ForImport
operators outside of a parallel region, this means that operators inside of a parallel region cannot directly consume their output stream. ForExport
operators outside of a parallel region, this means that they cannot directly consume streams coming from operators inside of a parallel region.