Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion ompi/mca/coll/base/coll_base_comm_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* reserved.
* Copyright (c) 2014 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -52,6 +53,7 @@ struct avail_coll_t {

int ac_priority;
mca_coll_base_module_2_1_0_t *ac_module;
const char * ac_component_name;
};
typedef struct avail_coll_t avail_coll_t;

Expand Down Expand Up @@ -110,7 +112,7 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
int ret;

/* Announce */
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
opal_output_verbose(9, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: new communicator: %s (cid %d)",
comm->c_name, comm->c_contextid);

Expand Down Expand Up @@ -143,6 +145,12 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)

/* initialize the module */
ret = avail->ac_module->coll_module_enable(avail->ac_module, comm);

opal_output_verbose(9, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: selecting %10s, priority %3d, %s",
avail->ac_component_name, avail->ac_priority,
(OMPI_SUCCESS == ret ? "Enabled": "Disabled") );

if (OMPI_SUCCESS == ret) {

/* copy over any of the pointers */
Expand Down Expand Up @@ -295,9 +303,23 @@ static opal_list_t *check_components(opal_list_t * components,
avail = OBJ_NEW(avail_coll_t);
avail->ac_priority = priority;
avail->ac_module = module;
// Point to the string so we don't have to free later
avail->ac_component_name = component->mca_component_name;

opal_list_append(selectable, &avail->super);
}
else {
opal_output_verbose(10, ompi_coll_base_framework.framework_output,
"coll:base:comm_select: component disqualified: %s (priority %d < 0)",
component->mca_component_name, priority );

// If the disqualified collective returned a module make sure we
// release it here, since it will become a leak otherwise.
if( NULL != module ) {
OBJ_RELEASE(module);
module = NULL;
}
}
}

/* If we didn't find any available components, return an error */
Expand Down
67 changes: 48 additions & 19 deletions ompi/mca/coll/hcoll/coll_hcoll_module.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
Copyright (c) 2011 Mellanox Technologies. All rights reserved.
Copyright (c) 2016 IBM Corporation. All rights reserved.
$COPYRIGHT$

Additional copyrights may follow
Expand Down Expand Up @@ -50,6 +51,32 @@ static void mca_coll_hcoll_module_clear(mca_coll_hcoll_module_t *hcoll_module)
hcoll_module->previous_iallgatherv = NULL;
hcoll_module->previous_igatherv = NULL;
hcoll_module->previous_ireduce = NULL;
hcoll_module->previous_ialltoall = NULL;
hcoll_module->previous_ialltoallv = NULL;

hcoll_module->previous_barrier_module = NULL;
hcoll_module->previous_bcast_module = NULL;
hcoll_module->previous_allreduce_module = NULL;
hcoll_module->previous_reduce_module = NULL;
hcoll_module->previous_allgather_module = NULL;
hcoll_module->previous_allgatherv_module = NULL;
hcoll_module->previous_gather_module = NULL;
hcoll_module->previous_gatherv_module = NULL;
hcoll_module->previous_alltoall_module = NULL;
hcoll_module->previous_alltoallv_module = NULL;
hcoll_module->previous_alltoallw_module = NULL;
hcoll_module->previous_reduce_scatter_module = NULL;
hcoll_module->previous_ibarrier_module = NULL;
hcoll_module->previous_ibcast_module = NULL;
hcoll_module->previous_iallreduce_module = NULL;
hcoll_module->previous_ireduce_module = NULL;
hcoll_module->previous_iallgather_module = NULL;
hcoll_module->previous_iallgatherv_module = NULL;
hcoll_module->previous_igatherv_module = NULL;
hcoll_module->previous_ialltoall_module = NULL;
hcoll_module->previous_ialltoallv_module = NULL;


}

static void mca_coll_hcoll_module_construct(mca_coll_hcoll_module_t *hcoll_module)
Expand All @@ -63,6 +90,8 @@ void mca_coll_hcoll_mem_release_cb(void *buf, size_t length,
hcoll_mem_unmap(buf, length, cbdata, from_alloc);
}

#define OBJ_RELEASE_IF_NOT_NULL( obj ) if( NULL != (obj) ) OBJ_RELEASE( obj );

static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module)
{
int context_destroyed;
Expand All @@ -79,25 +108,25 @@ static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module
destroy hcoll context*/

if (hcoll_module->hcoll_context != NULL){
OBJ_RELEASE(hcoll_module->previous_barrier_module);
OBJ_RELEASE(hcoll_module->previous_bcast_module);
OBJ_RELEASE(hcoll_module->previous_allreduce_module);
OBJ_RELEASE(hcoll_module->previous_allgather_module);
OBJ_RELEASE(hcoll_module->previous_allgatherv_module);
OBJ_RELEASE(hcoll_module->previous_gatherv_module);
OBJ_RELEASE(hcoll_module->previous_alltoall_module);
OBJ_RELEASE(hcoll_module->previous_alltoallv_module);
OBJ_RELEASE(hcoll_module->previous_reduce_module);

OBJ_RELEASE(hcoll_module->previous_ibarrier_module);
OBJ_RELEASE(hcoll_module->previous_ibcast_module);
OBJ_RELEASE(hcoll_module->previous_iallreduce_module);
OBJ_RELEASE(hcoll_module->previous_iallgather_module);
OBJ_RELEASE(hcoll_module->previous_iallgatherv_module);
OBJ_RELEASE(hcoll_module->previous_igatherv_module);
OBJ_RELEASE(hcoll_module->previous_ialltoall_module);
OBJ_RELEASE(hcoll_module->previous_ialltoallv_module);
OBJ_RELEASE(hcoll_module->previous_ireduce_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_barrier_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_bcast_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_allreduce_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_allgather_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_allgatherv_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_gatherv_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_alltoall_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_alltoallv_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_reduce_module);

OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ibarrier_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ibcast_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_iallreduce_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_iallgather_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_iallgatherv_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_igatherv_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ialltoall_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ialltoallv_module);
OBJ_RELEASE_IF_NOT_NULL(hcoll_module->previous_ireduce_module);

/*
OBJ_RELEASE(hcoll_module->previous_allgatherv_module);
Expand Down