From 93ddb4bf737a1087cc5b74508e4819968d3e6637 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Thu, 28 Jul 2005 00:11:09 +0000 Subject: [PATCH] * some fixups for the cnos components This commit was SVN r6637. --- orte/mca/rml/cnos/rml_cnos.c | 5 +-- orte/mca/sds/cnos/sds_cnos_component.c | 2 +- orte/mca/sds/cnos/sds_cnos_module.c | 56 ++++++++++++++++++++++++-- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/orte/mca/rml/cnos/rml_cnos.c b/orte/mca/rml/cnos/rml_cnos.c index c25188009f..f36ced05b6 100644 --- a/orte/mca/rml/cnos/rml_cnos.c +++ b/orte/mca/rml/cnos/rml_cnos.c @@ -21,10 +21,7 @@ #include "mca/rml/base/base.h" #include "rml_cnos.h" -#ifdef HAVE_CNOS -int cnos_barrier(void); -#endif - +#include orte_rml_component_t mca_rml_cnos_component = { /* First, the mca_base_component_t struct containing meta diff --git a/orte/mca/sds/cnos/sds_cnos_component.c b/orte/mca/sds/cnos/sds_cnos_component.c index d38754a4db..54809ea3dc 100644 --- a/orte/mca/sds/cnos/sds_cnos_component.c +++ b/orte/mca/sds/cnos/sds_cnos_component.c @@ -85,7 +85,7 @@ orte_sds_cnos_component_init(int *priority) if (NULL != mode) return NULL; *priority = 60; - return sds_cnos_module; + return &sds_cnos_module; } diff --git a/orte/mca/sds/cnos/sds_cnos_module.c b/orte/mca/sds/cnos/sds_cnos_module.c index ccc9a26feb..7ca3cd02c8 100644 --- a/orte/mca/sds/cnos/sds_cnos_module.c +++ b/orte/mca/sds/cnos/sds_cnos_module.c @@ -17,10 +17,15 @@ #include "orte_config.h" +#include + #include "include/orte_constants.h" #include "mca/sds/sds.h" #include "mca/sds/base/base.h" #include "mca/sds/cnos/sds_cnos.h" +#include "util/proc_info.h" +#include "mca/ns/base/base.h" +#include "mca/errmgr/base/base.h" orte_sds_base_module_t sds_cnos_module = { orte_sds_base_contact_universe, @@ -31,18 +36,63 @@ orte_sds_base_module_t sds_cnos_module = { int orte_sds_cnos_contact_universe(void) { - return ORTE_ERR_NOT_IMPLEMENTED; + orte_process_info.seed = false; + + /* since we are seed, ensure that all replica info is NULL'd */ + if (NULL != orte_process_info.ns_replica_uri) { + free(orte_process_info.ns_replica_uri); + orte_process_info.ns_replica_uri = NULL; + } + if (NULL != orte_process_info.ns_replica) { + free(orte_process_info.ns_replica); + orte_process_info.ns_replica = NULL; + } + + if (NULL != orte_process_info.gpr_replica_uri) { + free(orte_process_info.gpr_replica_uri); + orte_process_info.gpr_replica_uri = NULL; + } + if (NULL != orte_process_info.gpr_replica) { + free(orte_process_info.gpr_replica); + orte_process_info.gpr_replica = NULL; + } + + return OMPI_SUCCESS; } int orte_sds_cnos_set_name(void) { - return ORTE_ERR_NOT_IMPLEMENTED; + int rc; + orte_cellid_t cellid; + orte_jobid_t jobid; + orte_vpid_t vpid; + + /* Get our process information + * + * we're going to make up the cellid and jobid. find our vpid, + * assuming range starts at 0 + */ + cellid = 0; + jobid = 1; /* not 0, since it has special meaning */ + vpid = (orte_vpid_t) cnos_get_rank(); + if (ORTE_SUCCESS != (rc = orte_ns.create_process_name(&(orte_process_info.my_name), + cellid, + jobid, + vpid))) { + ORTE_ERROR_LOG(rc); + return rc; + } + + orte_process_info.vpid_start = (orte_vpid_t) 0; + orte_process_info.num_procs = (size_t) cnos_get_size(); + + return ORTE_SUCCESS; } int orte_sds_cnos_finalize(void) { - return ORTE_ERR_NOT_IMPLEMENTED; + return ORTE_SUCCESS; }