The question came up on the call today regarding the implementation of OpenSHMEM over MPI and mapping communicators to teams/contexts.
How do I do point to point with many teams using a single context?
Since contexts are created from teams, there is no way to map one context to multiple teams. Each context has a unique team mapping.
So, to handle the case of one context and 3 teams with different pe membership, the user would need to create a context from SHMEM_TEAM_WORLD, then create 3 teams, then use point to point operations on the created context and use shmem_team_translate to transform pe numbers from the global number into the team ID number.
In the case where there are 4 teams with the same pe membership, the context could be created from one of the teams and used in all point to point operations without any translation.
For example:
Case 1:
SHMEM_TEAM_WORLD: pe 0-5
team0: global pe 0, 2, 4 : team pe 0-2
team1: global pe 1, 3, 5 : team pe 0-2
my_ctx: team = SHMEM_TEAM_WORLD
I want to send data to team0, pe 2, which is global pe 4
shmem_put(my_ctx, dest, src, 1, shmem_team_translate(SHMEM_TEAM_WORLD, team0, 2))
I want to send data to team1, pe 2, which is global pe 5
shmem_put(my_ctx, dest, src, 1, shmem_team_translate(SHMEM_TEAM_WORLD, team1, 2))
Case 2:
SHMEM_TEAM_WORLD: pe 0-5
team0: global pe 0, 2, 4 : team pe 0-2
team1: global pe 0, 2, 4 : team pe 0-2
my_ctx: team = team0
I want to send data to team0, pe 2, which is global pe 4
shmem_put(my_ctx, dest, src, 1, 2)
I want to send data to team1, pe 1, which is global pe 2
shmem_put(my_ctx, dest, src, 1, 1)
The question came up on the call today regarding the implementation of OpenSHMEM over MPI and mapping communicators to teams/contexts.
How do I do point to point with many teams using a single context?
Since contexts are created from teams, there is no way to map one context to multiple teams. Each context has a unique team mapping.
So, to handle the case of one context and 3 teams with different pe membership, the user would need to create a context from SHMEM_TEAM_WORLD, then create 3 teams, then use point to point operations on the created context and use shmem_team_translate to transform pe numbers from the global number into the team ID number.
In the case where there are 4 teams with the same pe membership, the context could be created from one of the teams and used in all point to point operations without any translation.
For example:
Case 1: SHMEM_TEAM_WORLD: pe 0-5 team0: global pe 0, 2, 4 : team pe 0-2 team1: global pe 1, 3, 5 : team pe 0-2 my_ctx: team = SHMEM_TEAM_WORLD
I want to send data to team0, pe 2, which is global pe 4
shmem_put(my_ctx, dest, src, 1, shmem_team_translate(SHMEM_TEAM_WORLD, team0, 2))
I want to send data to team1, pe 2, which is global pe 5
shmem_put(my_ctx, dest, src, 1, shmem_team_translate(SHMEM_TEAM_WORLD, team1, 2))
Case 2: SHMEM_TEAM_WORLD: pe 0-5 team0: global pe 0, 2, 4 : team pe 0-2 team1: global pe 0, 2, 4 : team pe 0-2 my_ctx: team = team0
I want to send data to team0, pe 2, which is global pe 4
shmem_put(my_ctx, dest, src, 1, 2)
I want to send data to team1, pe 1, which is global pe 2
shmem_put(my_ctx, dest, src, 1, 1)