To: J3 Members J3/17-114 From: Van Snyder Subject: Constraints on collective subroutine reference References: 17-007 Date: 2017 February 01 1. Introduction =============== 16.6p2 and C1602 say that a reference to a collective subroutine is prohibited whenever and wherever an image control statement is prohibited. If one is writing a CRITICAL construct, a DO CONCURRENT construct, or a pure procedure, one is probably not going to look for a relevant prohibition or constraint in subclause 16.6. Even if one who is preparing, for example, a DO CONCURRENT construct or a pure procedure, looks in 16.6 and finds "for example ... from a CRITICAL construct," that might not be enough of a clue that it's not allowed in a DO CONCURRENT construct or a pure procedure. We don't have a constraint in subclause 11.6.1 that says an image control statement is not permitted in a CRITICAL construct, a DO CONCURRENT construct, or a pure procedure. We don't have a prohibition in subclause 11.6.1 that says an image control statement is not permitted to be executed by a procedure invoked while a CRITICAL construct is being executed. Instead, we have constraints and prohibitions in each of those places that forbit an image control statement. In those subclauses, we don't expect one to look in 11.6.1 to check whether image control statements are prohibited. Instead, the prohibitions appear in those subclauses. Those subclauses should similarly prohibit references to intrinsic collective subroutines, instead of expecting one somehow to find the prohibition in 16.6p2 and C1602. 1. Edits ======== [189:12-13 C1119] After 'RETURN statement' insert '(15.6.2.7)'. Replace 'or' with a comma. After 'image control statement' insert ', or a reference to an intrinsic collective subroutine (16.6)'. [189:17 11.1.6p2] After 'image control statement' append '(11.6.1) or invoke an intrinsic collective subroutine (16.6)'. [194:13-14 C1136-C1137] Replace the constraints with one constraint: 'C1136 A DO CONCURRENT construct shall not contain a RETURN statement (15.6.2.7), an image control statement (11.6.1), or a reference to an intrinsic collective subroutine (16.6)'. {This makes it the similar to C1119, mutatis mutandis.} [337:26 C1598] After '(11.6.1)' insert 'or a reference to an intrinsic collective subroutine (16.6)'. [345:21-22 C1602] Delete the constraint. {Note to editor: References to relevant subclause numbers were inserted here because one appeared in C1598. They could be removed, at the editor's discretion, if hyperlinks and the index are considered to be sufficient.} 2. Alternative Edits ==================== If MOVE_ALLOC is referenced with coarray arguments, it is considered to be an image control statement. The description of the action of a collective subroutine sounds like the description of an image control statement, at least if RESULT_IMAGE is not present or it is present and its value is the same as the invoking image. Is it harmful to make a reference to a collective subroutine be an image control statement? [208:18 11.6.1p2] After "coarray arguments" insert ", or that references an intrinsic collective subroutine". [345:18-20 16.6p2] Delete "A collective subroutine ... CRITICAL construct)". [345:21-22 C1602] Delete C1602.