extern int gasnetc_AMPoll(void) { int retval; GASNETI_CHECKATTACH(); #if GASNET_PSHM gasneti_AMPSHMPoll(0); #endif AMLOCK(); GASNETI_AM_SAFE_NORETURN(retval,AM_Poll(gasnetc_bundle)); AMUNLOCK(); if_pf (retval) GASNETI_RETURN_ERR(RESOURCE); else return GASNET_OK;
extern int gasnetc_AMPoll(void) { int retval; GASNETI_CHECKATTACH(); #if GASNET_PSHM /* If your conduit will support PSHM, let it make progress here. */ gasneti_AMPSHMPoll(0); #endif gasnetc_p4_poll(); return GASNET_OK; }
extern int gasnetc_AMPoll(void) { int retval; GASNETI_CHECKATTACH(); #if GASNET_PSHM /* If your conduit will support PSHM, let it make progress here. */ gasneti_AMPSHMPoll(0); #endif /* add code here to run your AM progress engine */ /* should be a generic polling */ gasnetc_ofi_poll(); return GASNET_OK; }
extern int gasnetc_AMPoll(GASNETI_THREAD_FARG_ALONE) { int retval; GASNETI_CHECKATTACH(); #if GASNET_PSHM gasneti_AMPSHMPoll(0 GASNETI_THREAD_PASS); #endif AMLOCK(); // In single-nbrhd case never need to poll the network for client AMs. // However, we'll still check for control traffic for orderly exit handling. if (gasneti_mysupernode.grp_count > 1) { GASNETI_AM_SAFE_NORETURN(retval,AM_Poll(gasnetc_bundle)); } else { // TODO-EX: a lock-free peek would allow elimination of a lock cycle GASNETI_AM_SAFE_NORETURN(retval,AMUDP_SPMDHandleControlTraffic(NULL)); } AMUNLOCK(); if_pf (retval) GASNETI_RETURN_ERR(RESOURCE); else return GASNET_OK;
extern int gasnetc_AMGetMsgSource(gasnet_token_t token, gasnet_node_t *srcindex) { 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 your conduit will support PSHM, let the PSHM code * have a chance to recognize the token first, as shown here. */ if (gasneti_AMPSHMGetMsgSource(token, &sourceid) != GASNET_OK) #endif { gasnetc_p4_token_t *p4_token = (gasnetc_p4_token_t*) token; sourceid = p4_token->sourceid; } gasneti_assert(sourceid < gasneti_nodes); *srcindex = sourceid; return GASNET_OK; }
/* 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; }