To: J3 13-264 From: Bill Long, John Reid Subject: Form subteams Date: 19 June 2013 References: N1967, N1968, N1971 Discussion ---------- In his ballot comments (N1971), Reinhold Bader has drawn attention to deficiencies in the FORM SUBTEAMS statement: 1. It is not made clear that the intention is that all the images of the current team must participate in corresponding FORM SUBTEAMS statements. 2. It is not made clear that the intention is that corresponding FORM SUBTEAMS statements must participate with corresponding team variables. For example, it was not intended that a team be formed by some images of the current team executing FORM SUBTEAMS(I,TEAM(1)) and the rest executing FORM SUBTEAMS(I,TEAM(2)) 3. It is desirable for a team to be defined by data that is spread over the set of its team variables on all its images. Data that aids efficient execution as a team can be established during the execution of FORM SUBTEAMS. 4. It is not clear how SYNC TEAMS can work unless it is restricted to teams that are unchanged since they last participated in a CHANGE TEAMS construct, because each team is defined by the values of the subteam-ids on the images of its parent team and identifying it is a collective calculation involving the parent team. Reinhold suggests that the FORM SUBTEAMS statement be replaced by a collective subroutine. This idea has been discussed by the subgroup and rejected. The main reasons were that an intrinsic subroutine can be overridden by the user, leading to confusing code; and there is symmetry with having FORM SUBTEAM and CHANGE TEAM both statements. The edits suggested here are intended to remedy the problems directly. Additionally, missing edits are provided for issues related to team variables: 1) The team variable in a FORM SUBTEAM statement appears in a variable definition context. An edit in clause 8 is supplied for this. 2) Variables of type TEAM_TYPE should have restrictions similar to those of type LOCK_TYPE. Edits for subclause 5.2 are supplied for this. Edits to N1967: --------------- [9:21+] Add two constraints to 5.2 TEAM_TYPE: "C501 A team variable shall not appear in a variable definition context except as the in a FORM SUBTEAM statement, as an , or as an actual argument in a reference to a procedure with an explicit interface where the corresponding dummy argument has INTENT (INOUT). C502 A variable with a subobject of type TEAM_TYPE shall not have the POINTER attribute and shall not appear in a variable definition context except as an allocate-object or as an actual argument in a reference to a procedure with an explicit interface where the corresponding dummy argument has INTENT (INOUT)." [10:22+] Add paragraph: "If the FORM SUBTEAM statement is executed on one one image, it shall be executed by the same statement on all images of the current team in execution segments that are not ordered with respect to each other. If contains any subscripts, the values of each shall be the same on all these statements. From the beginning of execution of the current team, the sequence of executions of FORM SUBTEAM statements shall be the same on all images of the current team." [10:30+] Add paragraph: "The value of shall be unchanged since a successful execution of a FORM SUBTEAM statement on the current team." [30:17+] Add new subclause: " 8.6a Edits to clause 16 {At the end of the list of variable definition contexts in 16.6.7p1, replace the "." at the end of entry (15) with ";" and add a new entry as follows} (16) a in a FORM SUBTEAM statement; "