This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] Enable HWLOC topology detection of multiple CPU kinds
ClosedPublic

Authored by jlpeyton on Oct 21 2021, 2:06 PM.

Details

Summary

Teach the HWLOC topology method how to detect Atom and Core
types so hybrid CPUs are properly detected and represented when using
the HWLOC topology method.

Diff Detail

Event Timeline

jlpeyton created this revision.Oct 21 2021, 2:06 PM
jlpeyton requested review of this revision.Oct 21 2021, 2:06 PM
This revision is now accepted and ready to land.Nov 12 2021, 7:32 AM

hwloc_cpukinds_get_nr() and friends were introduced in hwloc v2.4, so these changes implicitly bumps the hwloc version requirement to 2.4.

I suspect this was not intended.
For example, RHEL8 provides hwloc 2.2 and requiring hwloc not provided by the distro is imho not desirable (for example, conflicts can occur when building a binary linked to a library (such as MPI) that depends on the distro hwloc.

The attached patch #ifdef protects (most) the changes when building against hwloc < 2.4.

Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2023, 8:54 PM
ggouaillardet reopened this revision.Jan 18 2023, 4:42 PM

Did you have any chance to review this issue (e.g. this changes implicitly requires hwloc ?= 2.4)?

This revision is now accepted and ready to land.Jan 18 2023, 4:42 PM

openmp/runtime/src/kmp_affinity.cpp:1611 has to be guarded by version check as well.

openmp/runtime/src/kmp_affinity.cpp:1611 has to be guarded by version check as well.

I've made https://reviews.llvm.org/D142152 which combines @ggouaillardet 's patch with this other necessary HWLOC_API_VERSION guard.

jlpeyton closed this revision.Feb 2 2023, 12:27 PM

Patch from D142152 was pushed.