示例#1
0
static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module)
{
    int context_destroyed;

    if (hcoll_module->comm == &ompi_mpi_comm_world.comm) {
        if (OMPI_SUCCESS != ompi_attr_free_keyval(COMM_ATTR, &hcoll_comm_attr_keyval, 0)) {
            HCOL_VERBOSE(1,"hcoll ompi_attr_free_keyval failed");
        }
    }

    /* If the hcoll_context is null then we are destroying the hcoll_module
       that didn't initialized fallback colls/modules.
       Then just clear and return. Otherwise release module pointers and
       destroy hcoll context*/

    if (hcoll_module->hcoll_context != NULL) {
        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);
        OBJ_RELEASE(hcoll_module->previous_gather_module);
        OBJ_RELEASE(hcoll_module->previous_gatherv_module);
        OBJ_RELEASE(hcoll_module->previous_alltoallw_module);
        OBJ_RELEASE(hcoll_module->previous_reduce_scatter_module);
        OBJ_RELEASE(hcoll_module->previous_reduce_module);
        */
#if !defined(HAVE_HCOLL_CONTEXT_FREE)
        context_destroyed = 0;
        hcoll_destroy_context(hcoll_module->hcoll_context,
                              (rte_grp_handle_t)hcoll_module->comm,
                              &context_destroyed);
#endif
    }
    mca_coll_hcoll_module_clear(hcoll_module);
}
static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module)
{
    OBJ_RELEASE(hcoll_module->previous_barrier_module);
    OBJ_RELEASE(hcoll_module->previous_bcast_module);
    OBJ_RELEASE(hcoll_module->previous_reduce_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_gather_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_alltoallw_module);
    OBJ_RELEASE(hcoll_module->previous_reduce_scatter_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);
    hcoll_destroy_context(hcoll_module->hcoll_context,
                          (rte_grp_handle_t) hcoll_module->comm);
    mca_coll_hcoll_module_clear(hcoll_module);
}
static void mca_coll_hcoll_module_construct(mca_coll_hcoll_module_t *hcoll_module)
{
    mca_coll_hcoll_module_clear(hcoll_module);
}
示例#4
0
static void mca_coll_hcoll_module_destruct(mca_coll_hcoll_module_t *hcoll_module)
{
    opal_list_item_t  *item, *item_next;
    opal_list_t *am;
    mca_coll_hcoll_module_t *module;
    ompi_communicator_t *comm;
    int context_destroyed;

    am = &mca_coll_hcoll_component.active_modules;

    if (hcoll_module->comm == &ompi_mpi_comm_world.comm){
        /* If we get here then we are detroying MPI_COMM_WORLD now. So,
         * it is safe to destory all the other communicators and corresponding
         * hcoll contexts that could still be on the "active_modules" list.
         */
        item = opal_list_get_first(am);
        while (item != opal_list_get_end(am)){
            item_next = opal_list_get_next(item);
            module = ((mca_coll_hcoll_module_list_item_wrapper_t *)item)->module;
            comm = module->comm;
            context_destroyed = 0;
            while(!context_destroyed){
                hcoll_destroy_context(module->hcoll_context,
                                      (rte_grp_handle_t)comm,
                                      &context_destroyed);
            }
            module->hcoll_context = NULL;
            OBJ_RELEASE(comm);
            opal_list_remove_item(am,item);
            OBJ_RELEASE(item);
            item = item_next;
        }

        /* Now destory the comm_world hcoll context as well */
        context_destroyed = 0;
        while(!context_destroyed){
            hcoll_destroy_context(hcoll_module->hcoll_context,
                                  (rte_grp_handle_t)hcoll_module->comm,
                                  &context_destroyed);
        }
    }

    OBJ_RELEASE(hcoll_module->previous_barrier_module);
    OBJ_RELEASE(hcoll_module->previous_bcast_module);
    OBJ_RELEASE(hcoll_module->previous_reduce_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_gather_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_alltoallw_module);
    OBJ_RELEASE(hcoll_module->previous_reduce_scatter_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);

    mca_coll_hcoll_module_clear(hcoll_module);
}