gmegan / specification

OpenSHMEM Application Programming Interface
http://www.openshmem.org
1 stars 0 forks source link

Need for ctx based PE translate #62

Open naveen-rn opened 5 years ago

naveen-rn commented 5 years ago

Cray SHMEM had shmem_team_translate_pe because we considered that teams would be used for all RMA/AMO operations. With the change in the proposal and adding context - we are performing all comms on a context. A context is internally mapped to a team. So, do we need a context-based translate operation.

EDIT: changed shmemx_pe_team_translate to shmem_team_translate_pe

nspark commented 5 years ago

I thought the Teams API was going to provide something like shmem_team_translate_pe. Since it's the team that is the object that encapsulates the PE reindexing scheme, I think that should be the "object" for such a "method". I wouldn't add an equivalent method on a context just because the context is mapped to a team.

gmegan commented 5 years ago

We have the routine: shmem_team_translate_pe(src_team, src_pe, dest_team)

So, I would think that a shmem_ctx_translate_pe would look like this:

int shmem_ctx_translate_pe(shmem_ctx_t src_ctx, int src_pe, shmem_ctx_t dest_ctx)
{
    shmem_team_t src_team, dest_team;
    shmem_ctx_get_team(src_ctx, &src_team);
    shmem_ctx_get_team(dest_ctx, &dest_team)
    return shmem_team_translate(src_team, src_pe, dest_pe);
}

Does it seem worth it to add this to the specification? I advocate not adding to spec and just letting the programmer add this to their library of functions since it is pretty straightforward to implement.

If we add it to the spec we have to decide if there is supposed to be some error checking, like do we return -1 if shmem_ctx_get_team fails for some reason? Maybe better to just let the user decide on what error check they want. Also, the semantics of combining team and context still seem like they need to be field tested more before adding more routines to re-enforce the current solution.