This is an archive of the discontinued LLVM Phabricator instance.

Hwloc refactoring patch
ClosedPublic

Authored by jlpeyton on Jun 9 2016, 11:51 AM.

Details

Summary

These changes remove the hwloc_topology_ignore_type function which doesn't exist in the hwloc 2.0 API. In the existing code, the topology extracted from hwloc has the cache levels stripped out and then assumes the final stripped topology follows the typical three-level topology: packages -> cores -> HW threads. But the code is doing unclean manipulations to determine at what level those resources are located and also assumes too much about what hwloc is detecting (there could be intermediate levels in between socket and core for instance). This new way of extracting the topology doesn't strip out any hardware objects that hwloc detects. It does not assume the three level topology, and instead searches for the relevant three levels within the topology for each bit of information using hwloc interface functions. i.e., the three level topology subset that our affinity code is interested in is extracted from the hwloc topology tree directly. For example, the new __kmp_hwloc_get_nobjs_under_obj function gives the user the number of cores under a socket reliably without worrying if there are unexpected objects between the socket object and core object in the hwloc topology structure. Also, now that all topology information is kept, there is also possibilities of using the caches/numa nodes to determine more sophisticated affinity settings in the future. There is also some cleanup code added for the destruction of the __kmp_hwloc_topology object.

Diff Detail

Repository
rL LLVM

Event Timeline

jlpeyton updated this revision to Diff 60216.Jun 9 2016, 11:51 AM
jlpeyton retitled this revision from to Hwloc refactoring patch.
jlpeyton updated this object.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar.
jlpeyton set the repository for this revision to rL LLVM.
jlpeyton added a subscriber: openmp-commits.
tlwilmar accepted this revision.Jun 13 2016, 9:57 AM
tlwilmar edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 13 2016, 9:57 AM
This revision was automatically updated to reflect the committed changes.