ba99409628
- 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.
122 строки
3.6 KiB
C
122 строки
3.6 KiB
C
/* -*- 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$
|
|
*
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "include/orte_constants.h"
|
|
#include "include/types.h"
|
|
#include "opal/class/opal_list.h"
|
|
#include "util/proc_info.h"
|
|
#include "mca/mca.h"
|
|
#include "mca/base/mca_base_param.h"
|
|
#include "mca/pls/base/base.h"
|
|
|
|
#include <sys/bproc.h>
|
|
#include "pls_bproc.h"
|
|
|
|
/*
|
|
* Struct of function pointers and all that to let us be initialized
|
|
*/
|
|
orte_pls_bproc_component_t mca_pls_bproc_component = {
|
|
{
|
|
{
|
|
ORTE_PLS_BASE_VERSION_1_0_0,
|
|
|
|
"bproc", /* MCA component name */
|
|
ORTE_MAJOR_VERSION, /* MCA component major version */
|
|
ORTE_MINOR_VERSION, /* MCA component minor version */
|
|
ORTE_RELEASE_VERSION, /* MCA component release version */
|
|
orte_pls_bproc_component_open, /* component open */
|
|
orte_pls_bproc_component_close /* component close */
|
|
},
|
|
{
|
|
false /* checkpoint / restart */
|
|
},
|
|
orte_pls_bproc_init /* component init */
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Convience functions to lookup MCA parameter values.
|
|
*/
|
|
static int orte_pls_bproc_param_register_int(const char* param_name,
|
|
int default_value) {
|
|
int id = mca_base_param_register_int("pls", "bproc", param_name, NULL,
|
|
default_value);
|
|
int param_value = default_value;
|
|
mca_base_param_lookup_int(id, ¶m_value);
|
|
return param_value;
|
|
}
|
|
|
|
static char* orte_pls_bproc_param_register_string(const char* param_name,
|
|
const char* default_value) {
|
|
char *param_value;
|
|
int id = mca_base_param_register_string("pls", "bproc", param_name, NULL,
|
|
default_value);
|
|
mca_base_param_lookup_string(id, ¶m_value);
|
|
return param_value;
|
|
}
|
|
|
|
int orte_pls_bproc_component_open(void) {
|
|
/* init parameters */
|
|
mca_pls_bproc_component.debug = orte_pls_bproc_param_register_int("debug", 0);
|
|
mca_pls_bproc_component.priority =
|
|
orte_pls_bproc_param_register_int("priority", 100);
|
|
mca_pls_bproc_component.orted =
|
|
orte_pls_bproc_param_register_string("orted", "orted");
|
|
mca_pls_bproc_component.terminate_sig =
|
|
orte_pls_bproc_param_register_int("terminate_sig", 9);
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
}
|
|
|
|
|
|
int orte_pls_bproc_component_close(void) {
|
|
return ORTE_SUCCESS;
|
|
}
|
|
|
|
/**
|
|
* initializes the component. We do not want to run unless we are the seed, bproc
|
|
* is running, and we are the master node
|
|
*/
|
|
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;
|
|
}
|
|
|