2005-10-02 14:57:44 +00:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
2007-03-16 23:11:45 +00:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 19:57:48 +00: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.
|
2005-10-02 14:57:44 +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$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file:
|
|
|
|
* Takes care of the component stuff for the MCA.
|
|
|
|
*/
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
|
|
|
#include "pls_bproc.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The bproc component data structure used to store all the relevent data about
|
|
|
|
* this component.
|
|
|
|
*/
|
|
|
|
orte_pls_bproc_component_t mca_pls_bproc_component = {
|
|
|
|
{
|
|
|
|
{
|
2006-09-14 21:29:51 +00:00
|
|
|
ORTE_PLS_BASE_VERSION_1_3_0,
|
2005-10-02 14:57:44 +00:00
|
|
|
"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 */
|
|
|
|
},
|
|
|
|
{
|
2007-03-16 23:11:45 +00:00
|
|
|
/* The component is not checkpoint ready */
|
|
|
|
MCA_BASE_METADATA_PARAM_NONE
|
2005-10-02 14:57:44 +00:00
|
|
|
},
|
|
|
|
orte_pls_bproc_init /* component init */
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Opens the pls_bproc component, setting all the needed mca parameters and
|
|
|
|
* finishes setting up the component struct.
|
|
|
|
*/
|
|
|
|
int orte_pls_bproc_component_open(void) {
|
2006-12-15 02:34:14 +00:00
|
|
|
int rc;
|
2006-08-11 19:41:33 +00:00
|
|
|
|
2005-10-02 14:57:44 +00:00
|
|
|
/* init parameters */
|
|
|
|
mca_base_component_t *c = &mca_pls_bproc_component.super.pls_version;
|
|
|
|
mca_base_param_reg_int(c, "priority", NULL, false, false, 100,
|
|
|
|
&mca_pls_bproc_component.priority);
|
|
|
|
mca_base_param_reg_int(c, "debug",
|
|
|
|
"If > 0 prints library debugging information",
|
|
|
|
false, false, 0, &mca_pls_bproc_component.debug);
|
|
|
|
mca_base_param_reg_int(c, "terminate_sig",
|
|
|
|
"Signal sent to processes to terminate them", false,
|
|
|
|
false, 9, &mca_pls_bproc_component.terminate_sig);
|
|
|
|
mca_base_param_reg_string(c, "orted", "Path to where orted is installed",
|
|
|
|
false, false, "orted", &mca_pls_bproc_component.orted);
|
2006-12-15 02:34:14 +00:00
|
|
|
mca_base_param_reg_int(c, "nolaunch", NULL, false, false, (int)false,
|
|
|
|
&rc);
|
|
|
|
if ((int)false == rc) {
|
|
|
|
mca_pls_bproc_component.do_not_launch = false;
|
|
|
|
} else {
|
|
|
|
mca_pls_bproc_component.do_not_launch = true;
|
|
|
|
}
|
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
mca_pls_bproc_component.recv_issued = false;
|
2005-10-02 14:57:44 +00:00
|
|
|
OBJ_CONSTRUCT(&mca_pls_bproc_component.lock, opal_mutex_t);
|
|
|
|
OBJ_CONSTRUCT(&mca_pls_bproc_component.condition, opal_condition_t);
|
2006-08-11 19:41:33 +00:00
|
|
|
|
2006-12-15 02:34:14 +00:00
|
|
|
return ORTE_SUCCESS;
|
2005-10-02 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the pls_bproc component
|
|
|
|
*/
|
|
|
|
int orte_pls_bproc_component_close(void) {
|
|
|
|
OBJ_DESTRUCT(&mca_pls_bproc_component.lock);
|
|
|
|
OBJ_DESTRUCT(&mca_pls_bproc_component.condition);
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes the module. 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;
|
|
|
|
|
2006-09-14 21:29:51 +00:00
|
|
|
/* okay, we are in an HNP - now check to see if BProc is running here */
|
2006-12-15 14:01:21 +00:00
|
|
|
if (!mca_pls_bproc_component.do_not_launch) {
|
|
|
|
ret = bproc_version(&version);
|
|
|
|
if (ret != 0) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2005-10-02 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
}
|
|
|
|
|