void pmixp_dmdx_timeout_cleanup(void) { ListIterator it = list_iterator_create(_dmdx_requests); dmdx_req_info_t *req = NULL; time_t ts = time(NULL); /* run through all requests and discard stale one's */ while (NULL != (req = list_next(it))) { if ((ts - req->ts) > pmixp_info_timeout()) { #ifndef NDEBUG /* respond with the timeout to libpmix */ char *host = pmixp_nspace_resolve(req->nspace, req->rank); xassert(NULL != host); PMIXP_ERROR("timeout: ns=%s, rank=%d," " host=%s, ts=%lu", req->nspace, req->rank, (NULL != host) ? host : "unknown", ts); if (NULL != host) { free(host); } #endif req->cbfunc(PMIX_ERR_TIMEOUT, NULL, 0, req->cbdata, NULL, NULL); /* release tracker & list iterator */ list_delete_item(it); } } list_iterator_destroy(it); }
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_reset_if_to(pmixp_coll_t *coll, time_t ts) { /* lock the */ slurm_mutex_lock(&coll->lock); if (PMIXP_COLL_SYNC == coll->state) { goto unlock; } if (ts - coll->ts > pmixp_info_timeout()) { /* respond to the libpmix */ if (coll->contrib_local && coll->cbfunc) { /* Call the callback only if: * - we were asked to do that (coll->cbfunc != NULL); * - local contribution was received. * TODO: we may want to mark this event to respond with * to the next local request immediately and with the * proper (status == PMIX_ERR_TIMEOUT) */ coll->cbfunc(PMIX_ERR_TIMEOUT, NULL, 0, coll->cbdata, NULL, NULL); } /* drop the collective */ _reset_coll(coll); /* report the timeout event */ PMIXP_ERROR("Collective timeout!"); } unlock: /* unlock the structure */ slurm_mutex_unlock(&coll->lock); }
void pmixp_coll_reset_if_to(pmixp_coll_t *coll, time_t ts) { /* lock the */ slurm_mutex_lock(&coll->lock); if (PMIXP_COLL_SYNC == coll->state) { goto unlock; } if (ts - coll->ts > pmixp_info_timeout()) { /* respond to the libpmix */ coll->cbfunc(PMIX_ERR_TIMEOUT, NULL, 0, coll->cbdata, NULL, NULL); /* drop the collective */ _reset_coll(coll); /* report the timeout event */ PMIXP_ERROR("Collective timeout!"); } unlock: /* unlock the structure */ slurm_mutex_unlock(&coll->lock); }