next up previous contents
Next: Multiple Threads of Control Up: Grouping Operators Together Previous: Multiple Operators

Continuing Operators

  Sometimes it may be possible to isolate a set of operators which are used sequentially, but one or more other operators may be used unpredictably around the sequential operators. Thus, it is important that the language be able to express this notion to allow for efficient scheduling in this case. COP handles this by allowing the grouping constructs to nest arbitrarily.

As an example, consider stdio-style input, output, and error streams; the stdin stream would be broadcast from a master node to all the nodes, and stdout and stderr would fan in from all the nodes to the front end. Likewise, debugging streams might usefully be placed in the application, in parallel with the application's primary communications code. To accomplish this, the application places a parallel construct around the `continuing' operator (e.g., stdin) and a sequential group holding the operators that will be sequenced through while the continuing operator is active. Thus, to define a stdin stream that all the nodes can read while several different operations happened, you might do:


\begin{singlespace}
\begin{verbatim}
(parallel
 (broadcast 'stdin 0)
 (sequentia...
 ...cast 'b1 17)
 (broadcast 'b2 0)
 (reduce 'r 0)))\end{verbatim} \end{singlespace}

If the compiler breaks the sequential portion up into multiple phases, the stdin operator will be defined in all of them. Any data sent using that operator will remain valid in the network even during router phase changes.


next up previous contents
Next: Multiple Threads of Control Up: Grouping Operators Together Previous: Multiple Operators
Back to Chris Metcalf's home page