@@ -433,6 +433,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
433433 int rc ;
434434 opal_list_item_t * item ;
435435 bool one_found ;
436+ hwloc_obj_type_t target ;
437+ unsigned cache_level ;
436438
437439 map = jdata -> map ;
438440
@@ -475,13 +477,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
475477 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
476478 "mca:rmaps: computing ranks by L3cache for job %s" ,
477479 ORTE_JOBID_PRINT (jdata -> jobid ));
478- if (ORTE_SUCCESS != (rc =
479- #if HWLOC_API_VERSION < 0x20000
480- rank_by (jdata , app , nodes , HWLOC_OBJ_CACHE , 3 )
481- #else
482- rank_by (jdata , app , nodes , HWLOC_OBJ_L3CACHE , 0 )
483- #endif
484- )) {
480+ OPAL_HWLOC_MAKE_OBJ_CACHE (3 , target , cache_level );
481+ if (ORTE_SUCCESS != (rc = rank_by (jdata , app , nodes , target , cache_level ))) {
485482 if (ORTE_ERR_NOT_SUPPORTED == rc &&
486483 !(ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE (map -> ranking ))) {
487484 ORTE_SET_RANKING_POLICY (map -> ranking , ORTE_RANK_BY_SLOT );
@@ -496,13 +493,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
496493 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
497494 "mca:rmaps: computing ranks by L2cache for job %s" ,
498495 ORTE_JOBID_PRINT (jdata -> jobid ));
499- if (ORTE_SUCCESS != (rc =
500- #if HWLOC_API_VERSION < 0x20000
501- rank_by (jdata , app , nodes , HWLOC_OBJ_CACHE , 2 )
502- #else
503- rank_by (jdata , app , nodes , HWLOC_OBJ_L2CACHE , 0 )
504- #endif
505- )) {
496+ OPAL_HWLOC_MAKE_OBJ_CACHE (2 , target , cache_level );
497+ if (ORTE_SUCCESS != (rc = rank_by (jdata , app , nodes , target , cache_level ))) {
506498 if (ORTE_ERR_NOT_SUPPORTED == rc &&
507499 !(ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE (map -> ranking ))) {
508500 ORTE_SET_RANKING_POLICY (map -> ranking , ORTE_RANK_BY_SLOT );
@@ -517,13 +509,8 @@ int orte_rmaps_base_compute_vpids(orte_job_t *jdata,
517509 opal_output_verbose (5 , orte_rmaps_base_framework .framework_output ,
518510 "mca:rmaps: computing ranks by L1cache for job %s" ,
519511 ORTE_JOBID_PRINT (jdata -> jobid ));
520- if (ORTE_SUCCESS != (rc =
521- #if HWLOC_API_VERSION < 0x20000
522- rank_by (jdata , app , nodes , HWLOC_OBJ_CACHE , 1 )
523- #else
524- rank_by (jdata , app , nodes , HWLOC_OBJ_L1CACHE , 0 )
525- #endif
526- )) {
512+ OPAL_HWLOC_MAKE_OBJ_CACHE (1 , target , cache_level );
513+ if (ORTE_SUCCESS != (rc = rank_by (jdata , app , nodes , target , cache_level ))) {
527514 if (ORTE_ERR_NOT_SUPPORTED == rc &&
528515 !(ORTE_RANKING_GIVEN & ORTE_GET_RANKING_DIRECTIVE (map -> ranking ))) {
529516 ORTE_SET_RANKING_POLICY (map -> ranking , ORTE_RANK_BY_SLOT );
0 commit comments