11
11
* All rights reserved.
12
12
* Copyright (c) 2011-2012 Los Alamos National Security, LLC. All rights
13
13
* reserved.
14
- * Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
14
+ * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
15
15
* Copyright (c) 2015 Research Organization for Information Science
16
16
* and Technology (RIST). All rights reserved.
17
17
* $COPYRIGHT$
30
30
#include "opal/util/if.h"
31
31
32
32
#include "orte/mca/errmgr/errmgr.h"
33
+ #include "orte/mca/rmaps/base/base.h"
33
34
#include "orte/util/name_fns.h"
34
35
#include "orte/runtime/orte_globals.h"
35
36
@@ -46,7 +47,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
46
47
int rc , i ;
47
48
orte_node_t * node , * hnp_node , * nptr ;
48
49
char * ptr ;
49
- bool hnp_alone = true;
50
+ bool hnp_alone = true, skiphnp = false ;
50
51
orte_attribute_t * kv ;
51
52
char * * alias = NULL , * * nalias ;
52
53
@@ -77,6 +78,33 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
77
78
78
79
/* get the hnp node's info */
79
80
hnp_node = (orte_node_t * )opal_pointer_array_get_item (orte_node_pool , 0 );
81
+ #if SLURM_CRAY_ENV
82
+ /* if we are in a Cray-SLURM environment, then we cannot
83
+ * launch procs local to the HNP. The problem
84
+ * is the MPI processes launched on the head node (where the
85
+ * ORTE_PROC_IS_HNP evalues to true) get launched by a daemon
86
+ * (mpirun) which is not a child of a slurmd daemon. This
87
+ * means that any RDMA credentials obtained via the odls/alps
88
+ * local launcher are incorrect. Test for this condition. If
89
+ * found, then take steps to ensure we launch a daemon on
90
+ * the same node as mpirun and that it gets used to fork
91
+ * local procs instead of mpirun so they get the proper
92
+ * credential */
93
+ if (NULL != hnp_node ) {
94
+ OPAL_LIST_FOREACH (node , nodes , orte_node_t ) {
95
+ if (orte_ifislocal (node -> name )) {
96
+ orte_hnp_is_allocated = true;
97
+ break ;
98
+ }
99
+ }
100
+ if (orte_hnp_is_allocated && !(ORTE_GET_MAPPING_DIRECTIVE (orte_rmaps_base .mapping ) & ORTE_MAPPING_NO_USE_LOCAL )) {
101
+ hnp_node -> name = strdup ("mpirun" );
102
+ skiphnp = true;
103
+ ORTE_SET_MAPPING_DIRECTIVE (orte_rmaps_base .mapping , ORTE_MAPPING_NO_USE_LOCAL );
104
+ }
105
+ }
106
+ #endif
107
+
80
108
81
109
/* cycle through the list */
82
110
while (NULL != (item = opal_list_remove_first (nodes ))) {
@@ -86,7 +114,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
86
114
* first position since it is the first one entered. We need to check to see
87
115
* if this node is the same as the HNP's node so we don't double-enter it
88
116
*/
89
- if (NULL != hnp_node && orte_ifislocal (node -> name )) {
117
+ if (! skiphnp && NULL != hnp_node && orte_ifislocal (node -> name )) {
90
118
OPAL_OUTPUT_VERBOSE ((5 , orte_ras_base_framework .framework_output ,
91
119
"%s ras:base:node_insert updating HNP [%s] info to %ld slots" ,
92
120
ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
@@ -189,7 +217,7 @@ int orte_ras_base_node_insert(opal_list_t* nodes, orte_job_t *jdata)
189
217
* ensure we don't have any domain info in the node record
190
218
* for the hnp
191
219
*/
192
- if (!orte_have_fqdn_allocation && !hnp_alone ) {
220
+ if (NULL != hnp_node && !orte_have_fqdn_allocation && !hnp_alone ) {
193
221
if (NULL != (ptr = strchr (hnp_node -> name , '.' ))) {
194
222
* ptr = '\0' ;
195
223
}
0 commit comments