From cce0950df7a089afe404321b5bc002bbf9ea9478 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 15 Aug 2005 18:25:35 +0000 Subject: [PATCH] - 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. --- orte/class/orte_proc_table.c | 16 ++++----- orte/dps/dps_load_unload.c | 2 +- orte/mca/errmgr/base/errmgr_base_open.c | 17 ++++----- orte/mca/gpr/base/gpr_base_open.c | 10 +++--- orte/mca/iof/base/iof_base_open.c | 12 ++++--- orte/mca/iof/base/iof_base_setup.c | 20 +++++------ orte/mca/ns/base/ns_base_local_fns.c | 2 +- orte/mca/ns/base/ns_base_open.c | 9 ++--- orte/mca/oob/base/oob_base_barrier.c | 5 +-- orte/mca/oob/base/oob_base_open.c | 17 +++++---- orte/mca/oob/base/oob_base_recv_nb.c | 5 +-- orte/mca/oob/base/oob_base_send.c | 3 +- orte/mca/oob/base/oob_base_send_nb.c | 4 +-- orte/mca/oob/base/oob_base_xcast.c | 2 +- orte/mca/pls/base/pls_base_open.c | 8 +++-- orte/mca/ras/base/ras_base_open.c | 10 +++--- orte/mca/rds/base/rds_base_open.c | 8 +++-- orte/mca/rmaps/base/rmaps_base_open.c | 8 +++-- orte/mca/rmaps/round_robin/rmaps_rr.c | 2 +- orte/mca/rmgr/base/rmgr_base_context.c | 2 +- orte/mca/rmgr/base/rmgr_base_open.c | 8 +++-- orte/mca/rml/base/rml_base_open.c | 15 +++++--- orte/mca/schema/base/schema_base_open.c | 9 ++--- orte/mca/sds/base/sds_base_open.c | 2 +- orte/mca/soh/base/soh_base_open.c | 21 ++++++----- orte/runtime/orte_monitor.c | 20 ++++++----- orte/runtime/orte_wait.c | 32 ++++++++--------- orte/util/session_dir.c | 48 ++++++++++++------------- 28 files changed, 174 insertions(+), 143 deletions(-) diff --git a/orte/class/orte_proc_table.c b/orte/class/orte_proc_table.c index 5ccaa7d7a9..ef28f13a2b 100644 --- a/orte/class/orte_proc_table.c +++ b/orte/class/orte_proc_table.c @@ -19,7 +19,7 @@ #include #include -#include "include/constants.h" +#include "orte/include/orte_constants.h" #include "opal/util/output.h" #include "orte/class/orte_proc_table.h" @@ -81,7 +81,7 @@ int orte_hash_table_set_proc( if(ht->ht_table_size == 0) { opal_output(0, "opal_hash_table_set_value_proc:" "opal_hash_table_init() has not been called"); - return OMPI_ERR_BAD_PARAM; + return ORTE_ERR_BAD_PARAM; } #endif for(node = (ompi_proc_hash_node_t*)opal_list_get_first(list); @@ -89,7 +89,7 @@ int orte_hash_table_set_proc( node = (ompi_proc_hash_node_t*)opal_list_get_next(node)) { if (memcmp(&node->hn_key,proc,sizeof(orte_process_name_t)) == 0) { node->hn_value = value; - return OMPI_SUCCESS; + return ORTE_SUCCESS; } } @@ -97,13 +97,13 @@ int orte_hash_table_set_proc( if(NULL == node) { node = OBJ_NEW(ompi_proc_hash_node_t); if(NULL == node) - return OMPI_ERR_OUT_OF_RESOURCE; + return ORTE_ERR_OUT_OF_RESOURCE; } node->hn_key = *proc; node->hn_value = value; opal_list_append(list, (opal_list_item_t*)node); ht->ht_size++; - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -119,7 +119,7 @@ int orte_hash_table_remove_proc( if(ht->ht_table_size == 0) { opal_output(0, "opal_hash_table_remove_value_proc:" "opal_hash_table_init() has not been called"); - return OMPI_ERR_BAD_PARAM; + return ORTE_ERR_BAD_PARAM; } #endif for(node = (ompi_proc_hash_node_t*)opal_list_get_first(list); @@ -129,9 +129,9 @@ int orte_hash_table_remove_proc( opal_list_remove_item(list, (opal_list_item_t*)node); opal_list_append(&ht->ht_nodes, (opal_list_item_t*)node); ht->ht_size--; - return OMPI_SUCCESS; + return ORTE_SUCCESS; } } - return OMPI_ERR_NOT_FOUND; + return ORTE_ERR_NOT_FOUND; } diff --git a/orte/dps/dps_load_unload.c b/orte/dps/dps_load_unload.c index f4bbec24bf..ef018f0575 100644 --- a/orte/dps/dps_load_unload.c +++ b/orte/dps/dps_load_unload.c @@ -65,7 +65,7 @@ int orte_dps_unload(orte_buffer_t *buffer, void **payload, /* All done */ - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/errmgr/base/errmgr_base_open.c b/orte/mca/errmgr/base/errmgr_base_open.c index 2e636e4b01..8a9cfcd026 100644 --- a/orte/mca/errmgr/base/errmgr_base_open.c +++ b/orte/mca/errmgr/base/errmgr_base_open.c @@ -67,9 +67,9 @@ int orte_errmgr_base_open(void) /* Debugging / verbose output */ - param = mca_base_param_register_int("errmgr", "base", "verbose", - NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("errmgr_base", "verbose", + "Verbosity level for the errmgr framework", + false, false, 0, &value); if (value != 0) { orte_errmgr_base_output = opal_output_open(NULL); } else { @@ -79,15 +79,16 @@ int orte_errmgr_base_open(void) /* Open up all available components */ if (ORTE_SUCCESS != - mca_base_components_open("errmgr", 0, mca_errmgr_base_static_components, - &orte_errmgr_base_components_available, true)) { + mca_base_components_open("errmgr", orte_errmgr_base_output, + mca_errmgr_base_static_components, + &orte_errmgr_base_components_available, true)) { return ORTE_ERROR; } orte_errmgr_initialized = true; } - /* All done */ - - return ORTE_SUCCESS; + /* All done */ + + return ORTE_SUCCESS; } diff --git a/orte/mca/gpr/base/gpr_base_open.c b/orte/mca/gpr/base/gpr_base_open.c index 00b2f981d5..e292f40123 100644 --- a/orte/mca/gpr/base/gpr_base_open.c +++ b/orte/mca/gpr/base/gpr_base_open.c @@ -313,9 +313,9 @@ int orte_gpr_base_open(void) /* Debugging / verbose output */ - param = mca_base_param_register_int("gpr", "base", "verbose", - NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("gpr_base", "verbose", + "Verbosity level for the gpr framework", + false, false, 0, &value); if (value != 0) { orte_gpr_base_output = opal_output_open(NULL); } else { @@ -432,7 +432,9 @@ int orte_gpr_base_open(void) /* Open up all available components */ if (OMPI_SUCCESS != - mca_base_components_open("gpr", 0, mca_gpr_base_static_components, + mca_base_components_open("gpr", + orte_gpr_base_output, + mca_gpr_base_static_components, &orte_gpr_base_components_available, true)) { return ORTE_ERROR; } diff --git a/orte/mca/iof/base/iof_base_open.c b/orte/mca/iof/base/iof_base_open.c index 92f63b6bc9..7599e53ec9 100644 --- a/orte/mca/iof/base/iof_base_open.c +++ b/orte/mca/iof/base/iof_base_open.c @@ -73,8 +73,9 @@ int orte_iof_base_open(void) /* Debugging / verbose output */ - id = mca_base_param_register_int("iof", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(id, &int_value); + id = mca_base_param_reg_int_name("iof_base", "verbose", + "Verbosity level for the iof framework", + false, false, 0, &int_value); if (int_value != 0) { orte_iof_base.iof_output = opal_output_open(NULL); } else { @@ -92,13 +93,14 @@ int orte_iof_base_open(void) /* Open up all available components */ if (OMPI_SUCCESS != - mca_base_components_open("iof", 0, mca_iof_base_static_components, + mca_base_components_open("iof", orte_iof_base.iof_output, + mca_iof_base_static_components, &orte_iof_base.iof_components_opened, true)) { - return OMPI_ERROR; + return ORTE_ERROR; } /* All done */ - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/iof/base/iof_base_setup.c b/orte/mca/iof/base/iof_base_setup.c index 588a67e3aa..10b899250c 100644 --- a/orte/mca/iof/base/iof_base_setup.c +++ b/orte/mca/iof/base/iof_base_setup.c @@ -102,7 +102,7 @@ orte_iof_base_setup_prefork(orte_iof_base_io_conf_t *opts) } #endif - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -123,17 +123,17 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts) /* disable echo */ struct termios term_attrs; if (tcgetattr(opts->p_stdout[1], &term_attrs) < 0) { - return OMPI_ERROR; + return ORTE_ERROR; } term_attrs.c_lflag &= ~ (ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | ECHONL); if (tcsetattr(opts->p_stdout[1], TCSANOW, &term_attrs) == -1) { - return OMPI_ERROR; + return ORTE_ERROR; } /* and connect the pty to stdin */ ret = dup2(opts->p_stdout[1], fileno(stdin)); - if (ret < 0) return OMPI_ERROR; + if (ret < 0) return ORTE_ERROR; #endif } else { int fd; @@ -145,18 +145,18 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts) } } ret = dup2(opts->p_stdout[1], fileno(stdout)); - if (ret < 0) return OMPI_ERROR; + if (ret < 0) return ORTE_ERROR; } else { if(opts->p_stdout[1] != fileno(stdout)) { ret = dup2(opts->p_stdout[1], fileno(stdout)); - if (ret < 0) return OMPI_ERROR; + if (ret < 0) return ORTE_ERROR; close(opts->p_stdout[1]); } if (opts->connect_stdin) { if(opts->p_stdin[0] != fileno(stdin)) { ret = dup2(opts->p_stdin[1], fileno(stdin)); - if (ret < 0) return OMPI_ERROR; + if (ret < 0) return ORTE_ERROR; close(opts->p_stdin[1]); } } else { @@ -173,11 +173,11 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts) } if(opts->p_stderr[1] != fileno(stderr)) { ret = dup2(opts->p_stderr[1], fileno(stderr)); - if (ret < 0) return OMPI_ERROR; + if (ret < 0) return ORTE_ERROR; close(opts->p_stderr[1]); } - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -223,5 +223,5 @@ orte_iof_base_setup_parent(const orte_process_name_t* name, return ret; } - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/ns/base/ns_base_local_fns.c b/orte/mca/ns/base/ns_base_local_fns.c index fe6840f364..118150fdfd 100644 --- a/orte/mca/ns/base/ns_base_local_fns.c +++ b/orte/mca/ns/base/ns_base_local_fns.c @@ -162,7 +162,7 @@ int orte_ns_base_assign_cellid_to_process(orte_process_name_t *name) } name->cellid = 0; - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/ns/base/ns_base_open.c b/orte/mca/ns/base/ns_base_open.c index 4bb3c6dc8b..8981375943 100644 --- a/orte/mca/ns/base/ns_base_open.c +++ b/orte/mca/ns/base/ns_base_open.c @@ -131,9 +131,9 @@ int orte_ns_base_open(void) /* Debugging / verbose output */ - param = mca_base_param_register_int("ns", "base", "verbose", - NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("ns_base", "verbose", + "Verbosity level for the ns framework", + false, false, 0, &value); if (value != 0) { mca_ns_base_output = opal_output_open(NULL); } else { @@ -176,7 +176,8 @@ int orte_ns_base_open(void) /* Open up all available components */ if (ORTE_SUCCESS != - mca_base_components_open("ns", 0, mca_ns_base_static_components, + mca_base_components_open("ns", mca_ns_base_output, + mca_ns_base_static_components, &mca_ns_base_components_available, true)) { return ORTE_ERROR; } diff --git a/orte/mca/oob/base/oob_base_barrier.c b/orte/mca/oob/base/oob_base_barrier.c index 6ed621e67e..45a9caa231 100644 --- a/orte/mca/oob/base/oob_base_barrier.c +++ b/orte/mca/oob/base/oob_base_barrier.c @@ -31,8 +31,9 @@ int mca_oob_barrier(void) int foo = 0; int rc = orte_ns.get_peers(&peers,&npeers,&self); - if(rc != OMPI_SUCCESS) + if(rc != ORTE_SUCCESS) { return rc; + } iov.iov_base = (void*)&foo; iov.iov_len = sizeof(foo); @@ -68,7 +69,7 @@ int mca_oob_barrier(void) } } } - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/oob/base/oob_base_open.c b/orte/mca/oob/base/oob_base_open.c index 2f05aa4cd7..20fcbc4c94 100644 --- a/orte/mca/oob/base/oob_base_open.c +++ b/orte/mca/oob/base/oob_base_open.c @@ -54,18 +54,21 @@ int mca_oob_base_open(void) OBJ_CONSTRUCT(&mca_oob_base_modules, opal_list_t); if (OMPI_SUCCESS != - mca_base_components_open("oob", 0, mca_oob_base_static_components, + mca_base_components_open("oob", mca_oob_base_output, + mca_oob_base_static_components, &mca_oob_base_components, true)) { - return OMPI_ERROR; + return ORTE_ERROR; } /* register parameters */ - mca_base_param_lookup_string( - mca_base_param_register_string("oob","base","include",NULL,NULL), &mca_oob_base_include); - mca_base_param_lookup_string( - mca_base_param_register_string("oob","base","exclude",NULL,NULL), &mca_oob_base_exclude); + mca_base_param_reg_string_name("oob_base", "include", + "Components to include for oob framework selection", + false, false, NULL, &mca_oob_base_include); + mca_base_param_reg_string_name("oob_base", "exclude", + "Components to exclude for oob framework selection", + false, false, NULL, &mca_oob_base_exclude); /* All done */ - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/oob/base/oob_base_recv_nb.c b/orte/mca/oob/base/oob_base_recv_nb.c index 9a17f3fd81..b225694362 100644 --- a/orte/mca/oob/base/oob_base_recv_nb.c +++ b/orte/mca/oob/base/oob_base_recv_nb.c @@ -104,8 +104,9 @@ int mca_oob_recv_packed_nb( mca_oob_recv_cbdata_t *oob_cbdata = malloc(sizeof(mca_oob_recv_cbdata_t)); int rc; - if(NULL == oob_cbdata) - return OMPI_ERR_OUT_OF_RESOURCE; + if(NULL == oob_cbdata) { + return ORTE_ERR_OUT_OF_RESOURCE; + } memset(oob_cbdata, 0, sizeof(mca_oob_recv_cbdata_t)); oob_cbdata->cbfunc = cbfunc; diff --git a/orte/mca/oob/base/oob_base_send.c b/orte/mca/oob/base/oob_base_send.c index 921b814ee5..9db95518f6 100644 --- a/orte/mca/oob/base/oob_base_send.c +++ b/orte/mca/oob/base/oob_base_send.c @@ -65,8 +65,9 @@ int mca_oob_send_packed (orte_process_name_t* peer, orte_buffer_t* buffer, int t /* first build iovec from buffer information */ rc = orte_dps.unload(buffer, &dataptr, &datalen); - if(rc != OMPI_SUCCESS) + if(rc != ORTE_SUCCESS) { return rc; + } msg[0].iov_base = dataptr; msg[0].iov_len = datalen; diff --git a/orte/mca/oob/base/oob_base_send_nb.c b/orte/mca/oob/base/oob_base_send_nb.c index fa49ec2e8a..76df30a7f6 100644 --- a/orte/mca/oob/base/oob_base_send_nb.c +++ b/orte/mca/oob/base/oob_base_send_nb.c @@ -101,13 +101,13 @@ int mca_oob_send_packed_nb( /* first build iovec from buffer information */ rc = orte_dps.unload(buffer, &dataptr, &datalen); - if (rc != OMPI_SUCCESS) { + if (rc != ORTE_SUCCESS) { return rc; } /* allocate a struct to pass into callback */ if(NULL == (oob_cbdata = malloc(sizeof(mca_oob_send_cbdata_t)))) { - return OMPI_ERR_OUT_OF_RESOURCE; + return ORTE_ERR_OUT_OF_RESOURCE; } oob_cbdata->cbbuf = buffer; oob_cbdata->cbfunc = cbfunc; diff --git a/orte/mca/oob/base/oob_base_xcast.c b/orte/mca/oob/base/oob_base_xcast.c index bf102646f8..896fd23ec2 100644 --- a/orte/mca/oob/base/oob_base_xcast.c +++ b/orte/mca/oob/base/oob_base_xcast.c @@ -84,7 +84,7 @@ int mca_oob_xcast( cbfunc(rc, root, &rbuf, tag, NULL); OBJ_DESTRUCT(&rbuf); } - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/pls/base/pls_base_open.c b/orte/mca/pls/base/pls_base_open.c index 237afb726c..f9375b02a0 100644 --- a/orte/mca/pls/base/pls_base_open.c +++ b/orte/mca/pls/base/pls_base_open.c @@ -48,8 +48,9 @@ int orte_pls_base_open(void) /* Debugging / verbose output */ - param = mca_base_param_register_int("pls", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("pls_base", "verbose", + "Verbosity level for the pls framework", + false, false, 0, &value); if (value != 0) { orte_pls_base.pls_output = opal_output_open(NULL); } else { @@ -62,7 +63,8 @@ int orte_pls_base_open(void) /* Open up all the components that we can find */ if (ORTE_SUCCESS != - mca_base_components_open("pls", 0, mca_pls_base_static_components, + mca_base_components_open("pls", orte_pls_base.pls_output, + mca_pls_base_static_components, &orte_pls_base.pls_opened, true)) { return ORTE_ERROR; } diff --git a/orte/mca/ras/base/ras_base_open.c b/orte/mca/ras/base/ras_base_open.c index 03ef9dd56b..03ec5e22f0 100644 --- a/orte/mca/ras/base/ras_base_open.c +++ b/orte/mca/ras/base/ras_base_open.c @@ -96,8 +96,9 @@ int orte_ras_base_open(void) /* Debugging / verbose output */ orte_ras_base.ras_output = opal_output_open(NULL); - param = mca_base_param_register_int("ras", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("ras_base", "verbose", + "Verbosity level for the ras framework", + false, false, 0, &value); if (value != 0) { orte_ras_base.ras_output = opal_output_open(NULL); } else { @@ -107,7 +108,8 @@ int orte_ras_base_open(void) /* Open up all available components */ if (ORTE_SUCCESS != - mca_base_components_open("ras", 0, mca_ras_base_static_components, + mca_base_components_open("ras", orte_ras_base.ras_output, + mca_ras_base_static_components, &orte_ras_base.ras_opened, true)) { return ORTE_ERROR; } @@ -135,7 +137,7 @@ int orte_ras_base_open(void) "orte:base:open: component %s returns priority %d", component->ras_version.mca_component_name, priority); - + cmp = OBJ_NEW(orte_ras_base_cmp_t); cmp->component = component; cmp->module = module; diff --git a/orte/mca/rds/base/rds_base_open.c b/orte/mca/rds/base/rds_base_open.c index 26cbb32655..c01bc6d672 100644 --- a/orte/mca/rds/base/rds_base_open.c +++ b/orte/mca/rds/base/rds_base_open.c @@ -98,8 +98,9 @@ int orte_rds_base_open(void) /* Debugging / verbose output */ orte_rds_base.rds_output = opal_output_open(NULL); - param = mca_base_param_register_int("rds", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("rds_base", "verbose", + "Verbosity level for the rds framework", + false, false, 0, &value); if (value != 0) { orte_rds_base.rds_output = opal_output_open(NULL); } else { @@ -109,7 +110,8 @@ int orte_rds_base_open(void) /* Open up all available components */ if (ORTE_SUCCESS != - mca_base_components_open("rds", 0, mca_rds_base_static_components, + mca_base_components_open("rds", orte_rds_base.rds_output, + mca_rds_base_static_components, &orte_rds_base.rds_components, true)) { return ORTE_ERROR; } diff --git a/orte/mca/rmaps/base/rmaps_base_open.c b/orte/mca/rmaps/base/rmaps_base_open.c index 7f56c244fb..c397c20827 100644 --- a/orte/mca/rmaps/base/rmaps_base_open.c +++ b/orte/mca/rmaps/base/rmaps_base_open.c @@ -64,8 +64,9 @@ int orte_rmaps_base_open(void) /* Debugging / verbose output */ - param = mca_base_param_register_int("rmaps", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("rmaps_base", "verbose", + "Verbosity level for the rmaps framework", + false, false, 0, &value); if (value != 0) { orte_rmaps_base.rmaps_output = opal_output_open(NULL); } else { @@ -75,7 +76,8 @@ int orte_rmaps_base_open(void) /* Open up all the components that we can find */ if (ORTE_SUCCESS != - mca_base_components_open("rmaps", 0, mca_rmaps_base_static_components, + mca_base_components_open("rmaps", orte_rmaps_base.rmaps_output, + mca_rmaps_base_static_components, &orte_rmaps_base.rmaps_opened, true)) { return ORTE_ERROR; } diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.c b/orte/mca/rmaps/round_robin/rmaps_rr.c index 66068fa75a..4d67ab6af1 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr.c @@ -272,7 +272,7 @@ static int map_app_by_slot( /* Did we allocate everything? */ if (num_alloc < app->num_procs) { - return OMPI_ERR_OUT_OF_RESOURCE; + return ORTE_ERR_OUT_OF_RESOURCE; } map->num_procs = num_alloc; diff --git a/orte/mca/rmgr/base/rmgr_base_context.c b/orte/mca/rmgr/base/rmgr_base_context.c index a78293365c..c19816e596 100644 --- a/orte/mca/rmgr/base/rmgr_base_context.c +++ b/orte/mca/rmgr/base/rmgr_base_context.c @@ -76,7 +76,7 @@ int orte_rmgr_base_put_app_context( if(NULL == value->keyvals) { OBJ_RELEASE(value); ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); - return OMPI_ERR_OUT_OF_RESOURCE; + return ORTE_ERR_OUT_OF_RESOURCE; } memset(value->keyvals, 0, num_context * sizeof(orte_gpr_keyval_t*)); diff --git a/orte/mca/rmgr/base/rmgr_base_open.c b/orte/mca/rmgr/base/rmgr_base_open.c index 156b1cc173..89c011b257 100644 --- a/orte/mca/rmgr/base/rmgr_base_open.c +++ b/orte/mca/rmgr/base/rmgr_base_open.c @@ -152,8 +152,9 @@ int orte_rmgr_base_open(void) /* Debugging / verbose output */ orte_rmgr_base.rmgr_output = opal_output_open(NULL); - param = mca_base_param_register_int("rmgr", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("rmgr_base", "verbose", + "Verbosity level for the rmgr framework", + false, false, 0, &value); if (value != 0) { orte_rmgr_base.rmgr_output = opal_output_open(NULL); } else { @@ -180,7 +181,8 @@ int orte_rmgr_base_open(void) /* Open up all available components */ if (ORTE_SUCCESS != - mca_base_components_open("rmgr", 0, mca_rmgr_base_static_components, + mca_base_components_open("rmgr", orte_rmgr_base.rmgr_output, + mca_rmgr_base_static_components, &orte_rmgr_base.rmgr_components, true)) { return ORTE_ERROR; } diff --git a/orte/mca/rml/base/rml_base_open.c b/orte/mca/rml/base/rml_base_open.c index a3d30505bd..0dce083e91 100644 --- a/orte/mca/rml/base/rml_base_open.c +++ b/orte/mca/rml/base/rml_base_open.c @@ -58,15 +58,22 @@ int orte_rml_base_open(void) OBJ_CONSTRUCT(&orte_rml_base.rml_components, opal_list_t); /* lookup common parameters */ - id = mca_base_param_register_int("rml","base","debug",NULL,1); - mca_base_param_lookup_int(id,&int_value); + id = mca_base_param_reg_int_name("rml_base", "debug", + "Verbosity level for the rml famework", + false, false, 0, &int_value); orte_rml_base.rml_debug = int_value; + if (int_value) { + orte_rml_base.rml_output = opal_output_open(NULL); + } else { + orte_rml_base.rml_output = -1; + } /* Open up all available components */ - if ((rc = mca_base_components_open("rml", 0, mca_rml_base_static_components, + if ((rc = mca_base_components_open("rml", orte_rml_base.rml_output, + mca_rml_base_static_components, &orte_rml_base.rml_components, true)) != OMPI_SUCCESS) { return rc; } - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/mca/schema/base/schema_base_open.c b/orte/mca/schema/base/schema_base_open.c index 333d4b5d40..f3f72395b9 100644 --- a/orte/mca/schema/base/schema_base_open.c +++ b/orte/mca/schema/base/schema_base_open.c @@ -73,9 +73,9 @@ int orte_schema_base_open(void) if (!orte_schema_initialized) { /* Debugging / verbose output */ - param = mca_base_param_register_int("schema", "base", "verbose", - NULL, 0); - mca_base_param_lookup_int(param, &value); + param = mca_base_param_reg_int_name("schema_base", "verbose", + "Verbosity level for the schema framework", + false, false, 0, &value); if (value != 0) { orte_schema_base_output = opal_output_open(NULL); } else { @@ -85,7 +85,8 @@ int orte_schema_base_open(void) /* Open up all available components */ if (OMPI_SUCCESS != - mca_base_components_open("schema", 0, mca_schema_base_static_components, + mca_base_components_open("schema", orte_schema_base_output, + mca_schema_base_static_components, &orte_schema_base_components_available, true)) { return ORTE_ERROR; } diff --git a/orte/mca/sds/base/sds_base_open.c b/orte/mca/sds/base/sds_base_open.c index 69e4bb1ba2..a6a7050685 100644 --- a/orte/mca/sds/base/sds_base_open.c +++ b/orte/mca/sds/base/sds_base_open.c @@ -40,7 +40,7 @@ orte_sds_base_open(void) OBJ_CONSTRUCT(&orte_sds_base_components_available, opal_list_t); /* Open up all available components */ - if (ORTE_SUCCESS != + if (OMPI_SUCCESS != mca_base_components_open("sds", 0, mca_sds_base_static_components, &orte_sds_base_components_available, true)) { diff --git a/orte/mca/soh/base/soh_base_open.c b/orte/mca/soh/base/soh_base_open.c index e07f73c0e7..ea0cb463f7 100644 --- a/orte/mca/soh/base/soh_base_open.c +++ b/orte/mca/soh/base/soh_base_open.c @@ -52,9 +52,9 @@ orte_soh_base_t orte_soh_base; orte_soh_base_module_t orte_soh = { - orte_soh_base_get_proc_soh, + orte_soh_base_get_proc_soh, orte_soh_base_set_proc_soh, - orte_soh_base_get_node_soh_not_available, + 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, @@ -77,8 +77,9 @@ int orte_soh_base_open(void) /* setup output for debug messages */ orte_soh_base.soh_output = opal_output_open(NULL); - param = mca_base_param_register_int("soh", "base", "verbose", NULL, 0); - mca_base_param_lookup_int(param, &value); + 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 { @@ -122,15 +123,13 @@ int orte_soh_base_open(void) /* 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; + 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 */ -/* fprintf(stderr,"orte_soh_base_open:success\n"); */ - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/runtime/orte_monitor.c b/orte/runtime/orte_monitor.c index 039486d76a..9b3ee529ff 100644 --- a/orte/runtime/orte_monitor.c +++ b/orte/runtime/orte_monitor.c @@ -17,17 +17,19 @@ /** @file **/ #include "ompi_config.h" + #include -#include "include/constants.h" -#include "util/proc_info.h" -#include "util/sys_info.h" -#include "runtime/runtime.h" + +#include "opal/util/sys_info.h" #include "opal/util/output.h" #include "opal/event/event.h" #include "opal/threads/mutex.h" #include "opal/threads/condition.h" -#include "mca/ns/ns_types.h" -#include "mca/gpr/gpr_types.h" +#include "orte/runtime/runtime.h" +#include "orte/include/orte_constants.h" +#include "orte/util/proc_info.h" +#include "orte/mca/ns/ns_types.h" +#include "orte/mca/gpr/gpr_types.h" static opal_mutex_t ompi_rte_mutex; @@ -96,11 +98,11 @@ int orte_monitor_procs_registered(void) ompi_rte_waiting = false; if(ompi_rte_job_started == false) { opal_mutex_unlock(&ompi_rte_mutex); - return OMPI_ERROR; + return ORTE_ERROR; } } OPAL_THREAD_UNLOCK(&ompi_rte_mutex); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } int orte_monitor_procs_unregistered(void) @@ -114,6 +116,6 @@ int orte_monitor_procs_unregistered(void) } OPAL_THREAD_UNLOCK(&ompi_rte_mutex); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/runtime/orte_wait.c b/orte/runtime/orte_wait.c index a1e4927301..de327cefac 100644 --- a/orte/runtime/orte_wait.c +++ b/orte/runtime/orte_wait.c @@ -29,14 +29,14 @@ #include #endif -#include "runtime/orte_wait.h" #include "opal/util/output.h" #include "opal/class/opal_object.h" #include "opal/class/opal_list.h" #include "opal/event/event.h" -#include "include/constants.h" #include "opal/threads/mutex.h" #include "opal/threads/condition.h" +#include "orte/include/orte_constants.h" +#include "orte/runtime/orte_wait.h" #ifdef HAVE_WAITPID @@ -165,7 +165,7 @@ orte_wait_init(void) &handler); opal_event_add(&handler, NULL); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -190,7 +190,7 @@ orte_wait_finalize(void) OBJ_DESTRUCT(&pending_pids); OBJ_DESTRUCT(®istered_cb); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } int @@ -215,7 +215,7 @@ orte_wait_kill(int sig) OBJ_RELEASE(item); } OPAL_THREAD_UNLOCK(&mutex); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -228,7 +228,7 @@ orte_waitpid(pid_t wpid, int *status, int options) pid_t ret; if ((wpid <= 0) || (0 != (options & WUNTRACED))) { - errno = OMPI_ERR_NOT_IMPLEMENTED; + errno = ORTE_ERR_NOT_IMPLEMENTED; return (pid_t) -1; } @@ -324,8 +324,8 @@ orte_wait_cb(pid_t wpid, orte_wait_fn_t callback, void *data) { int ret; - if (wpid <= 0) return OMPI_ERR_NOT_IMPLEMENTED; - if (NULL == callback) return OMPI_ERR_BAD_PARAM; + if (wpid <= 0) return ORTE_ERR_NOT_IMPLEMENTED; + if (NULL == callback) return ORTE_ERR_BAD_PARAM; OPAL_THREAD_LOCK(&mutex); ret = register_callback(wpid, callback, data); @@ -341,7 +341,7 @@ orte_wait_cb_cancel(pid_t wpid) { int ret; - if (wpid <= 0) return OMPI_ERR_BAD_PARAM; + if (wpid <= 0) return ORTE_ERR_BAD_PARAM; OPAL_THREAD_LOCK(&mutex); do_waitall(0); @@ -374,7 +374,7 @@ orte_wait_cb_disable() cb_enabled = false; OPAL_THREAD_UNLOCK(&mutex); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -386,7 +386,7 @@ orte_wait_cb_enable() do_waitall(0); OPAL_THREAD_UNLOCK(&mutex); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -522,8 +522,8 @@ register_callback(pid_t pid, orte_wait_fn_t callback, void *data) /* register the callback */ reg_cb = find_waiting_cb(pid, true); - if (NULL == reg_cb) return OMPI_ERROR; - if (NULL != reg_cb->callback) return OMPI_EXISTS; + if (NULL == reg_cb) return ORTE_ERROR; + if (NULL != reg_cb->callback) return ORTE_EXISTS; reg_cb->pid = pid; reg_cb->callback = callback; @@ -534,7 +534,7 @@ register_callback(pid_t pid, orte_wait_fn_t callback, void *data) if (NULL != pending) { trigger_callback(reg_cb, pending); } - return OMPI_SUCCESS; + return ORTE_SUCCESS; } @@ -545,11 +545,11 @@ unregister_callback(pid_t pid) /* register the callback */ reg_cb = find_waiting_cb(pid, false); - if (NULL == reg_cb) return OMPI_ERR_BAD_PARAM; + if (NULL == reg_cb) return ORTE_ERR_BAD_PARAM; opal_list_remove_item(®istered_cb, (opal_list_item_t*) reg_cb); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } diff --git a/orte/util/session_dir.c b/orte/util/session_dir.c index ea82ac021d..993e86b55a 100644 --- a/orte/util/session_dir.c +++ b/orte/util/session_dir.c @@ -86,13 +86,13 @@ static int orte_check_dir(bool create, char *directory) if (0 == _stat64(directory, &buf)) { /* exist -- check */ #endif if ((buf.st_mode & my_mode) == my_mode) { /* okay, I can work here */ - return(OMPI_SUCCESS); + return(ORTE_SUCCESS); } } if (create) { return(opal_os_create_dirpath(directory, my_mode)); /* try to create it with proper mode */ } - return(OMPI_ERROR); /* couldn't find it, or don't have access rights, and not asked to create it */ + return(ORTE_ERROR); /* couldn't find it, or don't have access rights, and not asked to create it */ } int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, @@ -108,7 +108,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, if (NULL == usr) { /* check if user set elsewhere */ if (NULL == orte_system_info.user) { /* error condition */ - return OMPI_ERROR; + return ORTE_ERROR; } else { user = strdup(orte_system_info.user); } @@ -118,7 +118,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, if (NULL == univ) { /* see if universe set elsewhere */ if (NULL == orte_universe_info.name) { /* error condition */ - return OMPI_ERROR; + return ORTE_ERROR; } else { universe = strdup(orte_universe_info.name); } @@ -127,12 +127,12 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, } if (NULL == job && NULL != proc) { /* can't give a proc without a job */ - return OMPI_ERROR; + return ORTE_ERROR; } if (NULL == hostid) { /* check if hostname set elsewhere */ if (NULL == orte_system_info.nodename) { /* don't have a hostname anywhere - error */ - return_code = OMPI_ERROR; + return_code = ORTE_ERROR; goto CLEANUP; } else { hostname = strdup(orte_system_info.nodename); @@ -149,7 +149,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, if (NULL == orte_process_info.top_session_dir) { if (0 > asprintf(&frontend, "openmpi-sessions-%s@%s_%s", user, hostname, batchname)) { - return_code = OMPI_ERROR; + return_code = ORTE_ERROR; goto CLEANUP; } } else { @@ -162,19 +162,19 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, orte_system_info.path_sep, universe, orte_system_info.path_sep, job, orte_system_info.path_sep, proc)) { - return_code = OMPI_ERROR; + return_code = ORTE_ERROR; goto CLEANUP; } } else if (NULL != job) { if (0 > asprintf(&sessions, "%s%s%s%s%s", frontend, orte_system_info.path_sep, universe, orte_system_info.path_sep, job)) { - return_code = OMPI_ERROR; + return_code = ORTE_ERROR; goto CLEANUP; } } else { if (0 > asprintf(&sessions, "%s%s%s", frontend, orte_system_info.path_sep, universe)) { - return_code = OMPI_ERROR; + return_code = ORTE_ERROR; goto CLEANUP; } } @@ -183,8 +183,8 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, if (NULL != prefix) { /* if a prefix is specified, start looking here */ tmp = strdup(prefix); fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); /* make sure it's an absolute pathname */ - if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ - return_code = OMPI_SUCCESS; + if (ORTE_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ + return_code = ORTE_SUCCESS; goto COMPLETE; } } @@ -201,8 +201,8 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, if (NULL != orte_process_info.tmpdir_base) { /* stored value previously */ tmp = strdup(orte_process_info.tmpdir_base); fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); - if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ - return_code = OMPI_SUCCESS; + if (ORTE_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ + return_code = ORTE_SUCCESS; goto COMPLETE; } free(tmp); tmp = NULL; @@ -210,8 +210,8 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, } else if (NULL != getenv("OMPI_PREFIX_ENV")) { /* we have prefix enviro var - try that next */ tmp = strdup(getenv("OMPI_PREFIX_ENV")); fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); - if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ - return_code = OMPI_SUCCESS; + if (ORTE_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ + return_code = ORTE_SUCCESS; goto COMPLETE; } free(tmp); tmp = NULL; @@ -219,8 +219,8 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, } else if (NULL != getenv("TMPDIR")) { tmp = strdup(getenv("TMPDIR")); fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); - if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ - return_code = OMPI_SUCCESS; + if (ORTE_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ + return_code = ORTE_SUCCESS; goto COMPLETE; } free(tmp); tmp = NULL; @@ -228,8 +228,8 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, } else if (NULL != getenv("TMP")) { tmp = strdup(getenv("TMP")); fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); - if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ - return_code = OMPI_SUCCESS; + if (ORTE_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ + return_code = ORTE_SUCCESS; goto COMPLETE; } free(tmp); tmp = NULL; @@ -237,8 +237,8 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, } else { tmp = strdup(OMPI_DEFAULT_TMPDIR); fulldirpath = strdup(opal_os_path(false, tmp, sessions, NULL)); - if (OMPI_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ - return_code = OMPI_SUCCESS; + if (ORTE_SUCCESS == orte_check_dir(create, fulldirpath)) { /* check for existence and access, or create it */ + return_code = ORTE_SUCCESS; goto COMPLETE; } free(tmp); tmp = NULL; @@ -246,7 +246,7 @@ int orte_session_dir(bool create, char *prfx, char *usr, char *hostid, } /* couldn't find anything - return error */ - return_code = OMPI_ERROR; + return_code = ORTE_ERROR; goto CLEANUP; @@ -459,7 +459,7 @@ CLEANUP: free(vpid); free(job_session_dir); free(proc_session_dir); - return OMPI_SUCCESS; + return ORTE_SUCCESS; } static void