1010 * Copyright (c) 2004-2005 The Regents of the University of California.
1111 * All rights reserved.
1212 * Copyright (c) 2011-2017 Cisco Systems, Inc. All rights reserved
13- * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
13+ * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
1414 * Copyright (c) 2017 Research Organization for Information Science
1515 * and Technology (RIST). All rights reserved.
1616 * $COPYRIGHT$
@@ -379,35 +379,34 @@ static int rank_by(orte_job_t *jdata,
379379 all_done = false;
380380 while (!all_done && cnt < app -> num_procs ) {
381381 all_done = true;
382- /* cycle across the objects */
383- for (i = 0 ; i < num_objs && cnt < app -> num_procs && all_done ; i ++ ) {
384- obj = (hwloc_obj_t )opal_pointer_array_get_item (& objs , i );
385- /* find the next proc for this job and app_context */
386- for (j = 0 ; j < node -> procs -> size && cnt < app -> num_procs ; j ++ ) {
387- if (NULL == (proc = (orte_proc_t * )opal_pointer_array_get_item (node -> procs , j ))) {
388- continue ;
389- }
390- /* ignore procs from other jobs */
391- if (proc -> name .jobid != jdata -> jobid ) {
392- opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
393- "mca:rmaps:rank_by skipping proc %s - from another job, num_ranked %d" ,
394- ORTE_NAME_PRINT (& proc -> name ), num_ranked );
395- continue ;
396- }
397- /* ignore procs that are already ranked */
398- if (ORTE_VPID_INVALID != proc -> name .vpid ) {
399- opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
400- "mca:rmaps:rank_by skipping proc %s - already ranked, num_ranked %d" ,
401- ORTE_NAME_PRINT (& proc -> name ), num_ranked );
402- continue ;
403- }
404- /* ignore procs from other apps */
405- if (proc -> app_idx != app -> idx ) {
406- opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
407- "mca:rmaps:rank_by skipping proc %s - from another app, num_ranked %d" ,
408- ORTE_NAME_PRINT (& proc -> name ), num_ranked );
409- continue ;
410- }
382+ for (j = 0 ; j < node -> procs -> size && cnt < app -> num_procs ; j ++ ) {
383+ if (NULL == (proc = (orte_proc_t * )opal_pointer_array_get_item (node -> procs , j ))) {
384+ continue ;
385+ }
386+ /* ignore procs from other jobs */
387+ if (proc -> name .jobid != jdata -> jobid ) {
388+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
389+ "mca:rmaps:rank_by skipping proc %s - from another job, num_ranked %d" ,
390+ ORTE_NAME_PRINT (& proc -> name ), num_ranked );
391+ continue ;
392+ }
393+ /* ignore procs that are already ranked */
394+ if (ORTE_VPID_INVALID != proc -> name .vpid ) {
395+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
396+ "mca:rmaps:rank_by skipping proc %s - already ranked, num_ranked %d" ,
397+ ORTE_NAME_PRINT (& proc -> name ), num_ranked );
398+ continue ;
399+ }
400+ /* ignore procs from other apps */
401+ if (proc -> app_idx != app -> idx ) {
402+ opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
403+ "mca:rmaps:rank_by skipping proc %s - from another app, num_ranked %d" ,
404+ ORTE_NAME_PRINT (& proc -> name ), num_ranked );
405+ continue ;
406+ }
407+ /* cycle across the objects */
408+ for (i = 0 ; i < num_objs && cnt < app -> num_procs && all_done ; i ++ ) {
409+ obj = (hwloc_obj_t )opal_pointer_array_get_item (& objs , i );
411410 /* protect against bozo case */
412411 locale = NULL ;
413412 if (!orte_get_attribute (& proc -> attributes , ORTE_PROC_HWLOC_LOCALE , (void * * )& locale , OPAL_PTR )) {
@@ -429,7 +428,8 @@ static int rank_by(orte_job_t *jdata,
429428 }
430429 cnt ++ ;
431430 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
432- "mca:rmaps:rank_by: assigned rank %s" , ORTE_VPID_PRINT (proc -> name .vpid ));
431+ "mca:rmaps:rank_by: proc in position %d is on object %d assigned rank %s" ,
432+ j , i , ORTE_VPID_PRINT (proc -> name .vpid ));
433433 /* insert the proc into the jdata array */
434434 if (NULL != (pptr = (orte_proc_t * )opal_pointer_array_get_item (jdata -> procs , proc -> name .vpid ))) {
435435 OBJ_RELEASE (pptr );
@@ -440,7 +440,8 @@ static int rank_by(orte_job_t *jdata,
440440 OBJ_DESTRUCT (& objs );
441441 return rc ;
442442 }
443- /* flag that one was mapped */
443+ num_ranked ++ ;
444+ /* flag that one was mapped */
444445 all_done = false;
445446 /* track where the highest vpid landed - this is our
446447 * new bookmark
0 commit comments