!standard 4.5.10(3/5) 20-08-28 AI12-0355-2/01 !standard 4.5.10(21/5) !standard 5.5(3/5) !standard 5.5(9/5) !standard 5.5.3(25/5) !standard 13.1.1(37/3) !priority Medium !difficulty Medium !subject Aspect specifications for parallel constructs !summary All constructs that include the word "parallel" now permit an aspect_specification as part of their syntax. !problem We need a mechanism to pass information through to a lightweight parallelism scheduler. Something like an aspect specification might be a good way to specify such options. !proposal We propose to add an aspect_specification to every place the PARALLEL keyword is envisioned currently PARALLEL [(chunk_specification)] [aspect_specification] FOR ... This allows specifying options to control the scheduling of parallel constructs. !wording Replace 4.5.10 (3/5) with: value_sequence ::= '[' [parallel[(chunk_specification)] [aspect_specification]] iterated_element_association ']' Modify 4.5.10 (21/5): For the evaluation of a value_sequence, the iterated_element_association{, the chunk_specification, and the aspect_specification, if any, are elaborated in an arbitrary order} [is elaborated], then an iteration is performed, and for each value conditionally produced by the iteration (see 5.5 and 5.5.2), the associated expression is evaluated with the loop parameter having this value, to produce a result that is converted to Value_Type, and used to define the next value in the sequence. Replace 5.5 (3/5) with: iteration_scheme ::= while condition | for loop_parameter_specification | for iterator_specification | [parallel [aspect_specification]] for procedural_iterator | parallel [(chunk_specification)] [aspect_specification] for loop_parameter_specification | parallel [(chunk_specification)] [aspect_specification] for iterator_specification Modify 5.5 (9/5): For the execution of a loop_statement that has an iteration_scheme including a loop_parameter_specification, after elaborating the chunk_specification {and aspect_specification}, if any, the loop_parameter_specification is elaborated. ... Add to the end of 5.5.3 (25/5): ... The aspect_specification, if any, is elaborated prior to the invocation of the iterating procedure. Modify 13.1.1 (37/3): At the freezing point of the associated entity, the aspect_specification is elaborated. {When appearing in a construct other than a declaration, an aspect_specification is elaborated as part of the execution of the construct.} The elaboration of the aspect_specification {consists of the elaboration of each aspect_definiion in an arbitrary order. The elaboration of an aspect_definition} includes the evaluation of [the]{any} name or expression[, if any,]{that is part of the aspect_definition} unless the [aspect itself is]{part is itself} an expression. If the corresponding aspect{ (or part thereof)} represents an expression (as in a precondition), the elaboration {of that part} has no effect; the expression is evaluated later at points within the execution as specified elsewhere in this International Standard for the particular aspect. !examples An implementation could support an aspect specification associated with a parallel loop such as: parallel with Collapse => 2, Grainsize => 100_000 for I in 1 .. 10_000_000 loop ... end loop; !discussion To allow passing tuning parameters through an implementation-defined API to an underlying lightweight thread scheduler to control lightweight parallelism, it is useful to permit aspect specifications on all parallel constructs. !ASIS [Not sure. It seems like some new capabilities might be needed, but I didn't check - Editor.] !ACATS test ACATS B- and C-Tests are needed to check that the new capabilities are supported. !appendix ****************************************************************