Skip to content

Commit c02cd50

Browse files
committed
diff: also check whether cpukinds are identical
Signed-off-by: Brice Goglin <[email protected]>
1 parent 5577481 commit c02cd50

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

hwloc/diff.c

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

@@ -412,6 +412,30 @@ int hwloc_topology_diff_build(hwloc_topology_t topo1,
412412
}
413413
}
414414

415+
if (!err) {
416+
/* cpukinds */
417+
if (topo1->nr_cpukinds != topo2->nr_cpukinds)
418+
goto roottoocomplex;
419+
for(i=0; i<topo1->nr_cpukinds; i++) {
420+
struct hwloc_internal_cpukind_s *ic1 = &topo1->cpukinds[i];
421+
struct hwloc_internal_cpukind_s *ic2 = &topo2->cpukinds[i];
422+
unsigned j;
423+
if (!hwloc_bitmap_isequal(ic1->cpuset, ic2->cpuset)
424+
|| ic1->efficiency != ic2->efficiency
425+
|| ic1->forced_efficiency != ic2->forced_efficiency
426+
|| ic1->ranking_value != ic2->ranking_value
427+
|| ic1->nr_infos != ic2->nr_infos)
428+
goto roottoocomplex;
429+
for(j=0; j<ic1->nr_infos; j++) {
430+
struct hwloc_info_s *info1 = &ic1->infos[j], *info2 = &ic2->infos[j];
431+
if (strcmp(info1->name, info2->name)
432+
|| strcmp(info1->value, info2->value)) {
433+
goto roottoocomplex;
434+
}
435+
}
436+
}
437+
}
438+
415439
return err;
416440

417441
roottoocomplex:

0 commit comments

Comments
 (0)