openshmem-org / specification

OpenSHMEM Application Programming Interface
http://www.openshmem.org
51 stars 41 forks source link

Create Team Duplicate options #366

Open naveen-rn opened 4 years ago

naveen-rn commented 4 years ago

Define a semantics for team duplication by inheriting the parent teams resources and just a new handle that can be used for collectives.

nspark commented 3 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

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:

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.

jdinan commented 3 years ago

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?