Skip to content

Commit cacc5c3

Browse files
committed
tests/cpukinds: duplicate the topology between register()s
To test #683 Signed-off-by: Brice Goglin <[email protected]>
1 parent e38316f commit cacc5c3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/hwloc/cpukinds.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2020-2023 Inria. All rights reserved.
2+
* Copyright © 2020-2024 Inria. All rights reserved.
33
* See COPYING in top-level directory.
44
*/
55

@@ -11,7 +11,7 @@
1111

1212
int main(void)
1313
{
14-
hwloc_topology_t topology;
14+
hwloc_topology_t topology, dup;
1515
int efficiency;
1616
hwloc_bitmap_t cpuset;
1717
struct hwloc_info_s info;
@@ -94,6 +94,13 @@ int main(void)
9494
infos.allocated = 0;
9595
err = hwloc_cpukinds_register(topology, cpuset, 1000, &infos, 0);
9696
assert(!err);
97+
98+
/* duplicate in the middle of adding cpukinds */
99+
err = hwloc_topology_dup(&dup, topology);
100+
assert(!err);
101+
hwloc_topology_destroy(topology);
102+
topology = dup;
103+
97104
/* PU 6-9 (third package) are small and less efficient */
98105
hwloc_bitmap_zero(cpuset);
99106
hwloc_bitmap_set_range(cpuset, 6, 8);

0 commit comments

Comments
 (0)