static int psmx2_domain_close(fid_t fid) { struct psmx2_fid_domain *domain; domain = container_of(fid, struct psmx2_fid_domain, util_domain.domain_fid.fid); FI_INFO(&psmx2_prov, FI_LOG_DOMAIN, "refcnt=%d\n", ofi_atomic_get32(&domain->util_domain.ref)); psmx2_domain_release(domain); if (ofi_domain_close(&domain->util_domain)) return 0; if (domain->progress_thread_enabled) psmx2_domain_stop_progress(domain); fastlock_destroy(&domain->sep_lock); fastlock_destroy(&domain->vl_lock); rbtDelete(domain->mr_map); fastlock_destroy(&domain->mr_lock); psmx2_trx_ctxt_free(domain->base_trx_ctxt); domain->fabric->active_domain = NULL; free(domain); psmx2_atomic_global_fini(); psmx2_am_global_fini(); return 0; }
static int psmx2_fabric_close(fid_t fid) { struct psmx2_fid_fabric *fabric; fabric = container_of(fid, struct psmx2_fid_fabric, util_fabric.fabric_fid.fid); psmx2_fabric_release(fabric); FI_INFO(&psmx2_prov, FI_LOG_CORE, "refcnt=%d\n", ofi_atomic_get32(&fabric->util_fabric.ref)); if (ofi_fabric_close(&fabric->util_fabric)) return 0; if (psmx2_env.name_server) ofi_ns_stop_server(&fabric->name_server); fastlock_destroy(&fabric->domain_lock); assert(fabric == psmx2_active_fabric); psmx2_active_fabric = NULL; free(fabric); psmx2_atomic_global_fini(); return 0; }