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.
|
2015-06-24 06:59:57 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2004-11-28 23:09:25 +03:00
|
|
|
* 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.
|
2016-09-07 02:38:15 +03:00
|
|
|
* Copyright (c) 2009-2016 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.
|
2017-06-23 16:22:31 +03:00
|
|
|
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
|
2016-09-02 19:33:34 +03:00
|
|
|
* Copyright (c) 2016 IBM Corporation. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
2004-11-22 04:38:40 +03:00
|
|
|
* Additional copyrights may follow
|
2015-06-24 06:59:57 +03:00
|
|
|
*
|
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"
|
2015-03-17 02:25:01 +03:00
|
|
|
#include "opal/util/if.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"
|
2014-08-01 18:44:11 +04:00
|
|
|
#include "opal/util/proc.h"
|
2008-02-28 04:57:57 +03:00
|
|
|
|
2015-03-17 02:25:01 +03:00
|
|
|
#include "orte/util/attr.h"
|
|
|
|
|
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 = {
|
2014-04-18 21:26:07 +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,
|
|
|
|
.hnp_pid = 0,
|
|
|
|
.app_num = 0,
|
|
|
|
.num_procs = 1,
|
|
|
|
.max_procs = 1,
|
|
|
|
.num_daemons = 1,
|
|
|
|
.num_nodes = 1,
|
|
|
|
.nodename = NULL,
|
2015-03-17 02:25:01 +03:00
|
|
|
.aliases = NULL,
|
2014-04-18 21:26:07 +04:00
|
|
|
.pid = 0,
|
|
|
|
.proc_type = ORTE_PROC_TYPE_NONE,
|
|
|
|
.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,
|
2016-08-16 06:46:46 +03:00
|
|
|
.jobfam_session_dir = NULL,
|
2014-04-18 21:26:07 +04:00
|
|
|
.job_session_dir = NULL,
|
|
|
|
.proc_session_dir = NULL,
|
|
|
|
.sock_stdin = NULL,
|
|
|
|
.sock_stdout = NULL,
|
|
|
|
.sock_stderr = NULL,
|
|
|
|
.cpuset = NULL,
|
|
|
|
.app_rank = -1,
|
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
|
|
|
.my_hostid = ORTE_VPID_INVALID
|
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;
|
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
|
|
|
{
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2013-08-01 04:32:10 +04:00
|
|
|
int idx, i;
|
2013-03-28 01:09:41 +04:00
|
|
|
char *ptr;
|
2016-04-16 03:47:42 +03:00
|
|
|
char hostname[OPAL_MAXHOSTNAMELEN];
|
2013-08-01 04:32:10 +04:00
|
|
|
char **prefixes;
|
|
|
|
bool match;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2008-03-25 05:10:42 +03:00
|
|
|
if (init) {
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
2016-09-16 17:06:58 +03:00
|
|
|
|
2008-03-25 05:10:42 +03:00
|
|
|
init = true;
|
2013-03-28 01:09:41 +04:00
|
|
|
|
2014-08-01 18:44:11 +04:00
|
|
|
OBJ_CONSTRUCT(&orte_process_info.super, opal_proc_t);
|
|
|
|
|
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
|
|
|
|
*/
|
2015-06-24 06:59:57 +03: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);
|
2015-06-24 06:59: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 */
|
2016-04-16 03:47:42 +03:00
|
|
|
gethostname(hostname, sizeof(hostname));
|
2015-03-17 16:26:26 +03:00
|
|
|
/* add this to our list of aliases */
|
|
|
|
opal_argv_append_nosize(&orte_process_info.aliases, hostname);
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2016-09-02 19:33:34 +03:00
|
|
|
// Strip off the FQDN if present, ignore IP addresses
|
|
|
|
if( !orte_keep_fqdn_hostnames && !opal_net_isaddr(hostname) ) {
|
|
|
|
if (NULL != (ptr = strchr(hostname, '.'))) {
|
|
|
|
*ptr = '\0';
|
|
|
|
/* add this to our list of aliases */
|
|
|
|
opal_argv_append_nosize(&orte_process_info.aliases, hostname);
|
2012-11-10 18:05:27 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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",
|
2016-09-21 10:12:35 +03: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,
|
|
|
|
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
|
|
|
|
&orte_strip_prefix);
|
2013-07-31 22:42:02 +04:00
|
|
|
|
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]);
|
|
|
|
}
|
2015-03-17 16:26:26 +03:00
|
|
|
/* add this to our list of aliases */
|
|
|
|
opal_argv_append_nosize(&orte_process_info.aliases, orte_process_info.nodename);
|
2013-08-01 04:32:10 +04:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2015-03-17 16:26:26 +03:00
|
|
|
/* add "localhost" to our list of aliases */
|
|
|
|
opal_argv_append_nosize(&orte_process_info.aliases, "localhost");
|
|
|
|
|
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;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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;
|
|
|
|
}
|
2015-06-24 06:59:57 +03:00
|
|
|
|
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
|
|
|
}
|
2015-06-24 06:59:57 +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;
|
2016-08-16 06:46:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (NULL != orte_process_info.jobfam_session_dir) {
|
|
|
|
free(orte_process_info.jobfam_session_dir);
|
|
|
|
orte_process_info.jobfam_session_dir = NULL;
|
2005-03-19 02:40:08 +03:00
|
|
|
}
|
2015-06-24 06:59:57 +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
|
|
|
}
|
2015-06-24 06:59:57 +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
|
|
|
}
|
2015-06-24 06:59:57 +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
|
|
|
}
|
|
|
|
|
2015-09-24 01:21:04 +03:00
|
|
|
if (NULL != orte_process_info.cpuset) {
|
|
|
|
free(orte_process_info.cpuset);
|
|
|
|
orte_process_info.cpuset = NULL;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
2015-06-24 06:59:57 +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
|
|
|
}
|
2015-06-24 06:59:57 +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;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2015-03-17 02:25:01 +03:00
|
|
|
opal_argv_free(orte_process_info.aliases);
|
2015-06-24 06:59:57 +03: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
|
|
|
}
|
2015-03-17 02:25:01 +03:00
|
|
|
|
|
|
|
bool orte_ifislocal(const char *hostname)
|
|
|
|
{
|
|
|
|
int i;
|
2015-06-24 06:59:57 +03:00
|
|
|
|
2015-03-17 02:25:01 +03:00
|
|
|
/* see if it matches any of our known aliases */
|
|
|
|
if (NULL != orte_process_info.aliases) {
|
|
|
|
for (i=0; NULL != orte_process_info.aliases[i]; i++) {
|
|
|
|
if (0 == strcmp(hostname, orte_process_info.aliases[i])) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* okay, have to resolve the address - the opal_ifislocal
|
|
|
|
* function will not attempt to resolve the address if
|
|
|
|
* told not to do so */
|
|
|
|
if (opal_ifislocal(hostname)) {
|
|
|
|
/* add this to our known aliases */
|
|
|
|
opal_argv_append_nosize(&orte_process_info.aliases, hostname);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* not me */
|
|
|
|
return false;
|
|
|
|
}
|