13 #ifndef HWLOC_INTEL_MIC_H
14 #define HWLOC_INTEL_MIC_H
17 #include <hwloc/autogen/config.h>
18 #include <hwloc/helper.h>
19 #ifdef HWLOC_LINUX_SYS
20 #include <hwloc/linux.h>
58 #ifdef HWLOC_LINUX_SYS
60 #define HWLOC_INTEL_MIC_DEVICE_SYSFS_PATH_MAX 128
61 char path[HWLOC_INTEL_MIC_DEVICE_SYSFS_PATH_MAX];
64 struct dirent *dirent;
65 unsigned pcibus, pcidev, pcifunc;
72 sprintf(path,
"/sys/class/mic/mic%d", idx);
73 sysdir = opendir(path);
77 while ((dirent = readdir(sysdir)) != NULL) {
78 if (sscanf(dirent->d_name,
"pci_%02x:%02x.%02x", &pcibus, &pcidev, &pcifunc) == 3) {
79 sprintf(path,
"/sys/class/mic/mic%d/pci_%02x:%02x.%02x/local_cpus", idx, pcibus, pcidev, pcifunc);
80 sysfile = fopen(path,
"r");
124 && !strncmp(
"mic", osdev->
name, 3)
125 && atoi(osdev->
name + 3) == (
int) idx)