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

hwloc Cache Detection Logic Errors #173

Open
insertinterestingnamehere opened this issue Nov 6, 2023 · 0 comments
Open

hwloc Cache Detection Logic Errors #173

insertinterestingnamehere opened this issue Nov 6, 2023 · 0 comments

Comments

@insertinterestingnamehere
Copy link
Collaborator

insertinterestingnamehere commented Nov 6, 2023

#75 replaced HWLOC_OBJ_CACHE with HWLOC_OBJ_CACHE_UNIFIED in the hwloc topology code, but this replacement doesn't make sense there since these are values of two different types of enum. See

hwloc_obj_type_t shep_type_options[] = {
HWLOC_OBJ_NODE, HWLOC_OBJ_CACHE_UNIFIED, HWLOC_OBJ_SOCKET, HWLOC_OBJ_CORE,
HWLOC_OBJ_PU,
HWLOC_OBJ_CACHE_UNIFIED, HWLOC_OBJ_CACHE_UNIFIED, HWLOC_OBJ_CACHE_UNIFIED, HWLOC_OBJ_CACHE_UNIFIED
};
for an example of where this would be a problem. Since the values for both enums are just the defaults, HWLOC_OBJ_CACHE_UNIFIED has the same binary value as HWLOC_OBJ_MACHINE. In our hwloc detection logic HWLOC_OBJ_CACHE_UNIFIED is frequently cast to type hwloc_obj_type_t which will throw off all the logic around caches throughout the rest of the file since we'll be getting values from functions like hwloc_get_depth_type that correspond to HWLOC_OBJ_MACHINE instead of anything to do with caches.

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

No branches or pull requests

1 participant