Skip to content

Commit

Permalink
Merge pull request #7 from hppritcha/upstream_pr_1990
Browse files Browse the repository at this point in the history
Protect against missing HWLOC object types
  • Loading branch information
hppritcha authored Jul 12, 2024
2 parents 039aeea + 6a3ec4b commit 8d0a25b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/mca/rmaps/base/rmaps_base_binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ static int bind_generic(prte_job_t *jdata, prte_proc_t *proc,

nobjs = hwloc_get_nbobjs_by_type(node->topology->topo, options->hwb);

// check for target object existence
if (0 == nobjs) {
// if this is not a default binding policy, then error out
if (PRTE_BINDING_POLICY_IS_SET(jdata->map->binding)) {
pmix_show_help("help-prte-rmaps-base.txt", "rmaps:binding-target-not-found",
true, prte_hwloc_base_print_binding(jdata->map->binding), node->name);
return PRTE_ERR_SILENT;
}
// fallback to not binding
return PRTE_SUCCESS;
}

for (n=0; n < nobjs; n++) {
tmp_obj = hwloc_get_obj_by_type(node->topology->topo, options->hwb, n);
#if HWLOC_API_VERSION < 0x20000
Expand Down Expand Up @@ -129,6 +141,9 @@ static int bind_generic(prte_job_t *jdata, prte_proc_t *proc,
#else
tgtcpus = trg_obj->cpuset;
#endif
if (NULL == tgtcpus) {
return PRTE_ERROR;
}
hwloc_bitmap_list_asprintf(&proc->cpuset, tgtcpus); // bind to the entire target object
if (4 < pmix_output_get_verbosity(prte_rmaps_base_framework.framework_output)) {
char *tmp1;
Expand Down

0 comments on commit 8d0a25b

Please sign in to comment.