next up previous contents index
Next: Wrap and Reflect Up: Shattered Control Flow Previous: Shattered Control Flow

Masks vs. Shattered Control Flow.

Masked regions have none of the restrictions of shattered control flow, and any statement that uses shattered control flow can be rewritten using masked regions. Masked regions, however, can be very inefficient since the implementation must iterate over all indices of the region for every statement. The following example shows how masked regions could be used to perform selective I/O of a parallel variable.

    region R = [1..10, 1..10];
    var Select : [R] integer;

                open (``output.fil'', ``w'' );
            [R] setValues (Select);   -- select values to output
            [R] if (Select)           -- illegal
                    writeln (A);
[R with Select] writeln (A);          -- legal



Kay Nettle
Fri Feb 21 21:14:29 CST 1997