IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

shmem_team_my_pe

shmem_team_my_pe(team: Int32 = Int32(2)) -> c_int

Returns the number of the calling PE within a specified team.

When team specifies a valid team, the shmem_team_my_pe routine returns the number of the calling PE within the specified team. The number is an integer between 0 and N − 1 for a team containing N PEs. Each member of the team has a unique number. If team compares equal to SHMEM_TEAM_INVALID, then the value -1 is returned. If team is otherwise invalid, the behavior is undefined.

For the world team, this routine will return the same value as shmem_my_pe.

Args:

  • team (Int32): The team identifier, defaults to SHMEM_TEAM_NODE (node team).

Returns:

c_int: The number of the calling PE within the specified team, or the value -1 if the team handle compares equal to SHMEM_TEAM_INVALID.