From c3df744a3b2f7276479e784f2aaccc375ced6438 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Mon, 17 Feb 2014 01:40:56 +0000 Subject: [PATCH] Shift the orte_db_localrank key to the opal level. Add the job and proc-level session directory names to the database using opal_db keys. This commit was SVN r30746. --- ompi/mca/rte/orte/rte_orte.h | 6 ++++-- opal/mca/db/db_types.h | 3 +++ orte/mca/ess/base/ess_base_std_app.c | 20 +++++++++++++++++++- orte/mca/ess/pmi/ess_pmi_module.c | 2 +- orte/runtime/orte_globals.h | 3 +-- orte/util/nidmap.c | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ompi/mca/rte/orte/rte_orte.h b/ompi/mca/rte/orte/rte_orte.h index 08619a076b..3c88c6d123 100644 --- a/ompi/mca/rte/orte/rte_orte.h +++ b/ompi/mca/rte/orte/rte_orte.h @@ -57,9 +57,11 @@ typedef orte_ns_cmp_bitmask_t ompi_rte_cmp_bitmask_t; #define OMPI_NAME ORTE_NAME #define OMPI_PROCESS_NAME_HTON ORTE_PROCESS_NAME_HTON #define OMPI_PROCESS_NAME_NTOH ORTE_PROCESS_NAME_NTOH -#define OMPI_RTE_NODE_ID ORTE_DB_DAEMON_VPID #define OMPI_RTE_MY_NODEID ORTE_PROC_MY_DAEMON->vpid -#define OMPI_RTE_HOST_ID ORTE_DB_HOSTID + +/* database keys */ +#define OMPI_RTE_NODE_ID ORTE_DB_DAEMON_VPID +#define OMPI_RTE_HOST_ID ORTE_DB_HOSTID /* Collective objects and operations */ #define ompi_rte_collective_t orte_grpcomm_collective_t diff --git a/opal/mca/db/db_types.h b/opal/mca/db/db_types.h index 9b3acd4bcc..49752f25a1 100644 --- a/opal/mca/db/db_types.h +++ b/opal/mca/db/db_types.h @@ -27,6 +27,9 @@ BEGIN_C_DECLS #define OPAL_DB_LOCALITY "opal.locality" #define OPAL_DB_CPUSET "opal.cpuset" #define OPAL_DB_CREDENTIAL "opal.cred" +#define OPAL_DB_JOB_SDIR "opal.job.session.dir" +#define OPAL_DB_MY_SDIR "opal.my.session.dir" +#define OPAL_DB_LOCALRANK "opal.local.rank" END_C_DECLS diff --git a/orte/mca/ess/base/ess_base_std_app.c b/orte/mca/ess/base/ess_base_std_app.c index a78aaf0b5d..d9a08378ac 100644 --- a/orte/mca/ess/base/ess_base_std_app.c +++ b/orte/mca/ess/base/ess_base_std_app.c @@ -12,7 +12,7 @@ * Copyright (c) 2010-2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2013 Intel, Inc. All rights reserved. + * Copyright (c) 2013-2014 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -240,6 +240,24 @@ int orte_ess_base_app_setup(bool db_restrict_local) proc-specific session directory. */ opal_output_set_output_file_info(orte_process_info.proc_session_dir, "output-", NULL, NULL); + + /* store the session directory location in the database */ + if (OPAL_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, + OPAL_SCOPE_INTERNAL, + OPAL_DB_JOB_SDIR, + orte_process_info.job_session_dir, OPAL_STRING))) { + ORTE_ERROR_LOG(ret); + error = "store job session dir"; + goto error; + } + if (OPAL_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, + OPAL_SCOPE_INTERNAL, + OPAL_DB_MY_SDIR, + orte_process_info.proc_session_dir, OPAL_STRING))) { + ORTE_ERROR_LOG(ret); + error = "store job session dir"; + goto error; + } } /* setup the routed info */ diff --git a/orte/mca/ess/pmi/ess_pmi_module.c b/orte/mca/ess/pmi/ess_pmi_module.c index 594bf8060a..3dced30422 100644 --- a/orte/mca/ess/pmi/ess_pmi_module.c +++ b/orte/mca/ess/pmi/ess_pmi_module.c @@ -376,7 +376,7 @@ static int rte_init(void) goto error; } if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME, - OPAL_SCOPE_GLOBAL, ORTE_DB_LOCALRANK, + OPAL_SCOPE_GLOBAL, OPAL_DB_LOCALRANK, &orte_process_info.my_local_rank, ORTE_LOCAL_RANK))) { error = "db store local rank"; goto error; diff --git a/orte/runtime/orte_globals.h b/orte/runtime/orte_globals.h index 4a6f140247..c7b0d11dcd 100644 --- a/orte/runtime/orte_globals.h +++ b/orte/runtime/orte_globals.h @@ -13,7 +13,7 @@ * Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2011-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2013 Intel, Inc. All rights reserved + * Copyright (c) 2013-2014 Intel, Inc. All rights reserved * $COPYRIGHT$ * * Additional copyrights may follow @@ -124,7 +124,6 @@ ORTE_DECLSPEC extern int orte_exit_status; #define ORTE_DB_HOSTNAME "orte.hostname" #define ORTE_DB_DAEMON_VPID "orte.daemon.vpid" #define ORTE_DB_NODERANK "orte.node.rank" -#define ORTE_DB_LOCALRANK "orte.local.rank" #define ORTE_DB_ARCH "orte.arch" #define ORTE_DB_NPROCS "orte.nprocs" #define ORTE_DB_NPROC_OFFSET "orte.nproc.offset" diff --git a/orte/util/nidmap.c b/orte/util/nidmap.c index 0681cb584e..ab5d4d3677 100644 --- a/orte/util/nidmap.c +++ b/orte/util/nidmap.c @@ -1014,7 +1014,7 @@ int orte_util_decode_pidmap(opal_byte_object_t *bo) } /* store the values in the database - again, these are for our own internal use */ if (ORTE_SUCCESS != (rc = opal_db.store((opal_identifier_t*)&proc, OPAL_SCOPE_INTERNAL, - ORTE_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) { + OPAL_DB_LOCALRANK, &local_rank, ORTE_LOCAL_RANK))) { ORTE_ERROR_LOG(rc); goto cleanup; }