To: J3 J3/14-134 From: Bill Long Subject: TS 18508 : Report on converting N1996 to 14-130/N2007 Date: 2014 March 11 References: WG5/N1996 Discussion ---------- This paper contains notes regarding the edit activity resulting in the creation of the TS 18508 drafts J3/14-130 and WG5/N2007. The edits are based on WG5/N1996. Papers used as edit sources for Part I are: 14-102r2 14-104r2 14-105r3 14-107r2 14-110r1 14-111r2 14-112r2 14-113r1 Part I also includes additional edits needed for proper integration of the paper edits (denoted as "New") and has modifications of some edits to correct errors of editorial scope (denoted as "Modified"). Technical repairs are documented in Part II. Part I: Edits in papers passed at J3 meeting 203 and editorial repairs ====================================================================== TS Introduction --------------- [iv:p4] New. {Additional edit: Add at the end of Introduction, para 4, the Corrigendum 2 reference. Matches edit [1:3] below. Result is that the TS is upward compatible with F2008 + Corrigendum 2.} TS Clause 1 Scope ----------------- [1:3] Done. {14-107r2} TS Clause 3 Terms and definitions --------------------------------- [5:13] New. {Additional edit: Replace the definition of current team with "the team specified in the CHANGE TEAM statement of the innermost executing CHANGE TEAM construct, or the initial team if no CHANGE TEAM construct is active". This then matches the changes in The corresponding text defining "current team" 5.1.} [5:25+] New. {Additional edit: Add a definition for "failed image". Copy text from 5.8.} TS Clause 5 Teams ----------------- [9:3-4] Done. {14-112r2} [9:4-6] Done. {14-110r1} [9:5] Not done. {14-112r2} {The edited sentence was replaced by 14-110r1.} [9:15+] New and Modified. {Additional required edit: The definition of "established" has to appear in the normative text of the TS. Just adding it to the Edits in Clause 8 is not sufficient. Adding the text from 14-110r1 edit [28:25+] here. Also, modified to make needed technical repairs. See Part II below.} [9:18-19] New. {Additional edit: In the fourth sentence of 5.2 TEAM_TYPE, delete "that includes the executing team". The changes in 14-113r1 allow assignment of team variables, so is it now possible to have a scalar variable of type TEAM_TYPE that is accessible (in a module, for example) that is not part of the current team family tree.} [9:22-23] Done. {14-113r1} [9:24-33] Done. {14-113r1} [9:34] Done. {14-113r1 and 14-112r2 - duplicated edit.} [10:5+] Modified. {14-110r1} {Moved new constraint to [10:16+] to be in order with the existing ones, and added a reference back to the rule, following the pattern of the existing constraints.} [10:17] Done. {14-112r2} [10:17-18] New. {Additional edit: In C508 the reference for TEAM_TYPE is "defined in the ISO_FORTRAN_ENV intrinsic module". This is not consistent style in C604 which uses a subclause reference. LOCK_TYPE in 10-007r1 also uses a subclause reference. To be consistent, change "defined in the ISO_FORTRAN_ENV intrinsic module" to "(5.2)".} [10:18+] New. {Additional edit: Add a needed constraint as follows: "C506a (R502) No shall appear more than once in a ."} [10:18+] Done {14-110r1} [10:20] Done. {14-113r1} [10:20] Done. {14-112r2} [10:21] Done. {14-113r1} [10:21] Done. {14-113r1} [10:22-23] Done. {14-113r1} [10:23+] Modified {14-110r1} {Following the three references added "of ISO/IEC 1539-1:2010" since these are references to the base standard and not parts of the TS. Also deleted the text about changing final upper bounds. See Part II for additional edits.} [10:28] New. {After the first sentence add a sentence to require that the whole set of images in the team execute the same CHANGE TEAM statement: "All nonfailed images of the team containing the executing image that is identified by shall execute the same CHANGE TEAM statement."} [10:38] Done. {14-110r1} [10:38+] Done. {14-110r1} [11:1-7] Modified {14-110r1} {Replaced "" with "team identifier" which was defined in 5.1. Changed "with the value" to "with a value" because there might be more than one ancestor team. Finally, the wording of the second sentence seems vague. Clearer to explicitly separate the effect of changing a team (changing the local image index and number of images) and what cosubscripts do (determine an image index). Replaced the second sentence with "The coarray shall be established in that team or an ancestor of that team and the cosubscripts determine an image index in that team." At the end of the second paragraph, add a similar establishment requirement: "The coarray shall be established in an ancestor of the current team and the cosubscripts determine an image index in the team identified by TEAM_ID."} [11:1-4] Not done. {14-112r2} {The whole paragraph was replaced by 14-110r1.} [11:7+] Modified. {14-110r1} {The stated edits did not match the text at the beginning of the Note. Made the array A uniformly the one in the initial team and B the associated one in the CHANGE TEAM block. Change the comments "Iterate" and "Halo exchange" to "Iterate within team" and "Halo exchange across team boundary" to clarify that the halo exchange illustrated does not include halo exchanges between images within a team.} [11:7+2] Done. {14-112r2} [11:7+22] Done. {14-112r2} [11:8-] Done. {14-112r2} [11:15-16] Done. {14-112r2} [11:15, 12:1-2, 12:3-6] Done. {14-112r2} [12:6+] Modified. {14-112r2} {Changed the text to be replaced to "coarrays regarded as".} [12:10-11] Modified. {14-113r1} {The second sentence in this edit technically omits the initial team, which has a value for any of its team variables initially defined rather than by executing FORM TEAM. Appended to the new sentence: "or shall be the values of the team variables for the initial team".} [12:17-] Done. {14-102r2} [12:18-19] Done. {14-112r2} [12:23] New. {Additional edit: Change "definitions of variables fail when that variable" to "definitions of a variable on the image fail when that variable". The current text has a plural/singular mismatch, and is not clear that the variables involved are on the failed image.} [12:24] Done. {14-112r2} [13:2+] Done. {14-112r2} TS Clause 6 Events ------------------ [15:8-9] Done. {14-104r2} [15:8-9] New. {After the edit above from 14-104r2, append the sentence at [30:3-4]. The sentence in 8.7 that edits 8.5.2 paragraph 3 to exempt changes to event variables from segment rules, similar to atomics, is normative and should appear in cause 6 of the TS where event variables are introduced. The text at [33:11] is amended to remove the new sentence, which is already added to the base standard in 8.5.2.} [15:24] Done. {14-104r2} [15:26-27] Done. {14-104r2} [15:29] Done. {14-104r2} [15:30-33] Done. {14-104r2} [15:34] Modified. {14-112r2} {Minor wording change of "an" to "another" before the second EVENT POST, to improve clarity.} [16:3] Done. {14-104r2} [16:5-7] Done. {14-104r2} [16:8-10] Done. {14-104r2} [16:14-19] Done. {14-104r2} TS Clause 7 Intrinsic procedures -------------------------------- [17:8] Done. {14-112r2} [17:9] New. {Additional required edit: In 7.1p2 include MOVE_ALLOC (added to the TS by 14-107r2) to the list of current intrinsics modified by the TS, ordering the list to be alphabetical.} [17:12-16] New. {Insert better wording for consistency of atomic operations. In 7.2 delete the fourth sentence (ordering in unordered segments is processor dependent) and replace the second sentence with: "The effect of executing atomic subroutines in unordered segments on a single atomic object is as if the subroutines were executed in some processor-dependent serial order, with none of the accesses to that object in any one subroutine execution interleaving with those in any other."} [17:16] New. {While the assignment of the value to OLD is not part of the atomic operation, the determination of that value IS part of the atomic operation. Add that the sentence.} [17:22] New. {Additional edit: In 7.3p1, first sentence, add "nonfailed" before " image of the current team" to be consistent with the rest of the paragraph.} [17:28] Done. {14-112r2} [18:19], [19:6], [19:37], [20:10] Done. {14-112r2} [19:27] Done. {14-112r2} [20:20] Done. {14-112r2} [22:12] Done. {14-112r2} [22:16] Done. {14-112r2} [22:17] Done. {14-112r2} [22:33] Done. {14-112r2} [23:24] Done. {14-112r2} [23:34] Done. {14-112r2} [23:36+] Done. {14-112r2} [23:40] Done. {14-104r2} [23:40-41] New. {Additional edit: Move "to EVENT[2]" earlier in sentence, after "posts" to improve readability.} [24:1] Done. {14-111r2} [24:3+] Modified. {14-111r2} {The second sentence of the edit, "If TEAM is present..." belongs at the beginning of the Result Value paragraph. Moved.} [24:4-6] Done. {14-111r2} [24:9] Done. {14-111r2} [24:10] Done. {14-111r2} [24:19-20] Done. {14-112r2} {Edit actually on line 19 only.} [24:34 - 25:7] New. {Replace the SUBROUTINE TT example to GET_TEAM with a new one that is more clear about which teams are in effect.} [26:10+] Modified. {14-107r2} {The reference (8.5.2) is to the base standard, so added that qualification in the text.} [26:27] Done. {14-112r2} TS Clause 8 Required editorial changes -------------------------------------- [27:24] New. {Additional required edit: At the end of the last additional facility list entry, append "and simulate failure of an image". Need to update the list to include the FAIL IMAGE statement introduced by 14-102r2.} [27:30+] New. {Additional edit: Replicate the new definition of "failed image" at [5:25+] with subclause numbers changed.} [28:3] New. {Replace the definition of "current team" with the new definition at [5:13].} [28:22+] New. {Additional edit: Add new construct and statements into the syntax list in 2.1 High level syntax as follows: In R213 insert alphabetically ""; in R214 insert alphabetically "", "", "", "", and "".} [28:23] New. {Additional required edit: Modify the first edit to move only the first 3 paragraphs of 5.1. The new paragraph 4 in 5.1 should be moved to 2.4.7 instead. See [9:15+] above.} [28:23] New. {Additional edit: Change the beginning of the edit instructions to place the new text after paragraph 1 if 2.3.4, instead of "At the end", to keep the Notes in 2.3.4 at the end of the subclause.} [28:25+] Modified. {14-110r1, first edit} {Instead of inserting the paragraph in the Clause 8, insert ad edit with instructions to move 5.1 para 4 to 2.4.7 since the text from 14-110r1 is now duplicated in 5.1. See [9:15+] above.} [28:25+] Modified. {14-110r1} {second and third edits, modified to \uwave form, and made into separate edits.} [28:25+] Modified. {14-110r1} {final edit, modified to \uwave form.} [28:31] New. {Additional required edit: The new constraint and the changes made to R624 at [10:38] and [10:38+] by 14-110r1 need to be replicated in Clause 8, replacing the existing edit at [28:31].} [28:32-34] New. {Additional required edit: Modify the instructions for moving the text in 5.4 to the base standard to account for new changes in 5.4 - two paragraphs starting after C508 instead of one starting after R624, and removing the reference to GET_TEAM.} [29:24] Done. {14-112r2} [29:29] {Additional required edit: Remove the Fortran standard reference that was added in 5.3, and change the subclause reference at the end of C506 to 13.8.2.26.} [29:31+] Moved. {14-102r2} {Paper has edit at [29:37+] which is not the correct order. Moved.} [30:31] Done. {14-112r2} [30:40] Modified. {14-112r2} {Changed the resulting text from "error condition occurs other than STAT_FAILED_IMAGE" to "error condition other than detection of a failed image occurs". The original implied that STAT_FAILED_IMAGE was an error condition, rather than an integer constant.} [32:1-] Done. {14-111r2} [32:1-] Modified. {14-107r2} {Instead of a new edit, I combined the MOVE_ALLOC changes into the existing edit for NUM_IMAGES and THIS_IMAGE.} [32:6] Done. {14-112r2} [32:6+] Modified. {14-107r2} {Reformatted the edit for changing the MOVE_ALLOC title to match the style of NUM_IMAGES. Also added an edit to remove the reference to the Fortran standard in the moved text.} [33:12-13] Done. {14-104r2} [33:26+] Modified. {14-102r2} {Changed last character of the edit from "." to ";" since insert is in the middle of the list.} [33:7] New. {Additional edit: Changed "image was member" to "image was a member".} [33:27-28] Done. {14-112r2} TS Annex A ---------- [36:15] Modified. {14-112r2} {Simplified the 5 statement IF construct to "read_checkpoint = this_image() > images_used".} [36:36] Done. {14-112r2} [37:6] New. {Additional edit: Added the program name to the END PROGRAM statement to be consistent with other example codes.} [37:10+] Modified. {14-110r1} {The A.1.4 example code has a PROGRAM statement with no program name, which is a syntax error. Added name row_column, and also added the name to the END PROGRAM statement.} [37:20 - 38:44] Modified. {14-105r3} {The example code has a PROGRAM statement with no program name, which is a syntax error. Added name work_share, and also added the name to the END PROGRAM statement. Also undo continuations in some cases to allow for longer lines in pdf file. Converted comments on the USE statement to ONLY clause.} [37:36] Not done. {14-112r2} {Text replaced by 14-105r3.} [37:37] Not done. {14-112r2} {Text replaced by 14-105r3.} [38:46-39:17] Modified {14-104r2} {Edit in paper started at 38:45 which removed the subsection title. Changed to start at 38:46 to retain title. In first paragraph, change "that has a given" to "that have a given".} Part II: Technical repairs =========================== [9:15+] {The new edit from 14-110r1 describing how a coarray becomes "established" omits the case of a declaration in a BLOCK construct (10-007r1, 5.3.6.3p3). In addition, an associating coarray is established by the CHANGE TEAM statement execution, whereas for a dummy argument it is not on entry to the procedure. But the associating coarray concept is modeled on argument association, so the two cases should have parallel wording. Reworded the paragraph with these issues addressed as follows.} "A nonallocatable coarray that is neither a dummy argument, host associated with a dummy argument, declared as a local variable of a subprogram, nor declared in a BLOCK construct is established in the initial team. An allocated allocatable coarray is established in the team in which it was allocated. An unallocated allocatable coarray is not established. An associating coarray is established in the team of its CHANGE TEAM block. A nonallocatable coarray that is a dummy argument or host associated with a dummy argument is established in the team in which the procedure was invoked. A nonallocatable coarray that is a local variable of a subprogram or host associated with a local variable of a subprogram is established in the team in which the procedure was invoked. A nonallocatable coarray declared in a BLOCK construct is established in the team in which the BLOCK statement was executed." [10:23+] {The edit from {14-110r1} contains the following 2 paragraphs: "Within a CHANGE TEAM construct, a coarray that does not appear in a has the corank and cobounds that it had when it was established, apart from its final upper cobound. Within a CHANGE TEAM construct, the final upper cobound of a coarray is determined from the number of images in the current team." The value of the final upper cobound affects two parts of the standard. 1) The rule that cosubscripts always being within the cobounds: 10-007r1:[125:21-22] "The value of a cosubscript in an image selector shall be within the cobounds for its codimension." Similar wording appears at 10-007r1:[93:2-3]. 2) The value returned by the ucobound intrinsic, in 10-007r1:[395:17-18] "The final upper cobound is the final cosubscript in the cosubscript list for the coarray that selects the image with index NUM IMAGES( )." The value of NUM_IMAGES() is not specified to be associated with any particular team, since that concept did not exist in F2008. However, the logical reading of the current text would be the value of NUM_IMAGES() at the point where UCOBOUNDS() is invoked. There is a basic conflict between these two cases in the context of teams. For an image selector that includes a team variable, the rule in (1) would require that the final upper cobound be the one at the time the coarray was established, so that the full range of the final cosubscript is available within the rule. On the other hand, (2) implies that the final upper cobound is that based on the number of images in the current team. The wording in 14-110r1 assumes that (2) is correct, requiring a change to the rule in (1). Alternatively, keeping the rule in (1) implies modifying the edit in 14-110r1 and the wording in the Result Value for UCOBOUND. In either case, the rule at 10-007r1:[125:24-25] "An image selector shall specify an image index value that is not greater than the number of images." needs to be modified to account for teams. The two alternatives are: A) Keep the current rule (1) unchanged, and have the final upper cobound set at the point of establishing the coarray, and not changed by changing teams. Edits for this option: 14-110r1:[10:23+] In the first of the two paragraphs quoted above, delete ", apart from its final upper cobound" and delete the second paragraph. This leaves: "Within a CHANGE TEAM construct, a coarray that does not appear in a has the corank and cobounds that it had when it was established." [28:31+] Add a new edit: "{In 6.6 Image selectors, edit the last sentence of the second paragraph as follows.} An image selector shall specify an image index value that is not greater than the number of images \uwave{in the team specified by if it appears or in the current team otherwise}." [33:9+] Add an edit in 8.9 to modify UCOBOUND: "{In 13.7.172 UCOBOUND, edit the Result Value as follows.} The final upper cobound is the final cosubscript in the cosubscript list for the coarray that selects the image with index \sout{NUM_IMAGES( )} \uwave{equal to the number of images in the current team when the coarray was established.}" B) Have the final upper cobound of an already established coarray (potentially) changed at the beginning a CHANGE TEAM block. Edits for this option are required at [28:28+] to add a new subclause "8.5a Edits to Clause 5" and edit the second sentence of the fourth paragraph of 5.3.6.3 Explicit-coshape coarray. [28:31+] Add 2 new edits, the first to edit the second sentence of the second paragraph of 6.6 Image selectors, and the second that duplicates the edit from Option A to edit the last sentence of the second paragraph in the same subclause. Option A seems less disruptive to basic Fortran concepts and simpler, so those edits are included in the TS draft.}