@@ -477,55 +477,60 @@ int orte_rmaps_base_get_target_nodes(opal_list_t *allocated_nodes, orte_std_cntr
477477 (int )opal_list_get_size (allocated_nodes )));
478478
479479 complete :
480+ num_slots = 0 ;
480481 /* remove all nodes that are already at max usage, and
481482 * compute the total number of allocated slots while
482- * we do so */
483- num_slots = 0 ;
484- item = opal_list_get_first (allocated_nodes );
485- while (item != opal_list_get_end (allocated_nodes )) {
486- /** save the next pointer in case we remove this node */
487- next = opal_list_get_next (item );
488- /** check to see if this node is fully used - remove if so */
489- node = (orte_node_t * )item ;
490- if (0 != node -> slots_max && node -> slots_inuse > node -> slots_max ) {
491- OPAL_OUTPUT_VERBOSE ((5 , orte_rmaps_base_framework .framework_output ,
492- "%s Removing node %s: max %d inuse %d" ,
493- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
494- node -> name , node -> slots_max , node -> slots_inuse ));
495- opal_list_remove_item (allocated_nodes , item );
496- OBJ_RELEASE (item ); /* "un-retain" it */
497- } else if (node -> slots <= node -> slots_inuse &&
498- (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE (policy ))) {
499- /* remove the node as fully used */
500- OPAL_OUTPUT_VERBOSE ((5 , orte_rmaps_base_framework .framework_output ,
501- "%s Removing node %s slots %d inuse %d" ,
502- ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
503- node -> name , node -> slots , node -> slots_inuse ));
504- opal_list_remove_item (allocated_nodes , item );
505- OBJ_RELEASE (item ); /* "un-retain" it */
506- } else if (node -> slots > node -> slots_inuse ) {
507- /* add the available slots */
483+ * we do so - can ignore this if we are mapping debugger
484+ * daemons as they do not count against the allocation */
485+ if (ORTE_MAPPING_DEBUGGER & ORTE_GET_MAPPING_DIRECTIVE (policy )) {
486+ num_slots = opal_list_get_size (allocated_nodes ); // tell the mapper there is one slot/node for debuggers
487+ } else {
488+ item = opal_list_get_first (allocated_nodes );
489+ while (item != opal_list_get_end (allocated_nodes )) {
490+ /** save the next pointer in case we remove this node */
491+ next = opal_list_get_next (item );
492+ /** check to see if this node is fully used - remove if so */
493+ node = (orte_node_t * )item ;
494+ if (0 != node -> slots_max && node -> slots_inuse > node -> slots_max ) {
508495 OPAL_OUTPUT_VERBOSE ((5 , orte_rmaps_base_framework .framework_output ,
509- "%s node %s has %d slots available " ,
496+ "%s Removing node %s: max %d inuse %d " ,
510497 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
511- node -> name , node -> slots - node -> slots_inuse ));
512- num_slots += node -> slots - node -> slots_inuse ;
513- } else if (!(ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE (policy ))) {
514- /* nothing needed to do here - we don't add slots to the
515- * count as we don't have any available. Just let the mapper
516- * do what it needs to do to meet the request
517- */
498+ node -> name , node -> slots_max , node -> slots_inuse ));
499+ opal_list_remove_item (allocated_nodes , item );
500+ OBJ_RELEASE (item ); /* "un-retain" it */
501+ } else if (node -> slots <= node -> slots_inuse &&
502+ (ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE (policy ))) {
503+ /* remove the node as fully used */
518504 OPAL_OUTPUT_VERBOSE ((5 , orte_rmaps_base_framework .framework_output ,
519- "%s node %s is fully used, but available for oversubscrition " ,
505+ "%s Removing node %s slots %d inuse %d " ,
520506 ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
521- node -> name ));
522- } else {
523- /* if we cannot use it, remove it from list */
524- opal_list_remove_item (allocated_nodes , item );
525- OBJ_RELEASE (item ); /* "un-retain" it */
507+ node -> name , node -> slots , node -> slots_inuse ));
508+ opal_list_remove_item (allocated_nodes , item );
509+ OBJ_RELEASE (item ); /* "un-retain" it */
510+ } else if (node -> slots > node -> slots_inuse ) {
511+ /* add the available slots */
512+ OPAL_OUTPUT_VERBOSE ((5 , orte_rmaps_base_framework .framework_output ,
513+ "%s node %s has %d slots available" ,
514+ ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
515+ node -> name , node -> slots - node -> slots_inuse ));
516+ num_slots += node -> slots - node -> slots_inuse ;
517+ } else if (!(ORTE_MAPPING_NO_OVERSUBSCRIBE & ORTE_GET_MAPPING_DIRECTIVE (policy ))) {
518+ /* nothing needed to do here - we don't add slots to the
519+ * count as we don't have any available. Just let the mapper
520+ * do what it needs to do to meet the request
521+ */
522+ OPAL_OUTPUT_VERBOSE ((5 , orte_rmaps_base_framework .framework_output ,
523+ "%s node %s is fully used, but available for oversubscription" ,
524+ ORTE_NAME_PRINT (ORTE_PROC_MY_NAME ),
525+ node -> name ));
526+ } else {
527+ /* if we cannot use it, remove it from list */
528+ opal_list_remove_item (allocated_nodes , item );
529+ OBJ_RELEASE (item ); /* "un-retain" it */
530+ }
531+ /** go on to next item */
532+ item = next ;
526533 }
527- /** go on to next item */
528- item = next ;
529534 }
530535
531536 /* Sanity check to make sure we have resources available */
0 commit comments