Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-time and runtime version checks #558

Open
bgoglin opened this issue Jan 5, 2023 · 1 comment
Open

build-time and runtime version checks #558

bgoglin opened this issue Jan 5, 2023 · 1 comment
Milestone

Comments

@bgoglin
Copy link
Contributor

bgoglin commented Jan 5, 2023

We have HWLOC_API_VERSION and get_api_version() for checking the API version at build-time and runtime. This version increases with API changes, but it's often be the same for 2.x and 2.x.1 (it's even the same between 2.5 and 2.7.2).

We also have HWLOC_VERSION for checking the version of the lib at build-time. This version increases with each new release, but there's no way to check it at runtime afaik. For instance, how to check whether we're running on 2.7.1 or 2.7.2 to avoid the LevelZero backend crash on PVC in 2.7.1 (open-mpi/ompi#11246) ?

We also have a ABI soname which gets updated with every release but I don't know how to use that in the code at runtime.

Do we need a runtime function to check the lib version instead of the API ? Or should we increase the API version in every release and rely on get_version() at runtime?

Afaik, get_api_version() is mostly used to compare the major version number (avoid mixing hwloc 1 and 2). I am not sure anybody cares about the API lower bits at runtime. The new get_version() would be enough for this.

CC'ing @jsquyres @rhc54 and @ggouaillardet since they were involved in some discussion about this in the past.

@bgoglin bgoglin added this to the 3.0 milestone Jan 5, 2023
@rhc54
Copy link

rhc54 commented Jan 5, 2023

It does indeed help to have a function method for determining the actual library version (and not just the ABI version) for the reasons encountered in the OMPI issue you referenced. It isn't that uncommon for systems to have different software revision levels on backend vs frontend nodes, and getting the library version in those cases can be a valuable tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants