Skip to content

Commit

Permalink
Remove dead libnuma references
Browse files Browse the repository at this point in the history
JANA's NUMA support uses information from `lscpu` or `/proc/cpuinfo` instead of libnuma. Libnuma was insufficient because it didn't provide information about sockets or hyperthreads, and JANA2 constrains affinity/locality at any level, not just NUMA nodes.
  • Loading branch information
nathanwbrei committed Jul 11, 2024
1 parent 82d207a commit 78a742f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
3 changes: 0 additions & 3 deletions cmake/MakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ else()
set(HAVE_CURL 0)
endif()

# TODO: FindNuma.cmake
set(HAVE_NUMA 0)

configure_file(scripts/jana-config.in jana-config @ONLY)
configure_file(scripts/jana-this.sh.in jana-this.sh @ONLY)
configure_file(scripts/jana-this.csh.in jana-this.csh @ONLY)
Expand Down
42 changes: 0 additions & 42 deletions src/libraries/JANA/Utils/JCpuInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#include <sched.h>
#endif //__APPLE__

#ifdef HAVE_NUMA
#include <numa.h>
#endif //HAVE_NUMA

#include <JANA/Utils/JCpuInfo.h>

Expand Down Expand Up @@ -77,45 +74,6 @@ uint32_t GetCpuID() {
}



size_t GetNumaNodeID() {
#ifdef HAVE_NUMA
if (numa_available() == -1) {
return 0;
} else {
return numa_node_of_cpu(GetCpuID());
}
#else //HAVE_NUMA
return 0;
#endif //HAVE_NUMA
}

size_t GetNumaNodeID(size_t cpu_id) {
#ifdef HAVE_NUMA
if (numa_available() == -1) {
return 0;
} else {
return numa_node_of_cpu(cpu_id);
}
#else //HAVE_NUMA
(void) cpu_id; // suppress compiler warning.
return 0;
#endif //HAVE_NUMA
}

size_t GetNumNumaNodes() {
#ifdef HAVE_NUMA
if (numa_available() == -1) {
return 1;
} else {
return numa_num_configured_nodes();
}
#else //HAVE_NUMA
return 1;
#endif //HAVE_NUMA
}


bool PinThreadToCpu(std::thread* thread, size_t cpu_id) {

if (typeid(std::thread::native_handle_type) != typeid(pthread_t)) {
Expand Down
6 changes: 0 additions & 6 deletions src/libraries/JANA/Utils/JCpuInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ namespace JCpuInfo {

uint32_t GetCpuID();

size_t GetNumaNodeID();

size_t GetNumaNodeID(size_t cpuid);

size_t GetNumNumaNodes();

bool PinThreadToCpu(std::thread *thread, size_t cpu_id);

}

0 comments on commit 78a742f

Please sign in to comment.