openshmem-org / specification

OpenSHMEM Application Programming Interface
http://www.openshmem.org
49 stars 32 forks source link

Understanding team_destroy operation #443

Open naveen-rn opened 4 years ago

naveen-rn commented 4 years ago

Should the team handle passed as input to the shmem_team_destroy be shmem_team_t * instead of shmem_team_t? With the current API, it looks like we can destroy the referenced team, but the handle remains usable. From the user perspective, if they compare the destroyed team against SHMEM_TEAM_INVALID, it will be negative and users can try to use the handle for any team-based operation and it would fail badly.

Current:

shmem_team_destroy(shmem_team_t team)

Modified:

shmem_team_destroy(shmem_team_t *team)

jdinan commented 4 years ago

The handle value is invalid after shmem_team_destroy returns. Application developers can reset their handle to SHMEM_TEAM_INVALID if they want to. This is pretty normal. For example, free does not reset the pointer to NULL. I seem to recall a discussion in the teams WG about adopting the MPI style of API that resets the handle value and there was a preference toward the current API.