Skip to content

Commit 61a71e2

Browse files
author
Ralph Castain
committed
Ensure the backend daemons know if we are in a managed allocation and if
the HNP was included in the allocation Signed-off-by: Ralph Castain <[email protected]>
1 parent 330b11c commit 61a71e2

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

orte/mca/rmaps/base/rmaps_base_support_fns.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
1414
* All rights reserved.
15-
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
1616
* Copyright (c) 2016 IBM Corporation. All rights reserved.
1717
* $COPYRIGHT$
1818
*
@@ -340,7 +340,7 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
340340
goto complete;
341341
}
342342

343-
addknown:
343+
addknown:
344344
/* if the hnp was allocated, include it unless flagged not to */
345345
if (orte_hnp_is_allocated && !(ORTE_GET_MAPPING_DIRECTIVE(policy) & ORTE_MAPPING_NO_USE_LOCAL)) {
346346
if (NULL != (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool, 0))) {
@@ -416,7 +416,7 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
416416
ORTE_FLAG_UNSET(node, ORTE_NODE_FLAG_MAPPED);
417417
}
418418
if (NULL == nd || NULL == nd->daemon ||
419-
NULL == node->daemon ||
419+
NULL == node->daemon ||
420420
nd->daemon->name.vpid < node->daemon->name.vpid) {
421421
/* just append to end */
422422
opal_list_append(allocated_nodes, &node->super);
@@ -476,7 +476,7 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
476476
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
477477
(int)opal_list_get_size(allocated_nodes)));
478478

479-
complete:
479+
complete:
480480
/* remove all nodes that are already at max usage, and
481481
* compute the total number of allocated slots while
482482
* we do so */

orte/util/nidmap.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ int orte_util_encode_nodemap(opal_buffer_t *buffer)
186186
char **regexargs = NULL, *tmp, *tmp2;
187187
orte_node_t *nptr;
188188
int rc;
189+
uint8_t ui8;
189190

190191
/* setup the list of results */
191192
OBJ_CONSTRUCT(&nodenms, opal_list_t);
@@ -594,6 +595,28 @@ int orte_util_encode_nodemap(opal_buffer_t *buffer)
594595
free(tmp);
595596
}
596597

598+
/* pack a flag indicating if the HNP was included in the allocation */
599+
if (orte_hnp_is_allocated) {
600+
ui8 = 1;
601+
} else {
602+
ui8 = 0;
603+
}
604+
if (ORTE_SUCCESS != (rc = opal_dss.pack(buffer, &ui8, 1, OPAL_UINT8))) {
605+
ORTE_ERROR_LOG(rc);
606+
return rc;
607+
}
608+
609+
/* pack a flag indicating if we are in a managed allocation */
610+
if (orte_managed_allocation) {
611+
ui8 = 1;
612+
} else {
613+
ui8 = 0;
614+
}
615+
if (ORTE_SUCCESS != (rc = opal_dss.pack(buffer, &ui8, 1, OPAL_UINT8))) {
616+
ORTE_ERROR_LOG(rc);
617+
return rc;
618+
}
619+
597620
/* handle the topologies - as the most common case by far
598621
* is to have homogeneous topologies, we only send them
599622
* if something is different */
@@ -684,6 +707,7 @@ int orte_util_decode_daemon_nodemap(opal_buffer_t *buffer)
684707
opal_buffer_t *bptr=NULL;
685708
orte_topology_t *t;
686709
orte_regex_range_t *rng, *drng, *srng, *frng;
710+
uint8_t ui8;
687711

688712
/* unpack the node regex */
689713
n = 1;
@@ -739,6 +763,30 @@ int orte_util_decode_daemon_nodemap(opal_buffer_t *buffer)
739763
goto cleanup;
740764
}
741765

766+
/* unpack the flag indicating if the HNP was allocated */
767+
n = 1;
768+
if (ORTE_SUCCESS != (rc = opal_dss.unpack(buffer, &ui8, &n, OPAL_UINT8))) {
769+
ORTE_ERROR_LOG(rc);
770+
goto cleanup;
771+
}
772+
if (0 == ui8) {
773+
orte_hnp_is_allocated = false;
774+
} else {
775+
orte_hnp_is_allocated = true;
776+
}
777+
778+
/* unpack the flag indicating we are in a managed allocation */
779+
n = 1;
780+
if (ORTE_SUCCESS != (rc = opal_dss.unpack(buffer, &ui8, &n, OPAL_UINT8))) {
781+
ORTE_ERROR_LOG(rc);
782+
goto cleanup;
783+
}
784+
if (0 == ui8) {
785+
orte_managed_allocation = false;
786+
} else {
787+
orte_managed_allocation = true;
788+
}
789+
742790
/* unpack the topos regex - this may not have been
743791
* provided (e.g., for a homogeneous machine) */
744792
n = 1;

0 commit comments

Comments
 (0)