Open naveen-rn opened 4 years ago
Here's a straightforward adaptation from shmem_team_split_strided
that mirrors the proposed wording changes in #461. What do you think?
SHMEM_TEAM_DUP
Create a new OpenSHMEM team with the same set of PEs as an existing team.
SYNOPSIS
C/C++:
int shmem_team_dup(shmem_team_t parent_team, const shmem_team_config_t *config,
long config_mask, shmem_team_t *new_team);
DESCRIPTION
Arguments
parent_team
An OpenSHMEM teamconfig
A pointer to the configuration parameters for the new teamconfig_mask
The bitwise mask representing the set of configuration parameters to use from config
.new_team
An OpenSHMEM team handle. Upon successful creation, it references an OpenSHMEM team that contains the same set of PEs as in the parent team.API Description
The shmem_team_dup
routine is a collective routine. It creates a new OpenSHMEM team from an existing parent team using the same PE subset as the parent team.
This routine must be called by all PEs in the parent team. On successful creation of the new team:
new_team
handle will reference a valid team for the subset of PEs in the parent team.shmem_team_dup
will return zero to all PEs in the parent team.If the new team cannot be created, then new_team
will be assigned the value SHMEM_TEAM_INVALID
and shmem_team_dup
will return a nonzero value on all PEs in the parent team.
The config
argument specifies team configuration parameters, which are described in Section 9.4.3.
The config_mask
argument is a bitwise mask representing the set of configuration parameters to use from config
. A config_mask
value of 0 indicates that the team should be created with the default values for all configuration parameters. See Section 9.4.3 for field mask names and default configuration parameters.
If parent_team
compares equal to SHMEM_TEAM_INVALID
, then no new team will be created, new_team
will be assigned the value SHMEM_TEAM_INVALID
, and shmem_team_dup
will return a nonzero value.
Return Values
Zero on successful creation of new_team
; otherwise, nonzero.
Do we want to allow config to be inherited by the child team, e.g. if config == NULL
? @naveen-rn was this something you had in mind with the initial issue?
Define a semantics for team duplication by inheriting the parent teams resources and just a new handle that can be used for collectives.