qthreads icon indicating copy to clipboard operation
qthreads copied to clipboard

hwloc Cache Detection Logic Errors

Open insertinterestingnamehere opened this issue 2 years ago • 0 comments

https://github.com/sandialabs/qthreads/pull/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 https://github.com/sandialabs/qthreads/blob/f04005380afc0cfb2a0f486d83e1c0fef5d6c63d/src/affinity/hwloc.c#L137-L141 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.