Skip to content

Commit 87962b5

Browse files
bgoglinndenoyelle
authored andcommitted
xml/export: cleanup the exporting of allowed sets
Don't AND(normal, topology_allowed) in the normal (v2) case to avoid hiding internal allowed set bugs. Signed-off-by: Brice Goglin <[email protected]>
1 parent 12d650c commit 87962b5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

hwloc/topology-xml.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,13 +2051,17 @@ hwloc__xml_export_object_contents (hwloc__xml_export_state_t state, hwloc_topolo
20512051
state->new_prop(state, "online_cpuset", setstring);
20522052
free(setstring);
20532053

2054-
if (v1export || !obj->parent) {
2054+
if (v1export) {
20552055
hwloc_bitmap_t allowed_cpuset = hwloc_bitmap_dup(obj->cpuset);
20562056
hwloc_bitmap_and(allowed_cpuset, allowed_cpuset, topology->allowed_cpuset);
20572057
hwloc_bitmap_asprintf(&setstring, allowed_cpuset);
20582058
state->new_prop(state, "allowed_cpuset", setstring);
20592059
free(setstring);
20602060
hwloc_bitmap_free(allowed_cpuset);
2061+
} else if (!obj->parent) {
2062+
hwloc_bitmap_asprintf(&setstring, topology->allowed_cpuset);
2063+
state->new_prop(state, "allowed_cpuset", setstring);
2064+
free(setstring);
20612065
}
20622066
}
20632067

@@ -2072,13 +2076,17 @@ hwloc__xml_export_object_contents (hwloc__xml_export_state_t state, hwloc_topolo
20722076
state->new_prop(state, "complete_nodeset", setstring);
20732077
free(setstring);
20742078

2075-
if (v1export || !obj->parent) {
2079+
if (v1export) {
20762080
hwloc_bitmap_t allowed_nodeset = hwloc_bitmap_dup(obj->nodeset);
20772081
hwloc_bitmap_and(allowed_nodeset, allowed_nodeset, topology->allowed_nodeset);
20782082
hwloc_bitmap_asprintf(&setstring, allowed_nodeset);
20792083
state->new_prop(state, "allowed_nodeset", setstring);
20802084
free(setstring);
20812085
hwloc_bitmap_free(allowed_nodeset);
2086+
} else if (!obj->parent) {
2087+
hwloc_bitmap_asprintf(&setstring, topology->allowed_nodeset);
2088+
state->new_prop(state, "allowed_nodeset", setstring);
2089+
free(setstring);
20822090
}
20832091
}
20842092

0 commit comments

Comments
 (0)