2004-06-29 08:50:40 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03: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
|
2005-11-05 22:57:48 +03:00
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2009-02-13 07:14:10 +03:00
|
|
|
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
2012-08-01 01:21:50 +04:00
|
|
|
* Copyright (c) 2012 Los Alamos National Security, LLC.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-06-29 08:50:40 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-08-19 03:15:48 +04:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "orte_config.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
#include "orte/constants.h"
|
2004-08-19 03:15:48 +04:00
|
|
|
|
2004-06-29 08:50:40 +04:00
|
|
|
#include <stdio.h>
|
2008-03-24 02:10:15 +03:00
|
|
|
#include <stdlib.h>
|
2004-06-29 08:50:40 +04:00
|
|
|
#include <string.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2004-06-29 08:50:40 +04:00
|
|
|
#include <unistd.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-06-29 11:02:57 +04:00
|
|
|
#include <sys/types.h>
|
2004-10-20 05:03:09 +04:00
|
|
|
#endif
|
2012-08-14 00:44:56 +04:00
|
|
|
#include <ctype.h>
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "opal/mca/base/base.h"
|
2013-03-28 01:09:41 +04:00
|
|
|
#include "opal/mca/base/mca_base_var.h"
|
2013-08-01 04:32:10 +04:00
|
|
|
#include "opal/util/argv.h"
|
2012-11-10 18:05:27 +04:00
|
|
|
#include "opal/util/net.h"
|
2008-06-18 12:10:02 +04:00
|
|
|
#include "opal/util/output.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/util/proc_info.h"
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2012-11-10 18:05:27 +04:00
|
|
|
/* provide a connection to a reqd variable */
|
|
|
|
extern bool orte_keep_fqdn_hostnames;
|
|
|
|
|
2011-08-27 02:16:14 +04:00
|
|
|
#define ORTE_NAME_INVALID {ORTE_JOBID_INVALID, ORTE_VPID_INVALID}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
ORTE_DECLSPEC orte_proc_info_t orte_process_info = {
|
2012-08-14 00:44:56 +04:00
|
|
|
/* .my_name = */ ORTE_NAME_INVALID,
|
|
|
|
/* .my_daemon = */ ORTE_NAME_INVALID,
|
|
|
|
/* .my_daemon_uri = */ NULL,
|
|
|
|
/* .my_hnp = */ ORTE_NAME_INVALID,
|
|
|
|
/* .my_hnp_uri = */ NULL,
|
|
|
|
/* .my_parent = */ ORTE_NAME_INVALID,
|
2014-02-14 03:30:04 +04:00
|
|
|
/* .my_scheduler = */ ORTE_NAME_INVALID,
|
2012-08-14 00:44:56 +04:00
|
|
|
/* .hnp_pid = */ 0,
|
|
|
|
/* .app_num = */ 0,
|
|
|
|
/* .num_procs = */ 1,
|
|
|
|
/* .max_procs = */ 1,
|
|
|
|
/* .num_daemons = */ 1,
|
|
|
|
/* .num_nodes = */ 1,
|
|
|
|
/* .nodename = */ NULL,
|
|
|
|
/* .pid = */ 0,
|
|
|
|
/* .proc_type = */ ORTE_PROC_TYPE_NONE,
|
|
|
|
/* .sync_buf = */ NULL,
|
|
|
|
/* .my_port = */ 0,
|
|
|
|
/* .num_restarts = */ 0,
|
|
|
|
/* .my_node_rank = */ ORTE_NODE_RANK_INVALID,
|
|
|
|
/* .my_local_rank = */ ORTE_LOCAL_RANK_INVALID,
|
|
|
|
/* .num_local_peers = */ 0,
|
|
|
|
/* .tmpdir_base = */ NULL,
|
|
|
|
/* .top_session_dir = */ NULL,
|
|
|
|
/* .job_session_dir = */ NULL,
|
|
|
|
/* .proc_session_dir = */ NULL,
|
|
|
|
/* .sock_stdin = */ NULL,
|
|
|
|
/* .sock_stdout = */ NULL,
|
|
|
|
/* .sock_stderr = */ NULL,
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 07:40:11 +04:00
|
|
|
#if OPAL_HAVE_HWLOC
|
2013-03-26 22:27:50 +04:00
|
|
|
/* .cpuset = */ NULL,
|
At long last, the fabled revision to the affinity system has arrived. A more detailed explanation of how this all works will be presented here:
https://svn.open-mpi.org/trac/ompi/wiki/ProcessPlacement
The wiki page is incomplete at the moment, but I hope to complete it over the next few days. I will provide updates on the devel list. As the wiki page states, the default and most commonly used options remain unchanged (except as noted below). New, esoteric and complex options have been added, but unless you are a true masochist, you are unlikely to use many of them beyond perhaps an initial curiosity-motivated experimentation.
In a nutshell, this commit revamps the map/rank/bind procedure to take into account topology info on the compute nodes. I have, for the most part, preserved the default behaviors, with three notable exceptions:
1. I have at long last bowed my head in submission to the system admin's of managed clusters. For years, they have complained about our default of allowing users to oversubscribe nodes - i.e., to run more processes on a node than allocated slots. Accordingly, I have modified the default behavior: if you are running off of hostfile/dash-host allocated nodes, then the default is to allow oversubscription. If you are running off of RM-allocated nodes, then the default is to NOT allow oversubscription. Flags to override these behaviors are provided, so this only affects the default behavior.
2. both cpus/rank and stride have been removed. The latter was demanded by those who didn't understand the purpose behind it - and I agreed as the users who requested it are no longer using it. The former was removed temporarily pending implementation.
3. vm launch is now the sole method for starting OMPI. It was just too darned hard to maintain multiple launch procedures - maybe someday, provided someone can demonstrate a reason to do so.
As Jeff stated, it is impossible to fully test a change of this size. I have tested it on Linux and Mac, covering all the default and simple options, singletons, and comm_spawn. That said, I'm sure others will find problems, so I'll be watching MTT results until this stabilizes.
This commit was SVN r25476.
2011-11-15 07:40:11 +04:00
|
|
|
#endif
|
2012-08-14 00:44:56 +04:00
|
|
|
/* .app_rank = */ -1,
|
|
|
|
/* .peer_modex = */ -1,
|
|
|
|
/* .peer_init_barrier = */ -1,
|
****************************************************************
This change contains a non-mandatory modification
of the MPI-RTE interface. Anyone wishing to support
coprocessors such as the Xeon Phi may wish to add
the required definition and underlying support
****************************************************************
Add locality support for coprocessors such as the Intel Xeon Phi.
Detecting that we are on a coprocessor inside of a host node isn't straightforward. There are no good "hooks" provided for programmatically detecting that "we are on a coprocessor running its own OS", and the ORTE daemon just thinks it is on another node. However, in order to properly use the Phi's public interface for MPI transport, it is necessary that the daemon detect that it is colocated with procs on the host.
So we have to split the locality to separately record "on the same host" vs "on the same board". We already have the board-level locality flag, but not quite enough flexibility to handle this use-case. Thus, do the following:
1. add OPAL_PROC_ON_HOST flag to indicate we share a host, but not necessarily the same board
2. modify OPAL_PROC_ON_NODE to indicate we share both a host AND the same board. Note that we have to modify the OPAL_PROC_ON_LOCAL_NODE macro to explicitly check both conditions
3. add support in opal/mca/hwloc/base/hwloc_base_util.c for the host to check for coprocessors, and for daemons to check to see if they are on a coprocessor. The former is done via hwloc, but support for the latter is not yet provided by hwloc. So the code for detecting we are on a coprocessor currently is Xeon Phi specific - hopefully, we will find more generic methods in the future.
4. modify the orted and the hnp startup so they check for coprocessors and to see if they are on a coprocessor, and have the orteds pass that info back in their callback message. Automatically detect that coprocessors have been found and identify which coprocessors are on which hosts. Note that this algo isn't scalable at the moment - this will hopefully be improved over time.
5. modify the ompi proc locality detection function to look for coprocessor host info IF the OMPI_RTE_HOST_ID database key has been defined. RTE's that choose not to provide this support do not have to do anything - the associated code will simply be ignored.
6. include some cleanup of the hwloc open/close code so it conforms to how we did things in other frameworks (e.g., having a single "frame" file instead of open/close). Also, fix the locality flags - e.g., being on the same node means you must also be on the same cluster/cu, so ensure those flags are also set.
cmr:v1.7.4:reviewer=hjelmn
This commit was SVN r29435.
2013-10-14 20:52:58 +04:00
|
|
|
/* .peer_fini_barrier = */ -1,
|
|
|
|
/* .my_hostid = */ ORTE_VPID_INVALID
|
2014-02-04 18:03:05 +04:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
|
|
|
/* .snapc_init_barrier = */ -1,
|
|
|
|
/* .snapc_fini_barrier = */ -1,
|
|
|
|
#endif
|
2005-05-22 07:11:33 +04:00
|
|
|
};
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2008-03-25 05:10:42 +03:00
|
|
|
static bool init=false;
|
2013-03-28 01:09:41 +04:00
|
|
|
static int orte_ess_node_rank;
|
|
|
|
static int orte_peer_modex_id;
|
|
|
|
static int orte_peer_init_barrier_id;
|
|
|
|
static int orte_peer_fini_barrier_id;
|
2014-02-04 18:03:05 +04:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
|
|
|
static int orte_snapc_init_barrier_id;
|
|
|
|
static int orte_snapc_fini_barrier_id;
|
|
|
|
#endif
|
2013-07-31 22:42:02 +04:00
|
|
|
static char *orte_strip_prefix;
|
2004-06-29 08:50:40 +04:00
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
int orte_proc_info(void)
|
2004-06-29 08:50:40 +04:00
|
|
|
{
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2013-08-01 04:32:10 +04:00
|
|
|
int idx, i;
|
2013-03-28 01:09:41 +04:00
|
|
|
char *ptr;
|
2008-03-24 02:10:15 +03:00
|
|
|
char hostname[ORTE_MAX_HOSTNAME_SIZE];
|
2013-08-01 04:32:10 +04:00
|
|
|
char **prefixes;
|
|
|
|
bool match;
|
|
|
|
|
2008-03-25 05:10:42 +03:00
|
|
|
if (init) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
init = true;
|
2013-03-28 01:09:41 +04:00
|
|
|
|
|
|
|
orte_process_info.my_hnp_uri = NULL;
|
|
|
|
mca_base_var_register ("orte", "orte", NULL, "hnp_uri",
|
|
|
|
"HNP contact info",
|
|
|
|
MCA_BASE_VAR_TYPE_STRING, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_process_info.my_hnp_uri);
|
|
|
|
|
|
|
|
if (NULL != orte_process_info.my_hnp_uri) {
|
|
|
|
ptr = orte_process_info.my_hnp_uri;
|
2008-02-28 04:57:57 +03:00
|
|
|
/* the uri value passed to us will have quote marks around it to protect
|
|
|
|
* the value if passed on the command line. We must remove those
|
|
|
|
* to have a correct uri string
|
|
|
|
*/
|
2013-03-28 01:09:41 +04:00
|
|
|
if ('"' == ptr[0]) {
|
2008-02-28 04:57:57 +03:00
|
|
|
/* if the first char is a quote, then so will the last one be */
|
2013-03-28 01:09:41 +04:00
|
|
|
ptr[strlen(ptr)-1] = '\0';
|
|
|
|
memmove (ptr, ptr + 1, strlen (ptr));
|
2008-02-28 04:57:57 +03:00
|
|
|
}
|
|
|
|
}
|
2013-03-28 01:09:41 +04:00
|
|
|
|
|
|
|
orte_process_info.my_daemon_uri = NULL;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "local_daemon_uri",
|
|
|
|
"Daemon contact info",
|
|
|
|
MCA_BASE_VAR_TYPE_STRING, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_process_info.my_daemon_uri);
|
|
|
|
|
|
|
|
if (NULL != orte_process_info.my_daemon_uri) {
|
|
|
|
ptr = orte_process_info.my_daemon_uri;
|
2009-02-09 23:40:17 +03:00
|
|
|
/* the uri value passed to us may have quote marks around it to protect
|
|
|
|
* the value if passed on the command line. We must remove those
|
|
|
|
* to have a correct uri string
|
|
|
|
*/
|
2013-03-28 01:09:41 +04:00
|
|
|
if ('"' == ptr[0]) {
|
2009-02-09 23:40:17 +03:00
|
|
|
/* if the first char is a quote, then so will the last one be */
|
2013-03-28 01:09:41 +04:00
|
|
|
ptr[strlen(ptr)-1] = '\0';
|
|
|
|
memmove (ptr, ptr + 1, strlen (ptr) - 1);
|
2009-02-09 23:40:17 +03:00
|
|
|
}
|
|
|
|
}
|
2013-03-28 01:09:41 +04:00
|
|
|
|
|
|
|
orte_process_info.app_num = 0;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "app_num",
|
|
|
|
"Index of the app_context that defines this proc",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_process_info.app_num);
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
/* get the process id */
|
2009-03-06 00:56:03 +03:00
|
|
|
orte_process_info.pid = getpid();
|
2004-07-14 22:08:34 +04:00
|
|
|
|
2012-11-10 18:05:27 +04:00
|
|
|
/* get the nodename */
|
|
|
|
gethostname(hostname, ORTE_MAX_HOSTNAME_SIZE);
|
|
|
|
if (!orte_keep_fqdn_hostnames) {
|
|
|
|
/* if the nodename is an IP address, do not mess with it! */
|
|
|
|
if (!opal_net_isaddr(hostname)) {
|
|
|
|
/* not an IP address, so remove any domain info */
|
|
|
|
if (NULL != (ptr = strchr(hostname, '.'))) {
|
|
|
|
*ptr = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-01 04:32:10 +04:00
|
|
|
orte_strip_prefix = NULL;
|
2013-07-31 22:42:02 +04:00
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "strip_prefix",
|
2013-08-01 04:32:10 +04:00
|
|
|
"Prefix(es) to match when deciding whether to strip leading characters and zeroes from "
|
|
|
|
"node names returned by daemons", MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
|
2013-07-31 22:42:02 +04:00
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_strip_prefix);
|
|
|
|
|
2012-08-14 00:44:56 +04:00
|
|
|
/* we have to strip node names here, if user directs, to ensure that
|
|
|
|
* the names exchanged in the modex match the names found locally
|
|
|
|
*/
|
2013-08-01 04:32:10 +04:00
|
|
|
if (NULL != orte_strip_prefix) {
|
|
|
|
prefixes = opal_argv_split(orte_strip_prefix, ',');
|
|
|
|
match = false;
|
|
|
|
for (i=0; NULL != prefixes[i]; i++) {
|
|
|
|
if (0 == strncmp(hostname, prefixes[i], strlen(prefixes[i]))) {
|
|
|
|
/* remove the prefix and leading zeroes */
|
|
|
|
idx = strlen(prefixes[i]);
|
|
|
|
while (idx < (int)strlen(hostname) &&
|
|
|
|
(hostname[idx] <= '0' || '9' < hostname[idx])) {
|
|
|
|
idx++;
|
|
|
|
}
|
|
|
|
if ((int)strlen(hostname) <= idx) {
|
|
|
|
/* there were no non-zero numbers in the name */
|
|
|
|
orte_process_info.nodename = strdup(&hostname[strlen(prefixes[i])]);
|
|
|
|
} else {
|
|
|
|
orte_process_info.nodename = strdup(&hostname[idx]);
|
|
|
|
}
|
|
|
|
match = true;
|
|
|
|
break;
|
|
|
|
}
|
2012-08-14 00:44:56 +04:00
|
|
|
}
|
2013-08-01 04:32:10 +04:00
|
|
|
/* if we didn't find a match, then just use the hostname as-is */
|
|
|
|
if (!match) {
|
2012-08-14 00:44:56 +04:00
|
|
|
orte_process_info.nodename = strdup(hostname);
|
|
|
|
}
|
2013-08-01 04:32:10 +04:00
|
|
|
opal_argv_free(prefixes);
|
2012-08-14 00:44:56 +04:00
|
|
|
} else {
|
|
|
|
orte_process_info.nodename = strdup(hostname);
|
|
|
|
}
|
|
|
|
|
2009-02-19 23:45:07 +03:00
|
|
|
/* get the number of nodes in the job */
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_process_info.num_nodes = 1;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "num_nodes",
|
|
|
|
"Number of nodes in the job",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_process_info.num_nodes);
|
|
|
|
|
2010-01-10 05:21:30 +03:00
|
|
|
/* get the number of times this proc has restarted */
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_process_info.num_restarts = 0;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "num_restarts",
|
|
|
|
"Number of times this proc has restarted",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_process_info.num_restarts);
|
|
|
|
|
|
|
|
orte_process_info.app_rank = 0;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "app_rank",
|
|
|
|
"Rank of this proc within its app_context",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_process_info.app_rank);
|
2011-06-17 18:50:00 +04:00
|
|
|
|
2011-10-20 00:18:14 +04:00
|
|
|
/* get my node rank in case we are using static ports - this won't
|
|
|
|
* be present for daemons, so don't error out if we don't have it
|
|
|
|
*/
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_ess_node_rank = ORTE_NODE_RANK_INVALID;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "ess_node_rank", "Process node rank",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_CONSTANT,
|
|
|
|
&orte_ess_node_rank);
|
|
|
|
orte_process_info.my_node_rank = (orte_node_rank_t) orte_ess_node_rank;
|
2011-10-20 00:18:14 +04:00
|
|
|
|
2008-04-30 23:49:53 +04:00
|
|
|
/* setup the sync buffer */
|
2009-03-06 00:56:03 +03:00
|
|
|
orte_process_info.sync_buf = OBJ_NEW(opal_buffer_t);
|
2008-03-24 02:10:15 +03:00
|
|
|
|
2012-04-06 18:23:13 +04:00
|
|
|
/* get the collective id info */
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_peer_modex_id = -1;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "peer_modex_id", "Peer modex collective id",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_CONSTANT,
|
|
|
|
&orte_peer_modex_id);
|
|
|
|
orte_process_info.peer_modex = (orte_grpcomm_coll_id_t) orte_peer_modex_id;
|
2012-04-06 18:23:13 +04:00
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_peer_init_barrier_id = -1;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "peer_init_barrier_id", "Peer init barrier collective id",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_CONSTANT,
|
|
|
|
&orte_peer_init_barrier_id);
|
|
|
|
orte_process_info.peer_init_barrier = (orte_grpcomm_coll_id_t) orte_peer_init_barrier_id;
|
2012-04-06 18:23:13 +04:00
|
|
|
|
2013-03-28 01:09:41 +04:00
|
|
|
orte_peer_fini_barrier_id = -1;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "peer_fini_barrier_id", "Peer finalize barrier collective id",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_CONSTANT,
|
|
|
|
&orte_peer_fini_barrier_id);
|
|
|
|
orte_process_info.peer_fini_barrier = (orte_grpcomm_coll_id_t) orte_peer_fini_barrier_id;
|
2012-04-06 18:23:13 +04:00
|
|
|
|
2014-02-04 18:03:05 +04:00
|
|
|
#if OPAL_ENABLE_FT_CR == 1
|
|
|
|
orte_snapc_init_barrier_id = -1;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "snapc_init_barrier_id", "SNAPC init barrier collective id",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_CONSTANT,
|
|
|
|
&orte_snapc_init_barrier_id);
|
|
|
|
orte_process_info.snapc_init_barrier = (orte_grpcomm_coll_id_t) orte_snapc_init_barrier_id;
|
|
|
|
|
|
|
|
orte_snapc_fini_barrier_id = -1;
|
|
|
|
(void) mca_base_var_register ("orte", "orte", NULL, "snapc_fini_barrier_id", "SNAPC finalize barrier collective id",
|
|
|
|
MCA_BASE_VAR_TYPE_INT, NULL, 0,
|
|
|
|
MCA_BASE_VAR_FLAG_INTERNAL,
|
|
|
|
OPAL_INFO_LVL_9,
|
|
|
|
MCA_BASE_VAR_SCOPE_CONSTANT,
|
|
|
|
&orte_snapc_fini_barrier_id);
|
|
|
|
orte_process_info.snapc_fini_barrier = (orte_grpcomm_coll_id_t) orte_snapc_fini_barrier_id;
|
|
|
|
#endif
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
return ORTE_SUCCESS;
|
2004-06-29 08:50:40 +04:00
|
|
|
}
|
2005-03-19 02:40:08 +03:00
|
|
|
|
|
|
|
|
|
|
|
int orte_proc_info_finalize(void)
|
|
|
|
{
|
2008-03-25 05:10:42 +03:00
|
|
|
if (!init) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.tmpdir_base) {
|
|
|
|
free(orte_process_info.tmpdir_base);
|
|
|
|
orte_process_info.tmpdir_base = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.top_session_dir) {
|
|
|
|
free(orte_process_info.top_session_dir);
|
|
|
|
orte_process_info.top_session_dir = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.job_session_dir) {
|
|
|
|
free(orte_process_info.job_session_dir);
|
|
|
|
orte_process_info.job_session_dir = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.proc_session_dir) {
|
|
|
|
free(orte_process_info.proc_session_dir);
|
|
|
|
orte_process_info.proc_session_dir = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.nodename) {
|
|
|
|
free(orte_process_info.nodename);
|
|
|
|
orte_process_info.nodename = NULL;
|
2008-03-24 02:10:15 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.sock_stdin) {
|
|
|
|
free(orte_process_info.sock_stdin);
|
|
|
|
orte_process_info.sock_stdin = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.sock_stdout) {
|
|
|
|
free(orte_process_info.sock_stdout);
|
|
|
|
orte_process_info.sock_stdout = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
if (NULL != orte_process_info.sock_stderr) {
|
|
|
|
free(orte_process_info.sock_stderr);
|
|
|
|
orte_process_info.sock_stderr = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
|
|
|
|
2009-05-04 15:07:40 +04:00
|
|
|
orte_process_info.proc_type = ORTE_PROC_TYPE_NONE;
|
2005-05-22 07:11:33 +04:00
|
|
|
|
2009-03-06 00:56:03 +03:00
|
|
|
OBJ_RELEASE(orte_process_info.sync_buf);
|
|
|
|
orte_process_info.sync_buf = NULL;
|
2008-05-01 21:48:13 +04:00
|
|
|
|
2008-03-25 05:10:42 +03:00
|
|
|
init = false;
|
2005-03-19 02:40:08 +03:00
|
|
|
return ORTE_SUCCESS;
|
2005-03-22 03:31:17 +03:00
|
|
|
}
|