Exemplo n.º 1
0
gex_Rank_t gasnetc_msgsource(gex_Token_t token) {
  #if GASNET_PSHM
    gasneti_assert(! gasnetc_token_in_nbrhd(token));
  #endif
    gasneti_assert(token);

    int tmp; /* AMUDP wants an int, but gex_Rank_t is uint32_t */
    gasneti_assert_zeroret(AMUDP_GetSourceId(token, &tmp));
    gasneti_assert(tmp >= 0);
    gex_Rank_t sourceid = tmp;
    gasneti_assert(sourceid < gasneti_nodes);
    return sourceid;
}
Exemplo n.º 2
0
/*
  Misc. Active Message Functions
  ==============================
*/
extern int gasnetc_AMGetMsgSource(gasnet_token_t token, gasnet_node_t *srcindex) {
  int retval;
  gasnet_node_t sourceid;
  GASNETI_CHECKATTACH();
  GASNETI_CHECK_ERRR((!token),BAD_ARG,"bad token");
  GASNETI_CHECK_ERRR((!srcindex),BAD_ARG,"bad src ptr");

#if GASNET_PSHM
  if (gasneti_AMPSHMGetMsgSource(token, &sourceid) != GASNET_OK)
#endif
  {
    int tmp; /* AMUDP wants an int, but gasnet_node_t is uint16_t */
    GASNETI_AM_SAFE_NORETURN(retval,AMUDP_GetSourceId(token, &tmp));
    if_pf (retval) GASNETI_RETURN_ERR(RESOURCE);
    gasneti_assert(tmp >= 0);
    sourceid = tmp;
  } 

    gasneti_assert(sourceid < gasneti_nodes);
    *srcindex = sourceid;
    return GASNET_OK;
}