Skip to content

Commit 91d714f

Browse files
author
Ralph Castain
committed
Add flags to direct PMIx to only use one listener, but without directing which one (tcp or usock) to use. This allows the user to set PMIX_MCA_ptl in their environment to select the transport method.
Signed-off-by: Ralph Castain <[email protected]>
1 parent f355fb9 commit 91d714f

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

opal/mca/pmix/pmix2x/pmix/include/pmix_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ typedef uint32_t pmix_rank_t;
134134
/* attributes for the USOCK rendezvous socket */
135135
#define PMIX_USOCK_DISABLE "pmix.usock.disable" // (bool) disable legacy usock support
136136
#define PMIX_SOCKET_MODE "pmix.sockmode" // (uint32_t) POSIX mode_t (9 bits valid)
137+
#define PMIX_SINGLE_LISTENER "pmix.sing.listnr" // (bool) use only one rendezvous socket, letting priorities and/or
138+
// MCA param select the active transport
137139

138140
/* attributes for TCP connections */
139141
#define PMIX_TCP_URI "pmix.tcp.uri" // (char*) URI of server to connect to

opal/mca/pmix/pmix2x/pmix/src/mca/ptl/base/ptl_base_listener.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
3+
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
44
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014-2015 Artem Y. Polyakov <[email protected]>.
@@ -69,17 +69,33 @@ static pmix_status_t setup_listeners(pmix_info_t *info, size_t ninfo, bool *need
6969
{
7070
pmix_ptl_base_active_t *active;
7171
pmix_status_t rc;
72+
size_t n;
73+
bool single = false;
7274

7375
if (!pmix_ptl_globals.initialized) {
7476
return PMIX_ERR_INIT;
7577
}
7678

79+
/* scan the directives to see if they want only one listener setup */
80+
if (NULL != info) {
81+
for (n=0; n < ninfo; n++) {
82+
if (0 == strncmp(info[n].key, PMIX_SINGLE_LISTENER, PMIX_MAX_KEYLEN) &&
83+
(PMIX_UNDEF == info[n].value.type || info[n].value.data.flag)) {
84+
single = true;
85+
break;
86+
}
87+
}
88+
}
89+
7790
PMIX_LIST_FOREACH(active, &pmix_ptl_globals.actives, pmix_ptl_base_active_t) {
7891
if (NULL != active->component->setup_listener) {
7992
rc = active->component->setup_listener(info, ninfo, need_listener);
8093
if (PMIX_SUCCESS != rc && PMIX_ERR_NOT_AVAILABLE != rc) {
8194
return rc;
8295
}
96+
if (single) {
97+
return PMIX_SUCCESS;
98+
}
8399
}
84100
}
85101
/* we must have at least one listener */

opal/mca/pmix/pmix_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ BEGIN_C_DECLS
6464
/* attributes for the rendezvous socket */
6565
#define OPAL_PMIX_USOCK_DISABLE "pmix.usock.disable" // (bool) disable legacy usock support
6666
#define OPAL_PMIX_SOCKET_MODE "pmix.sockmode" // (uint32_t) POSIX mode_t (9 bits valid)
67+
#define OPAL_PMIX_SINGLE_LISTENER "pmix.sing.listnr" // (bool) use only one rendezvous socket, letting priorities and/or
68+
// MCA param select the active transport
6769

6870
/* attributes for TCP connections */
6971
#define OPAL_PMIX_TCP_URI "pmix.tcp.uri" // (char*) URI of server to connect to

orte/orted/pmix/pmix_server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* All rights reserved.
1414
* Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
1515
* Copyright (c) 2011 Oak Ridge National Labs. All rights reserved.
16-
* Copyright (c) 2013-2016 Intel, Inc. All rights reserved.
16+
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
1717
* Copyright (c) 2014 Mellanox Technologies, Inc.
1818
* All rights reserved.
1919
* Copyright (c) 2014-2015 Research Organization for Information Science
@@ -272,9 +272,9 @@ int pmix_server_init(void)
272272
kv->type = OPAL_STRING;
273273
kv->data.string = strdup(orte_process_info.tmpdir_base);
274274
opal_list_append(&info, &kv->super);
275-
/* disable usock */
275+
/* use only one listener */
276276
kv = OBJ_NEW(opal_value_t);
277-
kv->key = strdup(OPAL_PMIX_USOCK_DISABLE);
277+
kv->key = strdup(OPAL_PMIX_SINGLE_LISTENER);
278278
kv->type = OPAL_BOOL;
279279
kv->data.flag = true;
280280
opal_list_append(&info, &kv->super);

0 commit comments

Comments
 (0)