How to define a nvshmem team

Hi, All

Is there any example of define nvshmem team? I search through the NVSHMEM document and did not find the code example of define a shmem_team_t. What is the parameter I need? for example I want to use the API

int nvshmem_TYPENAME_and_reduce(shmem_team_t team, TYPE *dest, const TYPE *source, size_t nreduce)

How could I define the shmem_team_t team?


NVSHMEM has several predefined teams which are described in detail in the API docs here and here. If you would like all PEs to participate in the reduction, you can provide NVSHMEM_TEAM_WORLD as the team argument. If you would like a subset of the PEs in NVSHMEM_TEAM_WORLD to participate, you can create a new team from NVSHMEM_TEAM_WORLD using one of the split APIs to construct a new team.

Got it.