diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2011-09-24 00:30:47 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-09-24 00:30:47 +0000 |
commit | ec17b7029a5f5f2e42d66380762ab24fa5174fc4 (patch) | |
tree | 39de052be8fcdbb1a58150eedde74bfbc0d5b92c /ProcessList.c | |
parent | d07b043ee07caa5da9e93a5a2ca9165ff98f85d7 (diff) |
Convert affinity control from the deprecated PLPA to HWLOC
Diffstat (limited to 'ProcessList.c')
-rw-r--r-- | ProcessList.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ProcessList.c b/ProcessList.c index c200eb91..f3cc40f1 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -101,6 +101,10 @@ typedef struct ProcessList_ { int kernelThreads; int runningTasks; + #ifdef HAVE_HWLOC + hwloc_topology_t topology; + bool topologyOk; + #endif CPUData* cpus; unsigned long long int totalMem; @@ -155,7 +159,15 @@ ProcessList* ProcessList_new(UsersTable* usersTable) { } while (String_startsWith(buffer, "cpu")); fclose(file); this->cpuCount = cpus - 1; - + +#ifdef HAVE_HWLOC + this->topologyOk = false; + int topoErr = hwloc_topology_init(&this->topology); + if (topoErr == 0) { + topoErr = hwloc_topology_load(this->topology); + this->topologyOk = true; + } +#endif this->cpus = calloc(sizeof(CPUData), cpus); for (int i = 0; i < cpus; i++) { |