2015-04-09 19:39:22 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2010-04-23 09:51:29 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
2011-06-24 00:38:02 +04:00
|
|
|
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
2010-04-23 09:51:29 +04:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2010-04-23 09:51:29 +04:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
|
2013-02-28 21:31:47 +04:00
|
|
|
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
2015-03-31 04:10:08 +03:00
|
|
|
* Copyright (c) 2013-2015 Intel, Inc. All rights reserved.
|
2015-04-09 19:39:22 +03:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2010-04-23 09:51:29 +04:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2010-04-23 09:51:29 +04:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2010-04-23 09:51:29 +04:00
|
|
|
* $HEADER$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include "orte/constants.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#include <signal.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2010-07-13 10:33:07 +04:00
|
|
|
#include "opal/hash_string.h"
|
2010-04-23 09:51:29 +04:00
|
|
|
#include "opal/util/argv.h"
|
|
|
|
#include "opal/util/path.h"
|
|
|
|
#include "opal/mca/installdirs/installdirs.h"
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
#include "opal/mca/pmix/base/base.h"
|
2010-04-23 09:51:29 +04:00
|
|
|
|
|
|
|
#include "orte/util/show_help.h"
|
|
|
|
#include "orte/util/proc_info.h"
|
|
|
|
#include "orte/mca/errmgr/errmgr.h"
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
#include "orte/mca/rml/rml.h"
|
2010-04-23 09:51:29 +04:00
|
|
|
#include "orte/mca/routed/routed.h"
|
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
2014-02-09 06:10:31 +04:00
|
|
|
#include "orte/util/session_dir.h"
|
2010-04-23 09:51:29 +04:00
|
|
|
|
|
|
|
#include "orte/mca/ess/ess.h"
|
|
|
|
#include "orte/mca/ess/base/base.h"
|
|
|
|
#include "orte/mca/ess/singleton/ess_singleton.h"
|
|
|
|
|
|
|
|
|
|
|
|
static int rte_init(void);
|
|
|
|
static int rte_finalize(void);
|
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
extern char *orte_ess_singleton_server_uri;
|
|
|
|
|
2010-04-23 09:51:29 +04:00
|
|
|
orte_ess_base_module_t orte_ess_singleton_module = {
|
|
|
|
rte_init,
|
|
|
|
rte_finalize,
|
|
|
|
orte_ess_base_app_abort,
|
|
|
|
NULL /* ft_event */
|
|
|
|
};
|
|
|
|
|
|
|
|
static int rte_init(void)
|
|
|
|
{
|
|
|
|
int rc;
|
2013-03-28 01:09:41 +04:00
|
|
|
char *param;
|
2010-07-13 10:33:07 +04:00
|
|
|
uint16_t jobfam;
|
|
|
|
uint32_t hash32;
|
|
|
|
uint32_t bias;
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
opal_value_t kvn;
|
2010-07-13 10:33:07 +04:00
|
|
|
|
2010-04-23 09:51:29 +04:00
|
|
|
/* run the prolog */
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_ess_base_std_prolog())) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2010-07-13 10:33:07 +04:00
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
if (NULL != orte_ess_singleton_server_uri) {
|
2010-07-13 10:33:07 +04:00
|
|
|
/* we are going to connect to a server HNP */
|
2013-03-28 01:09:41 +04:00
|
|
|
if (0 == strncmp(orte_ess_singleton_server_uri, "file", strlen("file")) ||
|
|
|
|
0 == strncmp(orte_ess_singleton_server_uri, "FILE", strlen("FILE"))) {
|
2010-07-13 10:33:07 +04:00
|
|
|
char input[1024], *filename;
|
|
|
|
FILE *fp;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-07-13 10:33:07 +04:00
|
|
|
/* it is a file - get the filename */
|
2013-03-28 01:09:41 +04:00
|
|
|
filename = strchr(orte_ess_singleton_server_uri, ':');
|
2010-07-13 10:33:07 +04:00
|
|
|
if (NULL == filename) {
|
|
|
|
/* filename is not correctly formatted */
|
|
|
|
orte_show_help("help-orterun.txt", "orterun:ompi-server-filename-bad", true,
|
2013-03-28 01:09:41 +04:00
|
|
|
"singleton", orte_ess_singleton_server_uri);
|
2010-07-13 10:33:07 +04:00
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
|
|
|
++filename; /* space past the : */
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-07-13 10:33:07 +04:00
|
|
|
if (0 >= strlen(filename)) {
|
|
|
|
/* they forgot to give us the name! */
|
|
|
|
orte_show_help("help-orterun.txt", "orterun:ompi-server-filename-missing", true,
|
2013-03-28 01:09:41 +04:00
|
|
|
"singleton", orte_ess_singleton_server_uri);
|
2010-07-13 10:33:07 +04:00
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-07-13 10:33:07 +04:00
|
|
|
/* open the file and extract the uri */
|
|
|
|
fp = fopen(filename, "r");
|
|
|
|
if (NULL == fp) { /* can't find or read file! */
|
|
|
|
orte_show_help("help-orterun.txt", "orterun:ompi-server-filename-access", true,
|
2013-03-28 01:09:41 +04:00
|
|
|
"singleton", orte_ess_singleton_server_uri);
|
2010-07-13 10:33:07 +04:00
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
2015-04-10 17:54:37 +03:00
|
|
|
memset(input, 0, 1024); // initialize the array to ensure a NULL termination
|
|
|
|
if (NULL == fgets(input, 1023, fp)) {
|
2010-07-13 10:33:07 +04:00
|
|
|
/* something malformed about file */
|
|
|
|
fclose(fp);
|
|
|
|
orte_show_help("help-orterun.txt", "orterun:ompi-server-file-bad", true,
|
2013-03-28 01:09:41 +04:00
|
|
|
"singleton", orte_ess_singleton_server_uri, "singleton");
|
2010-07-13 10:33:07 +04:00
|
|
|
return ORTE_ERROR;
|
|
|
|
}
|
|
|
|
fclose(fp);
|
|
|
|
input[strlen(input)-1] = '\0'; /* remove newline */
|
|
|
|
orte_process_info.my_hnp_uri = strdup(input);
|
|
|
|
} else {
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_process_info.my_hnp_uri = strdup(orte_ess_singleton_server_uri);
|
2010-07-13 10:33:07 +04:00
|
|
|
}
|
|
|
|
/* save the daemon uri - we will process it later */
|
|
|
|
orte_process_info.my_daemon_uri = strdup(orte_process_info.my_hnp_uri);
|
|
|
|
/* for convenience, push the pubsub version of this param into the environ */
|
2015-04-09 19:39:22 +03:00
|
|
|
opal_setenv (OPAL_MCA_PREFIX"pubsub_orte_server", orte_process_info.my_hnp_uri, 1, &environ);
|
2013-10-04 06:58:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/* indicate we are a singleton so orte_init knows what to do */
|
|
|
|
orte_process_info.proc_type |= ORTE_PROC_SINGLETON;
|
2015-03-31 04:10:08 +03:00
|
|
|
/* we were not started by a daemon */
|
|
|
|
orte_standalone_operation = true;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* now define my own name */
|
|
|
|
/* hash the nodename */
|
|
|
|
OPAL_HASH_STR(orte_process_info.nodename, hash32);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
bias = (uint32_t)orte_process_info.pid;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output,
|
|
|
|
"ess:singleton: initial bias %ld nodename hash %lu",
|
|
|
|
(long)bias, (unsigned long)hash32));
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* fold in the bias */
|
|
|
|
hash32 = hash32 ^ bias;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* now compress to 16-bits */
|
|
|
|
jobfam = (uint16_t)(((0x0000ffff & (0xffff0000 & hash32) >> 16)) ^ (0x0000ffff & hash32));
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
OPAL_OUTPUT_VERBOSE((5, orte_ess_base_framework.framework_output,
|
|
|
|
"ess:singleton:: final jobfam %lu",
|
|
|
|
(unsigned long)jobfam));
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* set the name - if we eventually spawn an HNP, it will use
|
|
|
|
* local jobid 0, so offset us by 1
|
|
|
|
*/
|
|
|
|
ORTE_PROC_MY_NAME->jobid = (0xffff0000 & ((uint32_t)jobfam << 16)) + 1;
|
|
|
|
ORTE_PROC_MY_NAME->vpid = 0;
|
2010-04-23 09:51:29 +04:00
|
|
|
|
|
|
|
orte_process_info.num_procs = 1;
|
2011-06-24 00:38:02 +04:00
|
|
|
if (orte_process_info.max_procs < orte_process_info.num_procs) {
|
|
|
|
orte_process_info.max_procs = orte_process_info.num_procs;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* flag that we are not routing since we have no HNP */
|
|
|
|
orte_routing_is_enabled = false;
|
2010-04-23 09:51:29 +04:00
|
|
|
|
2014-04-18 18:25:48 +04:00
|
|
|
/* take a pass thru the session directory code to fillin the
|
|
|
|
* tmpdir names - don't create anything yet
|
|
|
|
*/
|
|
|
|
if (ORTE_SUCCESS != (rc = orte_session_dir(false,
|
|
|
|
orte_process_info.tmpdir_base,
|
|
|
|
orte_process_info.nodename, NULL,
|
|
|
|
ORTE_PROC_MY_NAME))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2014-02-09 06:10:31 +04:00
|
|
|
/* clear the session directory just in case there are
|
|
|
|
* stale directories laying around
|
|
|
|
*/
|
|
|
|
orte_session_dir_cleanup(ORTE_JOBID_WILDCARD);
|
|
|
|
|
2011-10-20 00:18:14 +04:00
|
|
|
/* use the std app init to complete the procedure */
|
2013-10-02 23:03:46 +04:00
|
|
|
if (ORTE_SUCCESS != (rc = orte_ess_base_app_setup(true))) {
|
2010-04-23 09:51:29 +04:00
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
2015-01-27 17:55:17 +03:00
|
|
|
|
|
|
|
/* check and ensure pmix was initialized */
|
|
|
|
if (NULL == opal_pmix.initialized || !opal_pmix.initialized()) {
|
2015-04-09 19:39:22 +03:00
|
|
|
opal_setenv("OMPI_MCA_pmix", "native", 1, &environ);
|
2015-01-27 17:55:17 +03:00
|
|
|
/* tell the pmix framework to allow delayed connection to a server
|
|
|
|
* in case we need one */
|
|
|
|
opal_pmix_base_allow_delayed_server = true;
|
|
|
|
if (OPAL_SUCCESS != (rc = mca_base_framework_open(&opal_pmix_base_framework, 0))) {
|
|
|
|
/* if PMIx is not available even with a delayed
|
|
|
|
* connection to the server, then we are hosed */
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
if (OPAL_SUCCESS != (rc = opal_pmix_base_select()) &&
|
|
|
|
OPAL_ERR_SERVER_NOT_AVAIL != rc) {
|
|
|
|
/* if PMIx is not available even with a delayed
|
|
|
|
* connection to the server, then we are hosed */
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* to the best of our knowledge, we are alone */
|
|
|
|
orte_process_info.my_node_rank = 0;
|
|
|
|
orte_process_info.my_local_rank = 0;
|
|
|
|
|
2012-08-14 02:13:49 +04:00
|
|
|
/* set some envars */
|
2015-04-09 19:39:22 +03:00
|
|
|
opal_setenv("OMPI_NUM_APP_CTX", "1", 1, &environ);
|
|
|
|
opal_setenv("OMPI_FIRST_RANKS", "0", 1, &environ);
|
|
|
|
opal_setenv("OMPI_APP_CTX_NUM_PROCS", "1", 1, &environ);
|
|
|
|
opal_setenv(OPAL_MCA_PREFIX"orte_ess_num_procs", "1", 1, &environ);
|
2012-08-14 02:13:49 +04:00
|
|
|
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
/* push some required info to our local datastore */
|
|
|
|
OBJ_CONSTRUCT(&kvn, opal_value_t);
|
|
|
|
kvn.key = strdup(OPAL_DSTORE_HOSTNAME);
|
|
|
|
kvn.type = OPAL_STRING;
|
|
|
|
kvn.data.string = strdup(orte_process_info.nodename);
|
|
|
|
if (ORTE_SUCCESS != (rc = opal_pmix.put(PMIX_GLOBAL, &kvn))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
|
2015-04-11 00:06:42 +03:00
|
|
|
/* construct the RTE string, if we have one */
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
param = orte_rml.get_contact_info();
|
2015-04-11 00:06:42 +03:00
|
|
|
if (NULL != param) {
|
|
|
|
/* push it out for others to use */
|
|
|
|
OBJ_CONSTRUCT(&kvn, opal_value_t);
|
|
|
|
kvn.key = strdup(OPAL_DSTORE_URI);
|
|
|
|
kvn.type = OPAL_STRING;
|
|
|
|
kvn.data.string = strdup(param);
|
|
|
|
free(param);
|
|
|
|
if (ORTE_SUCCESS != (rc = opal_pmix.put(PMIX_GLOBAL, &kvn))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
return rc;
|
|
|
|
}
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
Per the PMIx RFC:
WHAT: Merge the PMIx branch into the devel repo, creating a new
OPAL “lmix” framework to abstract PMI support for all RTEs.
Replace the ORTE daemon-level collectives with a new PMIx
server and update the ORTE grpcomm framework to support
server-to-server collectives
WHY: We’ve had problems dealing with variations in PMI implementations,
and need to extend the existing PMI definitions to meet exascale
requirements.
WHEN: Mon, Aug 25
WHERE: https://github.com/rhc54/ompi-svn-mirror.git
Several community members have been working on a refactoring of the current PMI support within OMPI. Although the APIs are common, Slurm and Cray implement a different range of capabilities, and package them differently. For example, Cray provides an integrated PMI-1/2 library, while Slurm separates the two and requires the user to specify the one to be used at runtime. In addition, several bugs in the Slurm implementations have caused problems requiring extra coding.
All this has led to a slew of #if’s in the PMI code and bugs when the corner-case logic for one implementation accidentally traps the other. Extending this support to other implementations would have increased this complexity to an unacceptable level.
Accordingly, we have:
* created a new OPAL “pmix” framework to abstract the PMI support, with separate components for Cray, Slurm PMI-1, and Slurm PMI-2 implementations.
* Replaced the current ORTE grpcomm daemon-based collective operation with an integrated PMIx server, and updated the grpcomm APIs to provide more flexible, multi-algorithm support for collective operations. At this time, only the xcast and allgather operations are supported.
* Replaced the current global collective id with a signature based on the names of the participating procs. The allows an unlimited number of collectives to be executed by any group of processes, subject to the requirement that only one collective can be active at a time for a unique combination of procs. Note that a proc can be involved in any number of simultaneous collectives - it is the specific combination of procs that is subject to the constraint
* removed the prior OMPI/OPAL modex code
* added new macros for executing modex send/recv to simplify use of the new APIs. The send macros allow the caller to specify whether or not the BTL supports async modex operations - if so, then the non-blocking “fence” operation is used, if the active PMIx component supports it. Otherwise, the default is a full blocking modex exchange as we currently perform.
* retained the current flag that directs us to use a blocking fence operation, but only to retrieve data upon demand
This commit was SVN r32570.
2014-08-21 22:56:47 +04:00
|
|
|
/* push our local rank */
|
|
|
|
OBJ_CONSTRUCT(&kvn, opal_value_t);
|
|
|
|
kvn.key = strdup(OPAL_DSTORE_LOCALRANK);
|
|
|
|
kvn.type = OPAL_UINT16;
|
|
|
|
kvn.data.uint16 = orte_process_info.my_local_rank;
|
|
|
|
if (ORTE_SUCCESS != (rc = opal_pmix.put(PMIX_GLOBAL, &kvn))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
|
|
|
|
/* push our node rank */
|
|
|
|
OBJ_CONSTRUCT(&kvn, opal_value_t);
|
|
|
|
kvn.key = strdup(OPAL_DSTORE_NODERANK);
|
|
|
|
kvn.type = OPAL_UINT16;
|
|
|
|
kvn.data.uint16 = orte_process_info.my_node_rank;
|
|
|
|
if (ORTE_SUCCESS != (rc = opal_pmix.put(PMIX_GLOBAL, &kvn))) {
|
|
|
|
ORTE_ERROR_LOG(rc);
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
OBJ_DESTRUCT(&kvn);
|
|
|
|
|
2010-04-23 09:51:29 +04:00
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rte_finalize(void)
|
|
|
|
{
|
|
|
|
int ret;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2014-12-03 01:12:24 +03:00
|
|
|
/* mark us as finalized */
|
|
|
|
if (NULL != opal_pmix.finalize) {
|
|
|
|
opal_pmix.finalize();
|
|
|
|
(void) mca_base_framework_close(&opal_pmix_base_framework);
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2010-04-23 09:51:29 +04:00
|
|
|
/* use the default procedure to finish */
|
|
|
|
if (ORTE_SUCCESS != (ret = orte_ess_base_app_finalize())) {
|
|
|
|
ORTE_ERROR_LOG(ret);
|
|
|
|
}
|
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
/* cleanup the environment */
|
2015-04-09 19:39:22 +03:00
|
|
|
opal_unsetenv("OMPI_NUM_APP_CTX", &environ);
|
|
|
|
opal_unsetenv("OMPI_FIRST_RANKS", &environ);
|
|
|
|
opal_unsetenv("OMPI_APP_CTX_NUM_PROCS", &environ);
|
|
|
|
opal_unsetenv(OPAL_MCA_PREFIX"orte_ess_num_procs", &environ);
|
|
|
|
opal_unsetenv(OPAL_MCA_PREFIX"pubsub_orte_server", &environ); // just in case it is there
|
2010-04-23 09:51:29 +04:00
|
|
|
|
2013-10-04 06:58:26 +04:00
|
|
|
return ret;
|
2010-04-23 09:51:29 +04:00
|
|
|
}
|