To: J3 07-208 From: Bill Long and John Reid Subject: UTI 86 (p199): SYNC TEAM unsafe and too slow? Date: 2007 May 01 References: J3/07-007r1 Discussion UTI 86 asks if it would be better to have the SYNC TEAM statement verify that the executing image is part of the image-team, as opposed to making the program non-conforming if that is not the case. We believe the answer is no. The point of teams is high performance. Adding such a check into the execution of a SYNC TEAM statement is counter to that goal. The editor asserts that it is O(1), but we wonder if this will always be the case. A programmer can extract the list of images from an image-team variable with the TEAM_IMAGES intrinsic function and perform a check if desired. In addition, an implementation is allowed to have a debug mode that would link in slower versions of the sync statements that could do checking of this sort. We agree that it is desirable to check calls of the FORM_TEAM intrinsic subroutine, where the check's affect on performance would be less significant. Assuming a team is cleanly formed, it should not later become defective, so checks in later usage would be unnecessary. The UTI recommends edits to both SYNC TEAM and FORM_TEAM. We agree that a change for FORM_TEAM is desirable and provide an edit below. We do not recommend an edit for SYNC TEAM, but provide one below for expediency in case J3 disagrees. Edits to J3/07-007r1: --------------------------------- Edits for FORM_TEAM (recommended): [377:17-19] In 13.7.70 FORM_TEAM, para. 3, lines 3-5, replace ", and shall ... THIS_IMAGE()." by ". An error condition occurs unless: (1) IMAGES specifies the same set of image on all images of the team, (2) all the elements of IMAGES have values in the range 1, ... , NUM_IMAGES() and there are no repeated values, and (3) one of the elements of IMAGES has the value THIS_IMAGE()." [377:28-29] In 13.7.70 FORM_TEAM, replace para. 4 by "If FORM_TEAM is invoked by an image, an error condition occurs unless it is invoked by the same statement on all images specified by the IMAGES argument. In the absence of an error condition, there is an implicit team synchronization after the team is formed." ------------------------------------- Edit for SYNC TEAM (not recommended): [199:7-11] In 13.7.70 SYNC TEAM statement, para. 1, lines 2-6, replace "The team ... invoked for the team." by "The team is specified by the value of . An error condition occurs unless the team includes the executing image and all images of the team execute a SYNC TEAM statement with a value of that was constructed by corresponding invocations of the intrinsic function FORM_TEAM for the team. The images do not commence executing subsequent statements until all images in the team have successfully executed a SYNC TEAM statement for the team an equal number of times since FORM TEAM was invoked for the team."