2005-06-17 21:12:50 +00:00
|
|
|
/*
|
2005-11-05 19:57:48 +00: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.
|
2005-06-17 21:12:50 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
2005-08-08 22:17:22 +00:00
|
|
|
/**
|
|
|
|
* @file:
|
|
|
|
* Takes care of the component stuff for the MCA.
|
|
|
|
*/
|
2005-07-13 19:46:55 +00:00
|
|
|
#include "orte_config.h"
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/orte_constants.h"
|
2006-09-14 21:29:51 +00:00
|
|
|
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
|
2005-07-13 19:46:55 +00:00
|
|
|
#include "orte/util/proc_info.h"
|
2006-09-14 21:29:51 +00:00
|
|
|
|
|
|
|
#include "orte/mca/odls/odls.h"
|
|
|
|
#include "odls_bproc.h"
|
|
|
|
|
|
|
|
/* instance the child list object */
|
|
|
|
static void odls_bproc_child_constructor(odls_bproc_child_t *ptr)
|
|
|
|
{
|
|
|
|
ptr->name = NULL;
|
|
|
|
ptr->app_idx = -1;
|
|
|
|
ptr->alive = false;
|
|
|
|
}
|
|
|
|
static void odls_bproc_child_destructor(odls_bproc_child_t *ptr)
|
|
|
|
{
|
|
|
|
if (NULL != ptr->name) free(ptr->name);
|
|
|
|
}
|
|
|
|
OBJ_CLASS_INSTANCE(odls_bproc_child_t,
|
|
|
|
opal_list_item_t,
|
|
|
|
odls_bproc_child_constructor,
|
|
|
|
odls_bproc_child_destructor);
|
2005-06-17 21:12:50 +00:00
|
|
|
|
2005-08-08 22:17:22 +00:00
|
|
|
/**
|
2006-09-14 21:29:51 +00:00
|
|
|
* The bproc component data structure used to store all the relevent data
|
2005-08-08 22:17:22 +00:00
|
|
|
* about this component.
|
2005-06-17 21:12:50 +00:00
|
|
|
*/
|
2006-09-14 21:29:51 +00:00
|
|
|
orte_odls_bproc_component_t mca_odls_bproc_component = {
|
2005-06-17 21:12:50 +00:00
|
|
|
{
|
|
|
|
/* First, the mca_component_t struct containing meta information
|
|
|
|
about the component itself */
|
|
|
|
{
|
2006-09-14 21:29:51 +00:00
|
|
|
/* Indicate that we are a odls v1.3.0 component (which also
|
2005-06-17 21:12:50 +00:00
|
|
|
implies a specific MCA version) */
|
2006-09-14 21:29:51 +00:00
|
|
|
ORTE_ODLS_BASE_VERSION_1_3_0,
|
2005-06-17 21:12:50 +00:00
|
|
|
/* Component name and version */
|
2006-09-14 21:29:51 +00:00
|
|
|
"bproc",
|
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-04 20:12:36 +00:00
|
|
|
ORTE_MAJOR_VERSION,
|
|
|
|
ORTE_MINOR_VERSION,
|
|
|
|
ORTE_RELEASE_VERSION,
|
2005-06-17 21:12:50 +00:00
|
|
|
/* Component open and close functions */
|
2006-09-14 21:29:51 +00:00
|
|
|
orte_odls_bproc_component_open,
|
|
|
|
orte_odls_bproc_component_close
|
2005-06-17 21:12:50 +00:00
|
|
|
},
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
|
|
{
|
|
|
|
/* Whether the component is checkpointable or not */
|
|
|
|
false
|
|
|
|
},
|
|
|
|
/* Initialization / querying functions */
|
2006-09-14 21:29:51 +00:00
|
|
|
orte_odls_bproc_init,
|
|
|
|
orte_odls_bproc_finalize
|
2005-06-17 21:12:50 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2005-08-08 22:17:22 +00:00
|
|
|
* Opens the pls_bproc component, setting all the needed mca parameters and
|
|
|
|
* finishes setting up the component struct.
|
2005-06-17 21:12:50 +00:00
|
|
|
*/
|
2006-09-14 21:29:51 +00:00
|
|
|
int orte_odls_bproc_component_open(void)
|
2005-06-17 21:12:50 +00:00
|
|
|
{
|
|
|
|
/* initialize globals */
|
2006-09-14 21:29:51 +00:00
|
|
|
OBJ_CONSTRUCT(&mca_odls_bproc_component.lock, opal_mutex_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_odls_bproc_component.cond, opal_condition_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_odls_bproc_component.children, opal_list_t);
|
2005-06-17 21:12:50 +00:00
|
|
|
|
|
|
|
/* lookup parameters */
|
2006-09-14 21:29:51 +00:00
|
|
|
mca_base_param_reg_int(&mca_odls_bproc_component.super.version,
|
2005-08-02 22:22:55 +00:00
|
|
|
"priority", NULL, false, false, 100,
|
2006-09-14 21:29:51 +00:00
|
|
|
&mca_odls_bproc_component.priority);
|
|
|
|
mca_base_param_reg_int(&mca_odls_bproc_component.super.version,
|
2005-08-02 22:22:55 +00:00
|
|
|
"debug", "If > 0 prints library debugging information",
|
2006-09-14 21:29:51 +00:00
|
|
|
false, false, 0, &mca_odls_bproc_component.debug);
|
2005-06-17 21:12:50 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2005-08-08 22:17:22 +00:00
|
|
|
* Initializes the module. We do not want to run unless we are not the seed,
|
|
|
|
* bproc is running, and we are not on the master node.
|
2005-06-17 21:12:50 +00:00
|
|
|
*/
|
2006-09-14 21:29:51 +00:00
|
|
|
orte_odls_base_module_t *orte_odls_bproc_init(int *priority)
|
2005-06-17 21:12:50 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
struct bproc_version_t version;
|
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
/* the base open/select logic protects us against operation when
|
|
|
|
* we are NOT in a daemon, so we don't have to check that here
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* check to see if BProc is running here */
|
2005-06-17 21:12:50 +00:00
|
|
|
ret = bproc_version(&version);
|
|
|
|
if (ret != 0) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only launch if we are not the master node */
|
|
|
|
if (bproc_currnode() == BPROC_NODE_MASTER) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
*priority = mca_odls_bproc_component.priority;
|
|
|
|
return &orte_odls_bproc_module;
|
2005-06-17 21:12:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component close function.
|
|
|
|
*/
|
2006-09-14 21:29:51 +00:00
|
|
|
int orte_odls_bproc_component_close(void)
|
2005-06-17 21:12:50 +00:00
|
|
|
{
|
2006-09-14 21:29:51 +00:00
|
|
|
OBJ_DESTRUCT(&mca_odls_bproc_component.lock);
|
|
|
|
OBJ_DESTRUCT(&mca_odls_bproc_component.cond);
|
|
|
|
OBJ_DESTRUCT(&mca_odls_bproc_component.children);
|
2005-06-17 21:12:50 +00:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|