@@ -280,9 +280,21 @@ static int mindist_map(orte_job_t *jdata)
280
280
break ;
281
281
}
282
282
}
283
- opal_output_verbose (2 , orte_rmaps_base_framework .framework_output ,
284
- "mca:rmaps:mindist: assigned %d procs to node %s" ,
285
- j , node -> name );
283
+ if (0 != j ) {
284
+ /* add the node to the map, if needed */
285
+ if (!ORTE_FLAG_TEST (node , ORTE_NODE_FLAG_MAPPED )) {
286
+ if (ORTE_SUCCESS > (rc = opal_pointer_array_add (jdata -> map -> nodes , (void * )node ))) {
287
+ ORTE_ERROR_LOG (rc );
288
+ goto error ;
289
+ }
290
+ ORTE_FLAG_SET (node , ORTE_NODE_FLAG_MAPPED );
291
+ OBJ_RETAIN (node ); /* maintain accounting on object */
292
+ jdata -> map -> num_nodes ++ ;
293
+ }
294
+ opal_output_verbose (2 , orte_rmaps_base_framework .framework_output ,
295
+ "mca:rmaps:mindist: assigned %d procs to node %s" ,
296
+ j , node -> name );
297
+ }
286
298
} else {
287
299
if (hwloc_get_nbobjs_by_type (node -> topology , HWLOC_OBJ_SOCKET ) > 1 ) {
288
300
/* don't have info about pci locality */
@@ -304,18 +316,6 @@ static int mindist_map(orte_job_t *jdata)
304
316
num_procs_to_assign -- ;
305
317
}
306
318
}
307
-
308
- /* add the node to the map, if needed */
309
- if (!ORTE_FLAG_TEST (node , ORTE_NODE_FLAG_MAPPED )) {
310
- if (ORTE_SUCCESS > (rc = opal_pointer_array_add (jdata -> map -> nodes , (void * )node ))) {
311
- ORTE_ERROR_LOG (rc );
312
- goto error ;
313
- }
314
- ORTE_FLAG_SET (node , ORTE_NODE_FLAG_MAPPED );
315
- OBJ_RETAIN (node ); /* maintain accounting on object */
316
- jdata -> map -> num_nodes ++ ;
317
- }
318
-
319
319
}
320
320
321
321
/* If we get to the end of all the nodes and still have procs remaining, then
0 commit comments