int mca_spml_ikrit_fence(void) { mxm_peer_t *peer; opal_list_item_t *item; SPML_VERBOSE(20, "Into fence with %d active puts on %d pes", mca_spml_ikrit.n_active_puts, (int)opal_list_get_size(&mca_spml_ikrit.active_peers)); /* puts(unless are send sync) are completed by remote side lazily. That is either when remote decides to * ack window which can take hundreds of ms. So speed things up by doing fence */ while (NULL != (item = opal_list_remove_first(&mca_spml_ikrit.active_peers))) { peer = (mxm_peer_t *) item; peer->n_active_puts = 0; peer->need_fence = 0; mca_spml_ikrit_mxm_fence(peer->pe); } while (0 < mca_spml_ikrit.n_mxm_fences) { oshmem_request_wait_any_completion(); } SPML_VERBOSE(20, "fence completed"); return OSHMEM_SUCCESS; }
int mca_spml_yoda_fence(void) { while (0 < mca_spml_yoda.n_active_puts) { oshmem_request_wait_any_completion(); } return OSHMEM_SUCCESS; }
static int mca_spml_yoda_fence_internal(int puts_wait) { int n_puts_wait; /* Waiting for certain number of puts : 'puts_wait' * if 'puts_wait' == 0 waiting for all puts ('n_active_puts') * if 'puts_wait' > 'n_active_puts' waiting for 'n_active_puts' */ n_puts_wait = puts_wait > 0 ? mca_spml_yoda.n_active_puts - puts_wait : 0; if (n_puts_wait < 0) { n_puts_wait = 0; } while (n_puts_wait < mca_spml_yoda.n_active_puts) { oshmem_request_wait_any_completion(); } return OSHMEM_SUCCESS; }