_gfortran_caf_form_team (The GNU Fortran Compiler)

#### 7.2.38 `_gfortran_caf_form_team` — Team creation function ¶

Synopsis:

  `void _gfortran_caf_form_team (int team_id, caf_team_t *team, int *new_index, int *stat, char *errmsg, size_t errmsg_len)`

Description:

  Create a team. All images giving the same team_id in a call to `FORM TEAM` will form a new team addressable by the opaque handle team which is of type `team_type` from the intrinsic module `ISO_FORTRAN_ENV`. In the team the image gets the image index given by new_index if present. If new_index is absent, then an implementation specific index is assigned.

Arguments:

  team_id | intent(in) A unique id for each team to form. Images giving the same team_id in a call to `FORM TEAM` belong to the same team.
  team | intent(out) The opaque pointer to the newly formed team
  new_index | intent(in) If non-null gives the unique index of this image in the newly formed team. When no new_index is given, the caf-library is free to choose a unique index.
  stat | intent(out) Stores the status STAT= and may be NULL.
  errmsg | intent(out) When an error occurs, this is set to an error message; may be NULL.
  errmsg_len | intent(in) the buffer size of errmsg

Notes:

  The id given in team_id has to be unique in all subsequent calls to `FORM TEAM` on the same image. That id is the same used in `TEAM_NUMBER=` of coarray indexes, which motivates the uniqueness.

  The index given in new_index needs to be unique among all members of team to create. Failing uniqueness may lead to misbehaviour, which depends on the caf-library’s implementation. The library is free to implement checks for this, which imposes overhead and therefore may be avoided.