2012-05-22 15:15:39 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2011-10-17 20:51:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
2012-05-22 15:15:39 +00:00
|
|
|
* Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2011-10-17 20:51:22 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2014-06-01 04:28:17 +00:00
|
|
|
#include "opal/runtime/opal_params.h"
|
2013-06-21 15:28:14 +00:00
|
|
|
#include "opal/mca/common/pmi/common_pmi.h"
|
2011-10-17 20:51:22 +00:00
|
|
|
|
2013-01-27 23:25:10 +00:00
|
|
|
#include "ompi/constants.h"
|
|
|
|
#include "ompi/mca/rte/rte.h"
|
2011-10-17 20:51:22 +00:00
|
|
|
|
|
|
|
#include "pubsub_pmi.h"
|
|
|
|
|
2013-03-27 21:09:41 +00:00
|
|
|
static int pubsub_pmi_component_register(void);
|
2011-10-17 20:51:22 +00:00
|
|
|
static int pubsub_pmi_component_open(void);
|
|
|
|
static int pubsub_pmi_component_close(void);
|
|
|
|
static int pubsub_pmi_component_query(mca_base_module_t **module, int *priority);
|
|
|
|
|
2011-11-01 16:25:12 +00:00
|
|
|
static int my_priority = 100; /* must be above "orte" component */
|
2011-10-23 15:57:13 +00:00
|
|
|
|
2011-10-17 20:51:22 +00:00
|
|
|
ompi_pubsub_base_component_t mca_pubsub_pmi_component = {
|
|
|
|
{
|
|
|
|
OMPI_PUBSUB_BASE_VERSION_2_0_0,
|
|
|
|
|
|
|
|
"pmi", /* MCA component name */
|
|
|
|
OMPI_MAJOR_VERSION, /* MCA component major version */
|
|
|
|
OMPI_MINOR_VERSION, /* MCA component minor version */
|
|
|
|
OMPI_RELEASE_VERSION, /* MCA component release version */
|
|
|
|
pubsub_pmi_component_open, /* component open */
|
|
|
|
pubsub_pmi_component_close, /* component close */
|
2013-03-27 21:09:41 +00:00
|
|
|
pubsub_pmi_component_query, /* component query */
|
|
|
|
pubsub_pmi_component_register /* component register */
|
2011-10-17 20:51:22 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
/* This component is checkpoint ready */
|
|
|
|
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-03-27 21:09:41 +00:00
|
|
|
static int pubsub_pmi_component_register(void)
|
|
|
|
{
|
|
|
|
my_priority = 100;
|
|
|
|
(void) mca_base_component_var_register(&mca_pubsub_pmi_component.base_version,
|
|
|
|
"priority", "Priority of the pubsub pmi component",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&my_priority);
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
2011-10-17 20:51:22 +00:00
|
|
|
|
|
|
|
static int pubsub_pmi_component_open(void)
|
|
|
|
{
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int pubsub_pmi_component_close(void)
|
|
|
|
{
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2011-10-21 04:54:38 +00:00
|
|
|
static int pubsub_pmi_component_query(mca_base_module_t **module, int *priority)
|
|
|
|
{
|
2013-12-25 19:12:43 +00:00
|
|
|
/* if we are indirectly launched via orted, the
|
|
|
|
* selection will have been turned "off" for us
|
|
|
|
*/
|
2014-06-01 04:28:17 +00:00
|
|
|
int rc = mca_common_pmi_init (opal_pmi_version);
|
|
|
|
|
|
|
|
if ( OPAL_SUCCESS == rc ) {
|
2013-06-21 15:28:14 +00:00
|
|
|
*priority = my_priority;
|
|
|
|
*module = (mca_base_module_t *)&ompi_pubsub_pmi_module;
|
|
|
|
return OMPI_SUCCESS;
|
2013-01-27 23:25:10 +00:00
|
|
|
}
|
2011-10-17 20:51:22 +00:00
|
|
|
|
|
|
|
/* we can't run */
|
|
|
|
*priority = -1;
|
|
|
|
*module = NULL;
|
2011-10-19 14:14:58 +00:00
|
|
|
return OMPI_ERROR;
|
2011-10-17 20:51:22 +00:00
|
|
|
}
|