Esempio n. 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);
}
Esempio n. 2
0
int MPI_Keyval_free(int *keyval)
{
    int ret;

    /* Check for valid key pointer */
    if (MPI_PARAM_CHECK) {
        if (NULL == keyval) {
            return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_KEYVAL,
                                          FUNC_NAME);
        }
    }

    ret = ompi_attr_free_keyval(COMM_ATTR, keyval, 0);
    OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD, MPI_ERR_OTHER, FUNC_NAME);
}
int MPI_Type_free_keyval(int *type_keyval)
{
    int ret;

    /* Check for valid key pointer */

    if (MPI_PARAM_CHECK) {
        OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
        if (NULL == type_keyval) {
            return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD,
                                          MPI_ERR_ARG, 
                                          FUNC_NAME);
        }
    }

    OPAL_CR_ENTER_LIBRARY();

    ret = ompi_attr_free_keyval(TYPE_ATTR, type_keyval, 0);

    OMPI_ERRHANDLER_RETURN(ret, MPI_COMM_WORLD,
			  MPI_ERR_OTHER, FUNC_NAME);
}
static int free_win(int keyval)
{
  int key = keyval;
  return ompi_attr_free_keyval (WIN_ATTR, &key, true);
}
static int free_comm(int keyval)
{
  int key = keyval;
  return ompi_attr_free_keyval (COMM_ATTR, &key, true);
}