Skip to content

Commit

Permalink
components: don't warn when HWLOC_COMPONENTS conflicts with set_*() f…
Browse files Browse the repository at this point in the history
…unctions

Thanks to Andrej Prsa for the report. We don't want a system-wide
HWLOC_COMPONENTS=x86 fixup to cause warnings when Open MPI use set_xml()
for loading remote topologies.
  • Loading branch information
bgoglin committed Jan 4, 2016
1 parent 206cb40 commit 49500c2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions hwloc/components.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,22 +461,23 @@ hwloc_disc_component_try_enable(struct hwloc_topology *topology,
struct hwloc_disc_component *comp,
const char *comparg,
unsigned *excludes,
int envvar_forced,
int verbose_errors)
int envvar_forced)
{
struct hwloc_backend *backend;
int err;

if ((*excludes) & comp->type) {
if (hwloc_components_verbose || verbose_errors)
if (hwloc_components_verbose)
/* do not warn if envvar_forced since system-wide HWLOC_COMPONENTS must be silently ignored after set_xml() etc.
*/
fprintf(stderr, "Excluding %s discovery component `%s', conflicts with excludes 0x%x\n",
hwloc_disc_component_type_string(comp->type), comp->name, *excludes);
return -1;
}

backend = comp->instantiate(comp, comparg, NULL, NULL);
if (!backend) {
if (hwloc_components_verbose || verbose_errors)
if (hwloc_components_verbose || envvar_forced)
fprintf(stderr, "Failed to instantiate discovery component `%s'\n", comp->name);
return -1;
}
Expand Down Expand Up @@ -548,7 +549,7 @@ hwloc_disc_components_enable_others(struct hwloc_topology *topology)

comp = hwloc_disc_component_find(-1, curenv);
if (comp) {
hwloc_disc_component_try_enable(topology, comp, NULL, &excludes, 1 /* envvar forced */, 1 /* envvar forced need warnings */);
hwloc_disc_component_try_enable(topology, comp, NULL, &excludes, 1 /* envvar forced */);
} else {
fprintf(stderr, "Cannot find discovery component `%s'\n", curenv);
}
Expand Down Expand Up @@ -588,7 +589,7 @@ hwloc_disc_components_enable_others(struct hwloc_topology *topology)
curenv++;
}
}
hwloc_disc_component_try_enable(topology, comp, NULL, &excludes, 0 /* defaults, not envvar forced */, 0 /* defaults don't need warnings on conflicts */);
hwloc_disc_component_try_enable(topology, comp, NULL, &excludes, 0 /* defaults, not envvar forced */);
nextcomp:
comp = comp->next;
}
Expand Down

0 comments on commit 49500c2

Please sign in to comment.