2005-06-17 21:12:50 +00:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
* 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"
|
2005-07-25 22:21:40 +00:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2005-07-13 19:46:55 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
2005-06-17 21:12:50 +00:00
|
|
|
#include "pls_bproc.h"
|
|
|
|
|
2005-08-08 22:17:22 +00:00
|
|
|
/**
|
|
|
|
* The bproc component data structure used to store all the relevent data about
|
|
|
|
* this component.
|
2005-06-17 21:12:50 +00:00
|
|
|
*/
|
|
|
|
orte_pls_bproc_component_t mca_pls_bproc_component = {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ORTE_PLS_BASE_VERSION_1_0_0,
|
|
|
|
"bproc", /* MCA component name */
|
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, /* MCA component major version */
|
|
|
|
ORTE_MINOR_VERSION, /* MCA component minor version */
|
|
|
|
ORTE_RELEASE_VERSION, /* MCA component release version */
|
2005-06-17 21:12:50 +00:00
|
|
|
orte_pls_bproc_component_open, /* component open */
|
|
|
|
orte_pls_bproc_component_close /* component close */
|
|
|
|
},
|
|
|
|
{
|
|
|
|
false /* checkpoint / restart */
|
|
|
|
},
|
|
|
|
orte_pls_bproc_init /* component init */
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
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
|
|
|
int orte_pls_bproc_component_open(void) {
|
2005-07-25 22:21:40 +00:00
|
|
|
int rc;
|
2005-06-17 21:12:50 +00:00
|
|
|
/* init parameters */
|
2005-08-08 22:17:22 +00:00
|
|
|
mca_base_component_t *c = &mca_pls_bproc_component.super.pls_version;
|
|
|
|
mca_base_param_reg_int(c, "priority", NULL, false, false, 100,
|
2005-08-02 22:22:55 +00:00
|
|
|
&mca_pls_bproc_component.priority);
|
2005-08-08 22:17:22 +00:00
|
|
|
mca_base_param_reg_int(c, "debug",
|
2005-08-02 22:22:55 +00:00
|
|
|
"If > 0 prints library debugging information",
|
|
|
|
false, false, 0, &mca_pls_bproc_component.debug);
|
2005-08-08 22:17:22 +00:00
|
|
|
mca_base_param_reg_int(c, "terminate_sig",
|
2005-08-02 22:22:55 +00:00
|
|
|
"Signal sent to processes to terminate them", false,
|
|
|
|
false, 9, &mca_pls_bproc_component.terminate_sig);
|
2005-08-08 22:17:22 +00:00
|
|
|
mca_base_param_reg_string(c, "orted", "Path to where orted is installed",
|
|
|
|
false, false, "orted", &mca_pls_bproc_component.orted);
|
|
|
|
mca_pls_bproc_component.num_procs = 0;
|
|
|
|
mca_pls_bproc_component.num_daemons = 0;
|
|
|
|
mca_pls_bproc_component.done_launching = false;
|
2005-07-13 19:46:55 +00:00
|
|
|
OBJ_CONSTRUCT(&mca_pls_bproc_component.lock, opal_mutex_t);
|
2005-07-21 19:53:04 +00:00
|
|
|
OBJ_CONSTRUCT(&mca_pls_bproc_component.condition, opal_condition_t);
|
2005-07-25 22:21:40 +00:00
|
|
|
/* init the list to hold the daemon names */
|
2005-07-26 22:12:03 +00:00
|
|
|
rc = orte_pointer_array_init(&mca_pls_bproc_component.daemon_names, 8, 200000, 8);
|
2005-07-25 22:21:40 +00:00
|
|
|
if(ORTE_SUCCESS != rc) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
}
|
2005-07-26 22:12:03 +00:00
|
|
|
return rc;
|
2005-06-17 21:12:50 +00:00
|
|
|
}
|
|
|
|
|
2005-08-08 22:17:22 +00:00
|
|
|
/**
|
|
|
|
* Closes the pls_bproc component
|
|
|
|
*/
|
2005-06-17 21:12:50 +00:00
|
|
|
int orte_pls_bproc_component_close(void) {
|
2005-07-13 19:46:55 +00:00
|
|
|
OBJ_DESTRUCT(&mca_pls_bproc_component.lock);
|
2005-07-21 19:53:04 +00:00
|
|
|
OBJ_DESTRUCT(&mca_pls_bproc_component.condition);
|
2005-07-25 22:21:40 +00:00
|
|
|
OBJ_RELEASE(mca_pls_bproc_component.daemon_names);
|
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 the seed, bproc
|
|
|
|
* is running, and we are the master node.
|
2005-06-17 21:12:50 +00:00
|
|
|
*/
|
|
|
|
orte_pls_base_module_t* orte_pls_bproc_init(int *priority) {
|
|
|
|
int ret;
|
|
|
|
struct bproc_version_t version;
|
|
|
|
|
|
|
|
/* are we the seed */
|
|
|
|
if(orte_process_info.seed == false)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* okay, we are in a daemon - now check to see if BProc is running here */
|
|
|
|
ret = bproc_version(&version);
|
|
|
|
if (ret != 0) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only launch from the master node */
|
|
|
|
if (bproc_currnode() != BPROC_NODE_MASTER) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*priority = mca_pls_bproc_component.priority;
|
|
|
|
return &orte_pls_bproc_module;
|
|
|
|
}
|
|
|
|
|