btl/ugni: fix memory leaks and silence some warnings
The smsg_mboxes free list was not getting destructed. The construct has been moved to module initialization and a matching destruct is now in the module destruct. This commit was SVN r31746.
Этот коммит содержится в:
родитель
9c45e4152d
Коммит
dd8de4d6eb
@ -37,7 +37,7 @@ int mca_btl_ugni_add_procs(struct mca_btl_base_module_t* btl,
|
||||
int rc;
|
||||
|
||||
if (false == ugni_module->initialized) {
|
||||
(void) ompi_proc_world (&ntotal_procs);
|
||||
ntotal_procs = ompi_comm_size ((ompi_communicator_t *) MPI_COMM_WORLD);
|
||||
|
||||
rc = opal_pointer_array_init (&ugni_module->endpoints, ntotal_procs, 1 << 24, 512);
|
||||
if (OPAL_SUCCESS != rc) {
|
||||
@ -78,7 +78,7 @@ int mca_btl_ugni_add_procs(struct mca_btl_base_module_t* btl,
|
||||
}
|
||||
|
||||
/* Add this endpoint to the pointer array. */
|
||||
BTL_VERBOSE(("initialized uGNI endpoint for proc id: 0x%" PRIx64 " ptr: %p", proc_id, peers[i]));
|
||||
BTL_VERBOSE(("initialized uGNI endpoint for proc id: 0x%" PRIx64 " ptr: %p", proc_id, (void *) peers[i]));
|
||||
opal_hash_table_set_value_uint64 (&ugni_module->id_to_endpoint, proc_id, peers[i]);
|
||||
|
||||
/* Set the reachable bit */
|
||||
@ -151,7 +151,7 @@ int mca_btl_ugni_del_procs (struct mca_btl_base_module_t *btl,
|
||||
/* lookup this proc in the hash table */
|
||||
(void) opal_hash_table_get_value_uint64 (&ugni_module->id_to_endpoint, proc_id, (void **) &ep);
|
||||
|
||||
BTL_VERBOSE(("deleting endpoint with proc id 0x%" PRIx64 ", ptr: %p", proc_id, ep));
|
||||
BTL_VERBOSE(("deleting endpoint with proc id 0x%" PRIx64 ", ptr: %p", proc_id, (void *) ep));
|
||||
|
||||
if (NULL != ep) {
|
||||
mca_btl_ugni_release_ep (ep);
|
||||
@ -350,8 +350,6 @@ mca_btl_ugni_setup_mpools (mca_btl_ugni_module_t *ugni_module)
|
||||
return rc;
|
||||
}
|
||||
|
||||
OBJ_CONSTRUCT(&ugni_module->smsg_mboxes, ompi_free_list_t);
|
||||
|
||||
if (0 == mca_btl_ugni_component.mbox_increment) {
|
||||
/* limit mailbox allocations to either 12.5% of available registrations
|
||||
or 2MiB per allocation */
|
||||
|
@ -255,6 +255,11 @@ btl_ugni_component_close(void)
|
||||
{
|
||||
ompi_common_ugni_fini ();
|
||||
|
||||
if (mca_btl_ugni_component.modules) {
|
||||
free (mca_btl_ugni_component.modules);
|
||||
mca_btl_ugni_component.modules = NULL;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -394,11 +399,11 @@ mca_btl_ugni_progress_datagram (mca_btl_ugni_module_t *ugni_module)
|
||||
/* check if the endpoint is known */
|
||||
if (OPAL_UNLIKELY(OPAL_SUCCESS != rc || NULL == ep)) {
|
||||
BTL_ERROR(("received connection attempt from an unknown peer. rc: %d, ep: %p, id: 0x%" PRIx64,
|
||||
rc, ep, ugni_module->wc_remote_attr.proc_id));
|
||||
rc, (void *) ep, ugni_module->wc_remote_attr.proc_id));
|
||||
return OMPI_ERR_NOT_FOUND;
|
||||
}
|
||||
} else {
|
||||
BTL_VERBOSE(("directed datagram complete for endpoint %p", ep));
|
||||
BTL_VERBOSE(("directed datagram complete for endpoint %p", (void *) ep));
|
||||
}
|
||||
|
||||
/* should not have gotten a NULL endpoint */
|
||||
@ -406,7 +411,7 @@ mca_btl_ugni_progress_datagram (mca_btl_ugni_module_t *ugni_module)
|
||||
|
||||
BTL_VERBOSE(("got a datagram completion: id = %" PRIx64 ", state = %d, "
|
||||
"data = 0x%" PRIx64 ", ep = %p, remote id: %d", datagram_id, post_state,
|
||||
data, ep, remote_id));
|
||||
data, (void *) ep, remote_id));
|
||||
|
||||
/* NTH: TODO -- error handling */
|
||||
(void) mca_btl_ugni_ep_connect_progress (ep);
|
||||
|
@ -83,6 +83,7 @@ mca_btl_ugni_module_init (mca_btl_ugni_module_t *ugni_module,
|
||||
OBJ_CONSTRUCT(&ugni_module->ep_wait_list, opal_list_t);
|
||||
OBJ_CONSTRUCT(&ugni_module->endpoints, opal_pointer_array_t);
|
||||
OBJ_CONSTRUCT(&ugni_module->id_to_endpoint, opal_hash_table_t);
|
||||
OBJ_CONSTRUCT(&ugni_module->smsg_mboxes, ompi_free_list_t);
|
||||
|
||||
ugni_module->device = dev;
|
||||
dev->btl_ctx = (void *) ugni_module;
|
||||
@ -123,13 +124,6 @@ mca_btl_ugni_module_finalize (struct mca_btl_base_module_t *btl)
|
||||
}
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&ugni_module->eager_frags_send);
|
||||
OBJ_DESTRUCT(&ugni_module->eager_frags_recv);
|
||||
OBJ_DESTRUCT(&ugni_module->smsg_frags);
|
||||
OBJ_DESTRUCT(&ugni_module->rdma_frags);
|
||||
OBJ_DESTRUCT(&ugni_module->rdma_int_frags);
|
||||
OBJ_DESTRUCT(&ugni_module->ep_wait_list);
|
||||
|
||||
/* close all open connections and release endpoints */
|
||||
if (ugni_module->initialized) {
|
||||
rc = opal_hash_table_get_first_key_uint64 (&ugni_module->id_to_endpoint, &key, (void **) &ep, &node);
|
||||
@ -182,6 +176,13 @@ mca_btl_ugni_module_finalize (struct mca_btl_base_module_t *btl)
|
||||
}
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&ugni_module->eager_frags_send);
|
||||
OBJ_DESTRUCT(&ugni_module->eager_frags_recv);
|
||||
OBJ_DESTRUCT(&ugni_module->smsg_frags);
|
||||
OBJ_DESTRUCT(&ugni_module->rdma_frags);
|
||||
OBJ_DESTRUCT(&ugni_module->rdma_int_frags);
|
||||
OBJ_DESTRUCT(&ugni_module->ep_wait_list);
|
||||
OBJ_DESTRUCT(&ugni_module->smsg_mboxes);
|
||||
OBJ_DESTRUCT(&ugni_module->pending_smsg_frags_bb);
|
||||
OBJ_DESTRUCT(&ugni_module->id_to_endpoint);
|
||||
OBJ_DESTRUCT(&ugni_module->endpoints);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user