-
-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Execution of a FORM TEAM statement results in the following calls to MPI routines in mpi_caf.c:
void PREFIX(form_team) (...)
{
...
MPI_Comm *current_comm = &CAF_COMM_WORLD;
...
ierr = MPI_Barrier(CAF_COMM_WORLD); chk_err(ierr);
...
ierr = MPI_Comm_split(*current_comm, team_id, caf_this_image, newcomm);
...
}
MPI_Comm_split() is effectively a barrier: no MPI processes in CAF_COMM_WORLD can return from MPI_Comm_split() until all MPI processes in CAF_COMM_WORLD have called it. It seems that the aforementioned MPI_Barrier could be removed while still maintaining the FORM TEAM synchronization semantics as specified in the Fortran 2018 (N2146 draft):
11.6.9 FORM TEAM statement
...
5 ...When a FORM TEAM statement is executed, there is an implicit synchronization of all active images in the current team. On those images, execution of the segment following the statement is delayed until all other active images in the current team have executed the same statement the same number of times in this team. The segments that executed before the FORM TEAM statement on an active image of this team precede the segments that execute after the FORM TEAM statement on another active image of this team...