2004-01-12 00:31:52 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. 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-01-12 00:31:52 +03:00
|
|
|
* $HEADER$
|
2004-06-29 04:02:25 +04:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file
|
|
|
|
* MCA coll base framework public interface functions.
|
|
|
|
*
|
|
|
|
* These functions are normally invoked by the back-ends of:
|
|
|
|
*
|
|
|
|
* - The back-ends of MPI_Init() and MPI_Finalize()
|
|
|
|
* - Communuicactor constructors (e.g., MPI_Comm_split()) and
|
|
|
|
* destructors (e.g., MPI_Comm_free())
|
|
|
|
* - The laminfo command
|
2004-01-12 00:31:52 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MCA_COLL_BASE_H
|
|
|
|
#define MCA_COLL_BASE_H
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#include "ompi_config.h"
|
2004-01-12 00:31:52 +03:00
|
|
|
|
|
|
|
#include "mpi.h"
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2013-03-28 01:17:31 +04:00
|
|
|
#include "opal/mca/base/base.h"
|
2004-01-12 00:31:52 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Global functions for MCA overall collective open and close
|
|
|
|
*/
|
|
|
|
|
2007-05-16 19:46:52 +04:00
|
|
|
BEGIN_C_DECLS
|
2004-06-29 04:02:25 +04:00
|
|
|
|
2007-05-16 19:46:52 +04:00
|
|
|
/**
|
|
|
|
* Create list of available coll components.
|
|
|
|
*
|
|
|
|
* @param allow_multi_user_threads Will be set to true if any of the
|
|
|
|
* available components will allow multiple user threads
|
|
|
|
* @param have_hidden_threads Will be set to true if any of the
|
|
|
|
* available components have hidden threads.
|
|
|
|
*
|
|
|
|
* @retval OMPI_SUCCESS If one or more coll components are available.
|
|
|
|
* @retval OMPI_ERROR If no coll components are found to be available.
|
|
|
|
*
|
|
|
|
* This function is invoked during ompi_mpi_init() to query all
|
|
|
|
* successfully opened coll components and create a list of all
|
|
|
|
* available coll components.
|
|
|
|
*
|
2013-03-28 01:17:31 +04:00
|
|
|
* This function traverses the (internal global variable) framework components
|
|
|
|
* list and queries each component to see if it ever might want to run during
|
|
|
|
* this MPI process. If a component does not want to run it is closed and
|
|
|
|
* removed from the framework components list.
|
2007-05-16 19:46:52 +04:00
|
|
|
*/
|
|
|
|
int mca_coll_base_find_available(bool enable_progress_threads,
|
|
|
|
bool enable_mpi_threads);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Select an available component for a new communicator.
|
|
|
|
*
|
|
|
|
* @param comm Communicator that the component will be selected for.
|
|
|
|
* @param preferred The component that is preferred for this
|
|
|
|
* communicator (or NULL).
|
|
|
|
*
|
|
|
|
* @return OMPI_SUCCESS Upon success.
|
|
|
|
* @return OMPI_ERROR Upon failure.
|
|
|
|
*
|
|
|
|
* Note that the types of the parameters have "struct" in them
|
|
|
|
* (e.g., ompi_communicator_t" vs. a plain "ompi_communicator_t") to
|
|
|
|
* avoid an include file loop. All similar types (e.g., "struct
|
|
|
|
* ompi_communicator_t *", "ompi_communicator_t *", and "MPI_Comm")
|
|
|
|
* are all typedef'ed to be the same, so the fact that we use struct
|
|
|
|
* here in the prototype is ok.
|
|
|
|
*
|
|
|
|
* This function is invoked when a new communicator is created and a
|
|
|
|
* coll component needs to be selected for it. It should be invoked
|
|
|
|
* near the end of the communicator creation process such that
|
|
|
|
* almost everything else is functional on the communicator (e.g.,
|
|
|
|
* point-to-point communication).
|
|
|
|
*
|
|
|
|
* Note that new communicators may be created as a result of
|
|
|
|
* invoking this function. Specifically: this function is called in
|
|
|
|
* the depths of communicator creation, but during the execution of
|
|
|
|
* this function, new communicators may be created, and therefore
|
|
|
|
* communicator creation functions may be re-entered (albiet with
|
|
|
|
* different arguments).
|
|
|
|
*/
|
2007-08-19 07:37:49 +04:00
|
|
|
int mca_coll_base_comm_select(struct ompi_communicator_t *comm);
|
2007-05-16 19:46:52 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finalize a coll component on a specific communicator.
|
|
|
|
*
|
|
|
|
* @param comm The communicator that is being destroyed.
|
|
|
|
*
|
|
|
|
* @retval OMPI_SUCCESS Always.
|
|
|
|
*
|
|
|
|
* Note that the type of the parameter is only a "struct
|
|
|
|
* ompi_communicator_t" (vs. a plain "ompi_communicator_t") to avoid
|
|
|
|
* an include file loop. The types "struct ompi_communicator_t *",
|
|
|
|
* "ompi_communicator_t *", and "MPI_Comm" are all typedef'ed to be
|
|
|
|
* the same, so the fact that we use struct here in the prototype is
|
|
|
|
* ok.
|
|
|
|
*
|
|
|
|
* This function is invoked near the beginning of the destruction of
|
|
|
|
* a communicator. It finalizes the coll component associated with the
|
|
|
|
* communicator (e.g., allowing the component to clean up and free any
|
|
|
|
* resources allocated for that communicator). Note that similar to
|
|
|
|
* mca_coll_base_select(), as result of this function, other
|
|
|
|
* communicators may also be destroyed.
|
|
|
|
*/
|
|
|
|
int mca_coll_base_comm_unselect(struct ompi_communicator_t *comm);
|
|
|
|
|
2004-01-12 00:31:52 +03:00
|
|
|
/*
|
2004-01-30 06:53:03 +03:00
|
|
|
* Globals
|
2004-01-12 00:31:52 +03:00
|
|
|
*/
|
2013-03-28 01:17:31 +04:00
|
|
|
OMPI_DECLSPEC extern mca_base_framework_t ompi_coll_base_framework;
|
2004-06-29 04:02:25 +04:00
|
|
|
|
2007-05-16 19:46:52 +04:00
|
|
|
END_C_DECLS
|
2004-01-30 06:53:03 +03:00
|
|
|
#endif /* MCA_BASE_COLL_H */
|