1
1
openmpi/orte/mca/soh/base/soh_base_open.c
Jeff Squyres 1b18979f79 Initial population of orte tree
This commit was SVN r6266.
2005-07-02 13:42:54 +00:00

127 строки
3.5 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 "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 "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_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 = ompi_output_open(NULL);
param = mca_base_param_register_int("soh", "base", "verbose", NULL, 0);
mca_base_param_lookup_int(param, &value);
if (value != 0) {
orte_soh_base.soh_output = ompi_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_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", 0, mca_soh_base_static_components,
&orte_soh_base.soh_components, true)) {
/* fprintf(stderr,"orte_soh_base_open:failed\n"); */
return OMPI_ERROR;
}
/* All done */
/* fprintf(stderr,"orte_soh_base_open:success\n"); */
return OMPI_SUCCESS;
}