1
1
openmpi/orte/mca/soh/base/soh_base_open.c
Jeff Squyres cce0950df7 - change a bunch of OMPI_* constants or ORTE_* equivalents
- change the framework opens to [mostly] use the new MCA param API
- properly pass in framework debug output streams to the
  mca_base_component_open() function

This commit was SVN r6888.
2005-08-15 18:25:35 +00:00

136 строки
3.9 KiB
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 "orte_config.h"
#include "include/orte_constants.h"
#include "dps/dps.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/base/mca_base_param.h"
#include "mca/errmgr/errmgr.h"
#include "opal/util/output.h"
#include "util/proc_info.h"
#include "mca/oob/base/base.h"
#include "mca/soh/base/base.h"
#include "stdio.h" /* just for gef debug */
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "orte/mca/soh/base/static-components.h"
/*
* globals
*/
/*
* Global variables
*/
orte_soh_base_t orte_soh_base;
orte_soh_base_module_t orte_soh = {
orte_soh_base_get_proc_soh,
orte_soh_base_set_proc_soh,
orte_soh_base_get_node_soh_not_available,
orte_soh_base_set_node_soh_not_available,
orte_soh_base_get_job_soh,
orte_soh_base_set_job_soh,
orte_soh_base_begin_monitoring_not_available,
orte_soh_base_module_finalize_not_available
};
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int orte_soh_base_open(void)
{
int param, value, rc;
orte_data_type_t tmp;
/* fprintf(stderr,"orte_soh_base_open:enter\n"); */
/* setup output for debug messages */
orte_soh_base.soh_output = opal_output_open(NULL);
param = mca_base_param_reg_int_name("soh_base", "verbose",
"Verbosity level for the soh framework",
false, false, 0, &value);
if (value != 0) {
orte_soh_base.soh_output = opal_output_open(NULL);
} else {
orte_soh_base.soh_output = -1;
}
/* register the base system types with the DPS */
tmp = ORTE_NODE_STATE;
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_soh_base_pack_node_state,
orte_soh_base_unpack_node_state,
"ORTE_NODE_STATE", &tmp))) {
ORTE_ERROR_LOG(rc);
return rc;
}
tmp = ORTE_PROC_STATE;
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_soh_base_pack_proc_state,
orte_soh_base_unpack_proc_state,
"ORTE_PROC_STATE", &tmp))) {
ORTE_ERROR_LOG(rc);
return rc;
}
tmp = ORTE_JOB_STATE;
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_soh_base_pack_job_state,
orte_soh_base_unpack_job_state,
"ORTE_JOB_STATE", &tmp))) {
ORTE_ERROR_LOG(rc);
return rc;
}
tmp = ORTE_EXIT_CODE;
if (ORTE_SUCCESS != (rc = orte_dps.register_type(orte_soh_base_pack_exit_code,
orte_soh_base_unpack_exit_code,
"ORTE_EXIT_CODE", &tmp))) {
ORTE_ERROR_LOG(rc);
return rc;
}
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("soh", orte_soh_base.soh_output,
mca_soh_base_static_components,
&orte_soh_base.soh_components, true)) {
return ORTE_ERROR;
}
/* All done */
return ORTE_SUCCESS;
}