next up previous
Next: Data Environment Up: OpenMP Design Objective Previous: OpenMP Design Objective

Control Structures

OpenMP strives for a minimalist set of control structures. Experience has indicated that only a few control structures are truly necessary for writing most parallel applications. For example, in the Silicon Graphics DOACROSS model, the only control structure is the DOACROSS directive, yet this is arguably the most widely used shared memory programming model for scientific computing. Many of the control structures provided by X3H5 can be trivially programmed in OpenMP with no performance penalty. OpenMP includes control structures only in those instances where a compiler can provide both functionality and performance over what a user could reasonably program.

The examples above used only three control structures: PARALLEL, DO and SINGLE. Clearly the compiler adds functionality in PARALLEL and DO directives. For SINGLE, the compiler adds performance by allowing the first thread reaching the SINGLE directive to execute the the code. This is nontrivial for a user to program.



Leo Dagum
Wed Nov 5 17:43:05 PST 1997