IBM InfoSphere Streams Version 4.1.1

Parallel transformation rules

The application of user-defined parallelism to a streams processing application is governed by a set of constraints. The compiler checks these constraints to ensure that the subsequent transformation produces valid stream graphs.
  1. A punctuation-expecting 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 punctuation. A port that has fan-in has more than one stream connect to it. Placing a parallel annotation on an operator invocation implies that fan-ins are permitted on the input ports that are outside the parallel region. If those input ports expect punctuation, they would violate the SPL ban on fan-ins.
  2. A parallel region cannot contain only Import or Export operator invocations. The following invocation of an Import operator is not valid:
    @parallel(width=5)
    stream<Type> Data = Import() {
      param applicationName: "sample::Main";
        streamId: "myName" + (rstring)getChannel();
    }
  3. Import and Export operators that are not in a parallel region cannot live on replicated PEs. Hence, parallel regions cannot directly feed or consume Import or Export operators that are outside of the parallel region if the feeding or consuming operators are in replicated PEs. In the following example, the Import operator is directly feeding an operator in a parallel region. Therefore, it would cross the boundary into the parallel region. If the Data operator is placed in a replicated PE, then the Import invocation crosses the boundary into the parallel region. That situation violates the intended semantics of the application, and causes a compile-time error.
    stream<Type> FromOutside = Import() {
      param applicationName: "sample::Main";
        streamID: "feed";
    }
    @parallel(width=4)
    stream<Type> Data = Op(FromOutside) {}
    To replicate an Import operator, the invocation of the Import operator must be wrapped inside a composite operator, and the parallel annotation must be applied to the invocation of the composite operator. The same restrictions apply to invocations of the Export operator. If the Data operator in the following example is in a replicated PE, then a compile-time error occurs.
    @parallel(width=4)
    stream<Type> Data = Op(In) { }
    () as Exp = Export(Data} {
      param streamId: "toPublish";
    }