Skip to content

Commit 1641f5c

Browse files
committed
rmaps/mindist: fix pmix errors
Fixed the case were only part of the nodes in the allocation are used by the applicaton proccesses. Force PMIx nodemap key to only contain nodes that are actually used by the application proccesses. Signed-off-by: Boris Karasev <[email protected]> (cherry picked from commit 5fb3e0a)
1 parent fba6ac6 commit 1641f5c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

orte/mca/rmaps/mindist/rmaps_mindist_module.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,21 @@ static int mindist_map(orte_job_t *jdata)
279279
break;
280280
}
281281
}
282-
opal_output_verbose(2, orte_rmaps_base_framework.framework_output,
283-
"mca:rmaps:mindist: assigned %d procs to node %s",
284-
j, node->name);
282+
if (0 != j) {
283+
/* add the node to the map, if needed */
284+
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_MAPPED)) {
285+
if (ORTE_SUCCESS > (rc = opal_pointer_array_add(jdata->map->nodes, (void*)node))) {
286+
ORTE_ERROR_LOG(rc);
287+
goto error;
288+
}
289+
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_MAPPED);
290+
OBJ_RETAIN(node); /* maintain accounting on object */
291+
jdata->map->num_nodes++;
292+
}
293+
opal_output_verbose(2, orte_rmaps_base_framework.framework_output,
294+
"mca:rmaps:mindist: assigned %d procs to node %s",
295+
j, node->name);
296+
}
285297
} else {
286298
if (hwloc_get_nbobjs_by_type(node->topology, HWLOC_OBJ_SOCKET) > 1) {
287299
/* don't have info about pci locality */
@@ -303,18 +315,6 @@ static int mindist_map(orte_job_t *jdata)
303315
num_procs_to_assign--;
304316
}
305317
}
306-
307-
/* add the node to the map, if needed */
308-
if (!ORTE_FLAG_TEST(node, ORTE_NODE_FLAG_MAPPED)) {
309-
if (ORTE_SUCCESS > (rc = opal_pointer_array_add(jdata->map->nodes, (void*)node))) {
310-
ORTE_ERROR_LOG(rc);
311-
goto error;
312-
}
313-
ORTE_FLAG_SET(node, ORTE_NODE_FLAG_MAPPED);
314-
OBJ_RETAIN(node); /* maintain accounting on object */
315-
jdata->map->num_nodes++;
316-
}
317-
318318
}
319319

320320
/* If we get to the end of all the nodes and still have procs remaining, then

0 commit comments

Comments
 (0)