2011-10-17 20:51:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. 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.
|
Per RFC, bring in the following changes:
* Remove paffinity, maffinity, and carto frameworks -- they've been
wholly replaced by hwloc.
* Move ompi_mpi_init() affinity-setting/checking code down to ORTE.
* Update sm, smcuda, wv, and openib components to no longer use carto.
Instead, use hwloc data. There are still optimizations possible in
the sm/smcuda BTLs (i.e., making multiple mpools). Also, the old
carto-based code found out how many NUMA nodes were ''available''
-- not how many were used ''in this job''. The new hwloc-using
code computes the same value -- it was not updated to calculate how
many NUMA nodes are used ''by this job.''
* Note that I cannot compile the smcuda and wv BTLs -- I ''think''
they're right, but they need to be verified by their owners.
* The openib component now does a bunch of stuff to figure out where
"near" OpenFabrics devices are. '''THIS IS A CHANGE IN DEFAULT
BEHAVIOR!!''' and still needs to be verified by OpenFabrics vendors
(I do not have a NUMA machine with an OpenFabrics device that is a
non-uniform distance from multiple different NUMA nodes).
* Completely rewrite the OMPI_Affinity_str() routine from the
"affinity" mpiext extension. This extension now understands
hyperthreads; the output format of it has changed a bit to reflect
this new information.
* Bunches of minor changes around the code base to update names/types
from maffinity/paffinity-based names to hwloc-based names.
* Add some helper functions into the hwloc base, mainly having to do
with the fact that we have the hwloc data reporting ''all''
topology information, but sometimes you really only want the
(online | available) data.
This commit was SVN r26391.
2012-05-07 14:52:54 +00:00
|
|
|
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
|
2013-01-28 20:14:51 +00:00
|
|
|
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
|
2012-01-18 20:56:53 +00:00
|
|
|
* All rights reserved.
|
2013-07-18 14:46:07 +00:00
|
|
|
* Copyright (c) 2013 Intel, Inc. All rights reserved.
|
2011-10-17 20:51:22 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif /* HAVE_UNISTD_H */
|
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
#include <string.h>
|
|
|
|
#endif /* HAVE_STRING_H */
|
|
|
|
#include <ctype.h>
|
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
#include <netdb.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_IFADDRS_H
|
|
|
|
#include <ifaddrs.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <pmi.h>
|
2013-07-18 14:46:07 +00:00
|
|
|
#ifdef WANT_PMI2_SUPPORT
|
|
|
|
#include <pmi2.h>
|
|
|
|
#endif
|
2011-10-17 20:51:22 +00:00
|
|
|
|
|
|
|
#include "opal/util/opal_environ.h"
|
|
|
|
#include "opal/util/output.h"
|
|
|
|
#include "opal/util/argv.h"
|
|
|
|
#include "opal/class/opal_pointer_array.h"
|
2011-11-02 17:42:06 +00:00
|
|
|
#include "opal/mca/hwloc/base/base.h"
|
2011-10-17 20:51:22 +00:00
|
|
|
#include "opal/util/printf.h"
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
#include "opal/mca/common/pmi/common_pmi.h"
|
2011-10-17 20:51:22 +00:00
|
|
|
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
#include "opal/mca/db/db.h"
|
2012-06-27 14:53:55 +00:00
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
2013-01-03 02:16:10 +00:00
|
|
|
#include "orte/mca/rml/rml.h"
|
2011-10-17 20:51:22 +00:00
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/util/show_help.h"
|
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
#include "orte/util/nidmap.h"
|
|
|
|
#include "orte/util/pre_condition_transports.h"
|
|
|
|
#include "orte/util/regex.h"
|
2012-06-27 14:53:55 +00:00
|
|
|
#include "orte/runtime/orte_globals.h"
|
2011-10-17 20:51:22 +00:00
|
|
|
#include "orte/runtime/orte_wait.h"
|
|
|
|
|
|
|
|
#include "orte/mca/ess/ess.h"
|
|
|
|
#include "orte/mca/ess/base/base.h"
|
|
|
|
#include "orte/mca/ess/pmi/ess_pmi.h"
|
|
|
|
|
|
|
|
static int rte_init(void);
|
|
|
|
static int rte_finalize(void);
|
2012-04-06 14:23:13 +00:00
|
|
|
static void rte_abort(int error_code, bool report);
|
2011-10-17 20:51:22 +00:00
|
|
|
|
|
|
|
orte_ess_base_module_t orte_ess_pmi_module = {
|
|
|
|
rte_init,
|
|
|
|
rte_finalize,
|
|
|
|
rte_abort,
|
|
|
|
NULL /* ft_event */
|
|
|
|
};
|
|
|
|
|
|
|
|
static bool app_init_complete=false;
|
|
|
|
|
|
|
|
/**** MODULE FUNCTIONS ****/
|
|
|
|
|
|
|
|
static int rte_init(void)
|
|
|
|
{
|
|
|
|
int ret, i, j;
|
2013-01-03 02:16:10 +00:00
|
|
|
char *error = NULL, *localj, *pmirte=NULL;
|
2011-10-17 20:51:22 +00:00
|
|
|
int32_t jobfam, stepid;
|
2012-08-12 01:28:23 +00:00
|
|
|
char *envar, *ev1, *ev2;
|
2011-10-17 20:51:22 +00:00
|
|
|
uint64_t unique_key[2];
|
|
|
|
char *cs_env, *string_key;
|
|
|
|
char *pmi_id=NULL;
|
|
|
|
int *ranks;
|
2012-01-18 20:56:53 +00:00
|
|
|
orte_jobid_t jobid;
|
2012-06-27 14:53:55 +00:00
|
|
|
orte_process_name_t proc;
|
|
|
|
orte_local_rank_t local_rank;
|
|
|
|
orte_node_rank_t node_rank;
|
2013-01-03 02:16:10 +00:00
|
|
|
char *rmluri;
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
opal_hwloc_locality_t locality;
|
2011-10-17 20:51:22 +00:00
|
|
|
|
|
|
|
/* run the prolog */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_std_prolog())) {
|
|
|
|
error = "orte_ess_base_std_prolog";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2011-11-02 17:42:06 +00:00
|
|
|
#if OPAL_HAVE_HWLOC
|
|
|
|
/* get the topology */
|
|
|
|
if (NULL == opal_hwloc_topology) {
|
|
|
|
if (OPAL_SUCCESS != opal_hwloc_base_get_topology()) {
|
|
|
|
error = "topology discovery";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
if (ORTE_PROC_IS_DAEMON) { /* I am a daemon, launched by mpirun */
|
|
|
|
/* we had to be given a jobid */
|
2013-03-27 21:09:41 +00:00
|
|
|
if (NULL == orte_ess_base_jobid) {
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "missing jobid";
|
|
|
|
ret = ORTE_ERR_FATAL;
|
|
|
|
goto error;
|
|
|
|
}
|
2013-03-27 21:09:41 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) {
|
2012-01-18 20:56:53 +00:00
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "convert jobid";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
ORTE_PROC_MY_NAME->jobid = jobid;
|
|
|
|
/* get our rank from PMI */
|
2013-07-18 19:07:16 +00:00
|
|
|
if (!mca_common_pmi_rank(&i)) {
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "could not get PMI rank";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
ORTE_PROC_MY_NAME->vpid = i + 1; /* compensate for orterun */
|
|
|
|
|
|
|
|
/* get the number of procs from PMI */
|
2013-07-18 19:07:16 +00:00
|
|
|
if (!mca_common_pmi_size(&i)) {
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "could not get PMI universe size";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
orte_process_info.num_procs = i + 1; /* compensate for orterun */
|
|
|
|
|
2012-03-02 23:10:48 +00:00
|
|
|
/* complete setup */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_setup(NULL))) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
error = "orte_ess_base_orted_setup";
|
|
|
|
goto error;
|
|
|
|
}
|
2012-01-18 20:56:53 +00:00
|
|
|
} else { /* we are a direct-launched MPI process */
|
2013-07-18 14:46:07 +00:00
|
|
|
#if WANT_PMI2_SUPPORT
|
|
|
|
/* Get domain id */
|
|
|
|
pmi_id = (char*)malloc(PMI2_MAX_VALLEN);
|
|
|
|
if (PMI_SUCCESS != (ret = PMI2_Job_GetId(pmi_id, PMI2_MAX_VALLEN))) {
|
|
|
|
error = "PMI2_Job_GetId failed";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
#else
|
2013-07-18 17:19:13 +00:00
|
|
|
{
|
|
|
|
int pmi_maxlen;
|
|
|
|
|
|
|
|
/* get our PMI id length */
|
|
|
|
if (PMI_SUCCESS != (ret = PMI_Get_id_length_max(&pmi_maxlen))) {
|
|
|
|
error = "PMI_Get_id_length_max";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
pmi_id = (char*)malloc(pmi_maxlen);
|
|
|
|
if (PMI_SUCCESS != (ret = PMI_Get_kvs_domain_id(pmi_id, pmi_maxlen))) {
|
|
|
|
free(pmi_id);
|
|
|
|
error = "PMI_Get_kvs_domain_id";
|
|
|
|
goto error;
|
|
|
|
}
|
2012-01-18 20:56:53 +00:00
|
|
|
}
|
2013-07-18 14:46:07 +00:00
|
|
|
#endif
|
2012-01-18 20:56:53 +00:00
|
|
|
/* PMI is very nice to us - the domain id is an integer followed
|
|
|
|
* by a '.', followed by essentially a stepid. The first integer
|
|
|
|
* defines an overall job number. The second integer is the number of
|
|
|
|
* individual jobs we have run within that allocation. So we translate
|
|
|
|
* this as the overall job number equating to our job family, and
|
|
|
|
* the individual number equating to our local jobid
|
|
|
|
*/
|
|
|
|
jobfam = strtol(pmi_id, &localj, 10);
|
|
|
|
if (NULL == localj) {
|
|
|
|
/* hmmm - no '.', so let's just use zero */
|
|
|
|
stepid = 0;
|
|
|
|
} else {
|
|
|
|
localj++; /* step over the '.' */
|
|
|
|
stepid = strtol(localj, NULL, 10) + 1; /* add one to avoid looking like a daemon */
|
|
|
|
}
|
2011-10-17 20:51:22 +00:00
|
|
|
free(pmi_id);
|
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
/* now build the jobid */
|
|
|
|
ORTE_PROC_MY_NAME->jobid = ORTE_CONSTRUCT_LOCAL_JOBID(jobfam << 16, stepid);
|
2011-10-17 20:51:22 +00:00
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
/* get our rank */
|
2013-07-18 14:46:07 +00:00
|
|
|
if (!mca_common_pmi_rank(&i)) {
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "could not get PMI rank";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
ORTE_PROC_MY_NAME->vpid = i;
|
2011-10-17 20:51:22 +00:00
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
/* get the number of procs from PMI */
|
2013-07-18 14:46:07 +00:00
|
|
|
if (!mca_common_pmi_size(&i)) {
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "could not get PMI universe size";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
orte_process_info.num_procs = i;
|
2012-08-12 01:28:23 +00:00
|
|
|
/* push into the environ for pickup in MPI layer for
|
|
|
|
* MPI-3 required info key
|
|
|
|
*/
|
|
|
|
asprintf(&ev1, "OMPI_MCA_orte_ess_num_procs=%d", i);
|
|
|
|
putenv(ev1);
|
|
|
|
asprintf(&ev2, "OMPI_APP_CTX_NUM_PROCS=%d", i);
|
|
|
|
putenv(ev2);
|
2011-10-17 20:51:22 +00:00
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
/* setup transport keys in case the MPI layer needs them -
|
|
|
|
* we can use the jobfam and stepid as unique keys
|
|
|
|
* because they are unique values assigned by the RM
|
|
|
|
*/
|
|
|
|
unique_key[0] = (uint64_t)jobfam;
|
|
|
|
unique_key[1] = (uint64_t)stepid;
|
|
|
|
if (NULL == (string_key = orte_pre_condition_transports_print(unique_key))) {
|
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
2013-03-27 21:09:41 +00:00
|
|
|
if (OPAL_SUCCESS != mca_base_var_env_name ("orte_precondition_transports", &cs_env)) {
|
2012-01-18 20:56:53 +00:00
|
|
|
ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE);
|
|
|
|
return ORTE_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
asprintf(&envar, "%s=%s", cs_env, string_key);
|
|
|
|
putenv(envar);
|
|
|
|
/* cannot free the envar as that messes up our environ */
|
|
|
|
free(cs_env);
|
|
|
|
free(string_key);
|
2011-10-17 20:51:22 +00:00
|
|
|
|
2012-04-06 14:23:13 +00:00
|
|
|
/* our app_context number can only be 0 as we don't support
|
|
|
|
* dynamic spawns
|
|
|
|
*/
|
|
|
|
orte_process_info.app_num = 0;
|
2011-10-17 20:51:22 +00:00
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
/* setup my daemon's name - arbitrary, since we don't route
|
|
|
|
* messages
|
|
|
|
*/
|
|
|
|
ORTE_PROC_MY_DAEMON->jobid = 0;
|
|
|
|
ORTE_PROC_MY_DAEMON->vpid = 0;
|
|
|
|
|
2012-06-27 14:53:55 +00:00
|
|
|
/* ensure we pick the correct critical components */
|
|
|
|
putenv("OMPI_MCA_grpcomm=pmi");
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
putenv("OMPI_MCA_db_pmi_store_priority=100");
|
2012-06-27 14:53:55 +00:00
|
|
|
putenv("OMPI_MCA_routed=direct");
|
|
|
|
|
|
|
|
/* now use the default procedure to finish my setup */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_app_setup())) {
|
2012-01-18 20:56:53 +00:00
|
|
|
ORTE_ERROR_LOG(ret);
|
2012-06-27 14:53:55 +00:00
|
|
|
error = "orte_ess_base_app_setup";
|
2012-01-18 20:56:53 +00:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
2013-07-18 14:46:07 +00:00
|
|
|
#if WANT_PMI2_SUPPORT
|
|
|
|
{
|
|
|
|
/* get our local proc info to find our local rank */
|
|
|
|
char *pmapping = (char*)malloc(PMI2_MAX_VALLEN);
|
|
|
|
int found, sid, nodes, procs, k;
|
|
|
|
orte_vpid_t n;
|
|
|
|
char *p;
|
|
|
|
ret = PMI2_Info_GetJobAttr("PMI_process_mapping", pmapping, PMI2_MAX_VALLEN, &found);
|
|
|
|
if (!found) {
|
|
|
|
error = "could not get PMI_process_mapping (PMI2_Info_GetJobAttr() failed)";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
i = 0; n = 0; procs = 0;
|
|
|
|
if (NULL != (p = strstr(pmapping, "(vector"))) {
|
|
|
|
while (NULL != (p = strstr(p+1, ",("))) {
|
|
|
|
if (3 == sscanf(p, ",(%d,%d,%d)", &sid, &nodes, &procs)) {
|
|
|
|
for (k = 0; k < nodes; k++) {
|
|
|
|
if ((ORTE_PROC_MY_NAME->vpid >= n) &&
|
|
|
|
(ORTE_PROC_MY_NAME->vpid < (n + procs))) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
n += procs;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(pmapping);
|
|
|
|
|
|
|
|
if ((procs > 0) && (n < orte_process_info.num_procs)) {
|
|
|
|
ranks = (int*)malloc(procs * sizeof(int));
|
|
|
|
for (i=0; i < procs; i++) {
|
|
|
|
ranks[i] = n + i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL == ranks) {
|
|
|
|
error = "could not get PMI_process_mapping";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
2012-01-18 20:56:53 +00:00
|
|
|
/* get our local proc info to find our local rank */
|
|
|
|
if (PMI_SUCCESS != (ret = PMI_Get_clique_size(&i))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
OPAL_PMI_ERROR(ret, "PMI_Get_clique_size");
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "could not get PMI clique size";
|
|
|
|
goto error;
|
|
|
|
}
|
2012-07-31 21:21:50 +00:00
|
|
|
/* store that info - remember, we want the number of peers that
|
|
|
|
* share the node WITH ME, so we have to subtract ourselves from
|
|
|
|
* that number
|
|
|
|
*/
|
|
|
|
orte_process_info.num_local_peers = i - 1;
|
|
|
|
/* now get the specific ranks */
|
2012-01-18 20:56:53 +00:00
|
|
|
ranks = (int*)malloc(i * sizeof(int));
|
|
|
|
if (PMI_SUCCESS != (ret = PMI_Get_clique_ranks(ranks, i))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
OPAL_PMI_ERROR(ret, "PMI_Get_clique_ranks");
|
2012-01-18 20:56:53 +00:00
|
|
|
error = "could not get clique ranks";
|
|
|
|
goto error;
|
|
|
|
}
|
2013-07-18 14:46:07 +00:00
|
|
|
#endif
|
2012-02-21 16:43:17 +00:00
|
|
|
/* The clique ranks are returned in rank order, so
|
|
|
|
* cycle thru the array and update the local/node
|
|
|
|
* rank info
|
|
|
|
*/
|
2012-06-27 14:53:55 +00:00
|
|
|
proc.jobid = ORTE_PROC_MY_NAME->jobid;
|
2012-01-18 20:56:53 +00:00
|
|
|
for (j=0; j < i; j++) {
|
2012-06-27 14:53:55 +00:00
|
|
|
proc.vpid = ranks[j];
|
|
|
|
local_rank = j;
|
|
|
|
node_rank = j;
|
|
|
|
if (ranks[j] == (int)ORTE_PROC_MY_NAME->vpid) {
|
|
|
|
orte_process_info.my_local_rank = local_rank;
|
|
|
|
orte_process_info.my_node_rank = node_rank;
|
|
|
|
}
|
2012-01-18 20:56:53 +00:00
|
|
|
}
|
|
|
|
free(ranks);
|
|
|
|
|
Per RFC, bring in the following changes:
* Remove paffinity, maffinity, and carto frameworks -- they've been
wholly replaced by hwloc.
* Move ompi_mpi_init() affinity-setting/checking code down to ORTE.
* Update sm, smcuda, wv, and openib components to no longer use carto.
Instead, use hwloc data. There are still optimizations possible in
the sm/smcuda BTLs (i.e., making multiple mpools). Also, the old
carto-based code found out how many NUMA nodes were ''available''
-- not how many were used ''in this job''. The new hwloc-using
code computes the same value -- it was not updated to calculate how
many NUMA nodes are used ''by this job.''
* Note that I cannot compile the smcuda and wv BTLs -- I ''think''
they're right, but they need to be verified by their owners.
* The openib component now does a bunch of stuff to figure out where
"near" OpenFabrics devices are. '''THIS IS A CHANGE IN DEFAULT
BEHAVIOR!!''' and still needs to be verified by OpenFabrics vendors
(I do not have a NUMA machine with an OpenFabrics device that is a
non-uniform distance from multiple different NUMA nodes).
* Completely rewrite the OMPI_Affinity_str() routine from the
"affinity" mpiext extension. This extension now understands
hyperthreads; the output format of it has changed a bit to reflect
this new information.
* Bunches of minor changes around the code base to update names/types
from maffinity/paffinity-based names to hwloc-based names.
* Add some helper functions into the hwloc base, mainly having to do
with the fact that we have the hwloc data reporting ''all''
topology information, but sometimes you really only want the
(online | available) data.
This commit was SVN r26391.
2012-05-07 14:52:54 +00:00
|
|
|
/* setup process binding */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_proc_binding())) {
|
|
|
|
error = "proc_binding";
|
|
|
|
goto error;
|
|
|
|
}
|
2011-10-17 20:51:22 +00:00
|
|
|
}
|
2012-01-18 20:56:53 +00:00
|
|
|
|
|
|
|
/* set max procs */
|
|
|
|
if (orte_process_info.max_procs < orte_process_info.num_procs) {
|
|
|
|
orte_process_info.max_procs = orte_process_info.num_procs;
|
|
|
|
}
|
|
|
|
|
2013-01-03 02:16:10 +00:00
|
|
|
/* construct the PMI RTE string */
|
|
|
|
rmluri = orte_rml.get_contact_info();
|
2013-03-26 18:27:50 +00:00
|
|
|
if (NULL == orte_process_info.cpuset) {
|
|
|
|
asprintf(&pmirte, "%s,%s,%d,%d", rmluri, orte_process_info.nodename,
|
|
|
|
(int)orte_process_info.my_local_rank, (int)orte_process_info.my_node_rank);
|
|
|
|
} else {
|
|
|
|
asprintf(&pmirte, "%s,%s,%d,%d,%s", rmluri, orte_process_info.nodename,
|
|
|
|
(int)orte_process_info.my_local_rank, (int)orte_process_info.my_node_rank,
|
|
|
|
orte_process_info.cpuset);
|
|
|
|
}
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
/* push our info into the cloud */
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_GLOBAL, "RTE",
|
|
|
|
pmirte, OPAL_STRING))) {
|
2013-01-03 02:16:10 +00:00
|
|
|
error = "db store RTE info";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
free(pmirte);
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
/* store our info in the internal database */
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_INTERNAL, ORTE_DB_RMLURI,
|
|
|
|
rmluri, OPAL_STRING))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
error = "db store uri";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
free(rmluri);
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_INTERNAL, ORTE_DB_HOSTNAME,
|
|
|
|
orte_process_info.nodename, OPAL_STRING))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
error = "db store hostname";
|
|
|
|
goto error;
|
|
|
|
}
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_INTERNAL, ORTE_DB_CPUSET,
|
|
|
|
orte_process_info.cpuset, OPAL_STRING))) {
|
2013-03-26 18:27:50 +00:00
|
|
|
error = "db store cpuset";
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
goto error;
|
|
|
|
}
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_INTERNAL, ORTE_DB_LOCALRANK,
|
|
|
|
&orte_process_info.my_local_rank, ORTE_LOCAL_RANK))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
error = "db store local rank";
|
|
|
|
goto error;
|
|
|
|
}
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_INTERNAL, ORTE_DB_NODERANK,
|
|
|
|
&orte_process_info.my_node_rank, ORTE_NODE_RANK))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
error = "db store node rank";
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
locality = OPAL_PROC_ALL_LOCAL;
|
2013-07-18 14:46:07 +00:00
|
|
|
if (ORTE_SUCCESS != (ret = opal_db.store((opal_identifier_t*)ORTE_PROC_MY_NAME,
|
|
|
|
OPAL_DB_INTERNAL, ORTE_DB_LOCALITY,
|
|
|
|
&locality, OPAL_HWLOC_LOCALITY_T))) {
|
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move:
1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution).
2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time.
3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering.
4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options.
No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework.
This commit was SVN r28112.
2013-02-26 17:50:04 +00:00
|
|
|
error = "db store locality";
|
|
|
|
goto error;
|
|
|
|
}
|
2013-01-03 02:16:10 +00:00
|
|
|
|
2011-10-17 20:51:22 +00:00
|
|
|
/* flag that we completed init */
|
|
|
|
app_init_complete = true;
|
|
|
|
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
|
2012-01-18 20:56:53 +00:00
|
|
|
error:
|
2011-11-22 21:24:35 +00:00
|
|
|
if (ORTE_ERR_SILENT != ret && !orte_report_silent_errors) {
|
|
|
|
orte_show_help("help-orte-runtime.txt",
|
|
|
|
"orte_init:startup:internal-failure",
|
|
|
|
true, error, ORTE_ERROR_NAME(ret), ret);
|
|
|
|
}
|
|
|
|
|
2011-10-17 20:51:22 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rte_finalize(void)
|
|
|
|
{
|
|
|
|
int ret = ORTE_SUCCESS;
|
|
|
|
|
|
|
|
if (app_init_complete) {
|
2012-01-18 20:56:53 +00:00
|
|
|
/* if I am a daemon, finalize using the default procedure */
|
|
|
|
if (ORTE_PROC_IS_DAEMON) {
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_orted_finalize())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* use the default app procedure to finish */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_app_finalize())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
}
|
|
|
|
/* remove the envars that we pushed into environ
|
|
|
|
* so we leave that structure intact
|
|
|
|
*/
|
|
|
|
unsetenv("OMPI_MCA_grpcomm");
|
|
|
|
unsetenv("OMPI_MCA_routed");
|
|
|
|
unsetenv("OMPI_MCA_orte_precondition_transports");
|
2011-10-17 20:51:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* deconstruct my nidmap and jobmap arrays - this
|
|
|
|
* function protects itself from being called
|
|
|
|
* before things were initialized
|
|
|
|
*/
|
|
|
|
orte_util_nidmap_finalize();
|
|
|
|
|
2011-11-02 17:42:06 +00:00
|
|
|
#if OPAL_HAVE_HWLOC
|
|
|
|
if (NULL != opal_hwloc_topology) {
|
|
|
|
opal_hwloc_base_free_topology(opal_hwloc_topology);
|
|
|
|
opal_hwloc_topology = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-10-17 20:51:22 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rte_abort(int error_code, bool report)
|
|
|
|
{
|
|
|
|
orte_ess_base_app_abort(error_code, report);
|
|
|
|
}
|