2004-06-29 04:02:25 +04:00
|
|
|
/*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-06-29 04:02:25 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2004-09-05 20:05:37 +04:00
|
|
|
#include "communicator/communicator.h"
|
2005-07-04 06:38:44 +04:00
|
|
|
#include "opal/util/show_help.h"
|
2004-06-29 04:02:25 +04:00
|
|
|
#include "mca/mca.h"
|
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/coll/coll.h"
|
|
|
|
#include "mca/coll/base/base.h"
|
|
|
|
|
2005-07-03 20:22:16 +04:00
|
|
|
extern opal_list_t mca_coll_base_available;
|
2004-06-29 04:02:25 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This function is called to shut down a collective module on a
|
|
|
|
* specific communicator. If we used some of the basic module
|
|
|
|
* functions in here to fill in NULL pointers, we also need to shut
|
|
|
|
* down the basic module.
|
|
|
|
*/
|
|
|
|
int mca_coll_base_comm_unselect(ompi_communicator_t *comm)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
|
|
|
|
/* Shut down the selected module. Note that this pointer can be
|
|
|
|
NULL if only the basic module was selected. */
|
|
|
|
|
|
|
|
if (NULL != comm->c_coll_selected_module &&
|
|
|
|
comm->c_coll_basic_module != comm->c_coll_selected_module &&
|
|
|
|
NULL != comm->c_coll_selected_module->coll_module_finalize) {
|
|
|
|
err = comm->c_coll_selected_module->coll_module_finalize(comm);
|
|
|
|
if (OMPI_SUCCESS != err) {
|
2005-07-04 06:38:44 +04:00
|
|
|
opal_show_help("help-mca-coll-base",
|
2004-09-05 20:05:37 +04:00
|
|
|
"comm-unselect:failed-finalize", true);
|
2004-06-29 04:02:25 +04:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If the basic module was used at all (even if it was just to fill
|
|
|
|
in NULL pointers for functions that the selected module did not
|
|
|
|
provide), it may have hung stuff on c_coll_comm_basic, and
|
|
|
|
therefore needs to be finalized in this scope. */
|
|
|
|
|
|
|
|
if (NULL != comm->c_coll_basic_module &&
|
|
|
|
NULL != comm->c_coll_basic_module->coll_module_finalize) {
|
|
|
|
err = comm->c_coll_basic_module->coll_module_finalize(comm);
|
|
|
|
if (OMPI_SUCCESS != err) {
|
2005-07-04 06:38:44 +04:00
|
|
|
opal_show_help("help-mca-coll-base",
|
2004-09-05 20:05:37 +04:00
|
|
|
"comm-unselect:basic-failed-finalize", true);
|
2004-06-29 04:02:25 +04:00
|
|
|
return err;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Zero them all out, since they act as sentinel values */
|
|
|
|
|
|
|
|
comm->c_coll_selected_data = NULL;
|
|
|
|
comm->c_coll_selected_module = NULL;
|
|
|
|
comm->c_coll_basic_data = NULL;
|
|
|
|
comm->c_coll_basic_module = NULL;
|
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|