void pmixp_coll_ring_reset_if_to(pmixp_coll_t *coll, time_t ts) { pmixp_coll_ring_ctx_t *coll_ctx; int i; /* lock the structure */ slurm_mutex_lock(&coll->lock); for (i = 0; i < PMIXP_COLL_RING_CTX_NUM; i++) { coll_ctx = &coll->state.ring.ctx_array[i]; if (!coll_ctx->in_use || (PMIXP_COLL_RING_SYNC == coll_ctx->state)) { continue; } if (ts - coll->ts > pmixp_info_timeout()) { /* respond to the libpmix */ if (coll_ctx->contrib_local && coll->cbfunc) { pmixp_lib_modex_invoke(coll->cbfunc, PMIXP_ERR_TIMEOUT, NULL, 0, coll->cbdata, NULL, NULL); } /* report the timeout event */ PMIXP_ERROR("%p: collective timeout seq=%d", coll, coll_ctx->seq); pmixp_coll_log(coll); /* drop the collective */ _reset_coll_ring(coll_ctx); } } /* unlock the structure */ slurm_mutex_unlock(&coll->lock); }
void pmixp_coll_free(pmixp_coll_t *coll) { pmixp_coll_sanity_check(coll); if (NULL != coll->pset.procs) { xfree(coll->pset.procs); } #ifdef PMIXP_COLL_DEBUG hostlist_destroy(coll->peers_hl); #endif /* check for collective in a not-SYNC state - something went wrong */ switch(coll->type) { case PMIXP_COLL_TYPE_FENCE_TREE: if (PMIXP_COLL_TREE_SYNC != coll->state.tree.state) pmixp_coll_log(coll); pmixp_coll_tree_free(&coll->state.tree); break; case PMIXP_COLL_TYPE_FENCE_RING: { int i, ctx_in_use = 0; for (i = 0; i < PMIXP_COLL_RING_CTX_NUM; i++) { pmixp_coll_ring_ctx_t *coll_ctx = &coll->state.ring.ctx_array[i]; if (coll_ctx->in_use) ctx_in_use++; } if (ctx_in_use) pmixp_coll_log(coll); pmixp_coll_ring_free(&coll->state.ring); break; } default: PMIXP_ERROR("Unknown coll type"); break; } xfree(coll); }