This is an archive of the discontinued LLVM Phabricator instance.

Fix Hwloc API Incompatibility
ClosedPublic

Authored by jlpeyton on Apr 25 2017, 10:24 AM.

Details

Summary

Older Hwloc's (< 1.10.0) don't offer the HWLOC_OBJ_NUMANODE nor HWLOC_OBJ_PACKAGE types. Instead they are named HWLOC_OBJ_NODE and HWLOC_OBJ_SOCKET instead. This patch just defines the newer names when using an older Hwloc. Tested with 1.9.1, 1.10.1, and 1.11.6.

Diff Detail

Repository
rL LLVM

Event Timeline

jlpeyton created this revision.Apr 25 2017, 10:24 AM
pawosm01 accepted this revision.Apr 25 2017, 10:41 AM
This revision is now accepted and ready to land.Apr 25 2017, 10:41 AM
AndreyChurbanov added inline comments.
runtime/src/kmp.h
91

Both HWLOC 1.10 and 1.10.1 have version 0x00010a00; in 10.0 there is no HWLOC_OBJ_NUMANODE definition, but in 10.1 this definition is provided in deprecate.h header file (probably as a preparation for future renaming?).

Is it safer to use:

#ifndef HWLOC_OBJ_NUMANODE
#define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
#endif
#ifndef HWLOC_OBJ_PACKAGE
#define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
#endif

as opposed to version checking?

jlpeyton updated this revision to Diff 96608.Apr 25 2017, 11:18 AM

Updated the diff. I had gotten errors when I tried that first, but now I realize that the SOCKET name is used in address2os map creation. I've changed all of them to HWLOC_OBJ_PACKAGE now and added the #ifndef method.

This revision was automatically updated to reflect the committed changes.