JuliaParallel / JuliaParallel/Hwloc.jl

Cache inclusivity?

Open
#37 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Julia
Stars
83
Forks
18
PR merge metrics
No merged PRs in 30d

Description

This is probably an issue for Hwloc itself, but I figured I'd raise it here first.

Hwloc checks the inclusivity of the caches, e.g. running
```sh
hwloc-gather-topology /tmp/myhost
```
on the command line with create a `.xml` file that includes, among other output
```xml








```
Indicating that none of the caches are inclusive.

Hwloc uses cpuid for [AMD](https://github.com/open-mpi/hwloc/blob/263908a2c1f21c0e221a8d1f6472daf3a1fc07b9/hwloc/topology-x86.c#L350) and [Intel](https://github.com/open-mpi/hwloc/blob/263908a2c1f21c0e221a8d1f6472daf3a1fc07b9/hwloc/topology-x86.c#L427) CPUs, storing the results in a `struct`:
```C
struct cacheinfo {
hwloc_obj_cache_type_t type;
unsigned level;
unsigned nbthreads_sharing;
unsigned cacheid;

unsigned linesize;
unsigned linepart;
int inclusive;
int ways;
unsigned sets;
unsigned long size;
};
```
But this seems to be an undocumented internal.
The documented [hwloc_cache_attr_s](https://www.open-mpi.org/projects/hwloc/doc/v2.3.0/a00220.php) that you can load with the API is missing several of these fields.

There is a documented [hwloc_obj_get_info_by_name](https://www.open-mpi.org/projects/hwloc/doc/v2.4.0/a00159.php#gab358661a92bb27d8542b255cc9f6f25e) which [is used to query "Inclusive"](https://github.com/open-mpi/hwloc/blob/9e3c2b955852dbad7c8fd7dadc25ca98115f2210/hwloc/topology-x86.c#L1194), but `nm -D` doesn't show that symbol, and it'd take some work to figure out how to create the argument it takes (and if that object is a `cacheinfo`, we could just read the `inclusive` directly).
So perhaps it's a Hwloc issue to ask about an API for this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the Julia wrapper's exposed cache attributes with hwloc_cache_attr_s and the documented hwloc_obj_get_info_by_name API. Read the linked topology-x86.c sections to understand how cache inclusivity is detected. Done means establishing and documenting a supported way to query inclusivity, if the project accepts that API scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, julia
Domain
api, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.