2015-04-18 18:36:05 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2004-10-12 18:19:29 +04:00
|
|
|
/*
|
2007-03-17 02:11:45 +03:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* 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.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* 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.
|
2008-07-29 02:40:57 +04:00
|
|
|
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
2015-04-18 18:36:05 +03:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-10-12 18:19:29 +04:00
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
* These symbols are in a file by themselves to provide nice linker
|
|
|
|
* semantics. Since linkers generally pull in symbols by object
|
|
|
|
* files, keeping these symbols as the only symbols in this file
|
|
|
|
* prevents utility programs such as "ompi_info" from having to import
|
|
|
|
* entire components just to query their version and parameters.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "mpi.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/mca/coll/coll.h"
|
2004-10-12 18:19:29 +04:00
|
|
|
#include "coll_demo.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Public string showing the coll ompi_demo component version number
|
|
|
|
*/
|
|
|
|
const char *mca_coll_demo_component_version_string =
|
Major simplifications to component versioning:
- After long discussions and ruminations on how we run components in
LAM/MPI, made the decision that, by default, all components included
in Open MPI will use the version number of their parent project
(i.e., OMPI or ORTE). They are certaint free to use a different
number, but this simplification makes the common cases easy:
- components are only released when the parent project is released
- it is easy (trivial?) to distinguish which version component goes
with with version of the parent project
- removed all autogen/configure code for templating the version .h
file in components
- made all ORTE components use ORTE_*_VERSION for version numbers
- made all OMPI components use OMPI_*_VERSION for version numbers
- removed all VERSION files from components
- configure now displays OPAL, ORTE, and OMPI version numbers
- ditto for ompi_info
- right now, faking it -- OPAL and ORTE and OMPI will always have the
same version number (i.e., they all come from the same top-level
VERSION file). But this paves the way for the Great Configure
Reorganization, where, among other things, each project will have
its own version number.
So all in all, we went from a boatload of version numbers to
[effectively] three. That's pretty good. :-)
This commit was SVN r6344.
2005-07-05 00:12:36 +04:00
|
|
|
"OMPI/MPI demo collective MCA component version " OMPI_VERSION;
|
2004-10-12 18:19:29 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Global variable
|
|
|
|
*/
|
2013-03-28 01:09:41 +04:00
|
|
|
int mca_coll_demo_priority = -1;
|
2004-10-12 18:19:29 +04:00
|
|
|
int mca_coll_demo_verbose = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Local function
|
|
|
|
*/
|
2013-03-28 01:09:41 +04:00
|
|
|
static int demo_register(void);
|
2004-10-12 18:19:29 +04:00
|
|
|
|
2005-01-30 21:44:00 +03:00
|
|
|
|
2004-10-12 18:19:29 +04:00
|
|
|
/*
|
|
|
|
* Instantiate the public struct with all of our public information
|
|
|
|
* and pointers to our public functions in it
|
|
|
|
*/
|
|
|
|
|
2008-07-29 02:40:57 +04:00
|
|
|
const mca_coll_base_component_2_0_0_t mca_coll_demo_component = {
|
2004-10-12 18:19:29 +04:00
|
|
|
|
2005-01-30 21:44:00 +03:00
|
|
|
/* First, the mca_component_t struct containing meta information
|
|
|
|
about the component itself */
|
2004-10-12 18:19:29 +04:00
|
|
|
|
2015-04-18 18:36:05 +03:00
|
|
|
.collm_version = {
|
2008-07-29 02:40:57 +04:00
|
|
|
MCA_COLL_BASE_VERSION_2_0_0,
|
2004-10-12 18:19:29 +04:00
|
|
|
|
2005-01-30 21:44:00 +03:00
|
|
|
/* Component name and version */
|
2015-04-18 18:36:05 +03:00
|
|
|
.mca_component_name = "demo",
|
|
|
|
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
|
|
|
|
OMPI_RELEASE_VERSION),
|
2004-10-12 18:19:29 +04:00
|
|
|
|
2005-01-30 21:44:00 +03:00
|
|
|
/* Component open and close functions */
|
2015-04-18 18:36:05 +03:00
|
|
|
.mca_register_component_params = demo_register,
|
2005-01-30 21:44:00 +03:00
|
|
|
},
|
2015-04-18 18:36:05 +03:00
|
|
|
.collm_data = {
|
2007-03-17 02:11:45 +03:00
|
|
|
/* The component is checkpoint ready */
|
|
|
|
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
2005-01-30 21:44:00 +03:00
|
|
|
},
|
2015-04-18 18:36:05 +03:00
|
|
|
|
2005-01-30 21:44:00 +03:00
|
|
|
/* Initialization / querying functions */
|
2015-04-18 18:36:05 +03:00
|
|
|
|
|
|
|
.collm_init_query = mca_coll_demo_init_query,
|
|
|
|
.collm_comm_query = mca_coll_demo_comm_query,
|
2004-10-12 18:19:29 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
static int demo_register(void)
|
2004-10-12 18:19:29 +04:00
|
|
|
{
|
2013-03-28 01:09:41 +04:00
|
|
|
mca_coll_demo_priority = 20;
|
|
|
|
(void) mca_base_component_var_register(&mca_coll_demo_component.collm_version, "priority",
|
|
|
|
NULL, MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&mca_coll_demo_priority);
|
|
|
|
mca_coll_demo_verbose = 0;
|
|
|
|
(void) mca_base_component_var_register(&mca_coll_demo_component.collm_version, "verbose",
|
|
|
|
NULL, MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&mca_coll_demo_verbose);
|
2004-10-12 18:19:29 +04:00
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2007-08-19 07:37:49 +04:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
mca_coll_demo_module_construct(mca_coll_demo_module_t *module)
|
|
|
|
{
|
|
|
|
memset(&module->underlying, 0, sizeof(mca_coll_base_comm_coll_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RELEASE(module, func) \
|
|
|
|
do { \
|
|
|
|
if (NULL != module->underlying.coll_ ## func ## _module) { \
|
|
|
|
OBJ_RELEASE(module->underlying.coll_ ## func ## _module); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
static void
|
|
|
|
mca_coll_demo_module_destruct(mca_coll_demo_module_t *module)
|
|
|
|
{
|
2015-06-24 06:59:57 +03:00
|
|
|
RELEASE(module, allgather);
|
|
|
|
RELEASE(module, allgatherv);
|
|
|
|
RELEASE(module, allreduce);
|
|
|
|
RELEASE(module, alltoall);
|
|
|
|
RELEASE(module, alltoallv);
|
|
|
|
RELEASE(module, alltoallw);
|
|
|
|
RELEASE(module, barrier);
|
|
|
|
RELEASE(module, bcast);
|
|
|
|
RELEASE(module, exscan);
|
|
|
|
RELEASE(module, gather);
|
|
|
|
RELEASE(module, gatherv);
|
|
|
|
RELEASE(module, reduce);
|
|
|
|
RELEASE(module, reduce_scatter);
|
|
|
|
RELEASE(module, scan);
|
|
|
|
RELEASE(module, scatter);
|
|
|
|
RELEASE(module, scatterv);
|
2007-08-19 07:37:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(mca_coll_demo_module_t,
|
2008-07-29 02:40:57 +04:00
|
|
|
mca_coll_base_module_t,
|
2007-08-19 07:37:49 +04:00
|
|
|
mca_coll_demo_module_construct,
|
|
|
|
mca_coll_demo_module_destruct);
|