Skip to content

Commit

Permalink
Remove NumaMemoryResource (hyrise#2114)
Browse files Browse the repository at this point in the history
Removes dead code, fixes hyrise#2087
  • Loading branch information
mrks authored May 5, 2020
1 parent 31dddf7 commit f5cb357
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 190 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
[submodule "third_party/nlohmann_json"]
path = third_party/nlohmann_json
url = https://github.com/nlohmann/json.git
[submodule "third_party/pgasus"]
path = third_party/pgasus
url = https://github.com/hyrise/pgasus.git
[submodule "third_party/sql-parser"]
path = third_party/sql-parser
url = https://github.com/hyrise/sql-parser
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ endif()
add_subdirectory(third_party/ EXCLUDE_FROM_ALL)

# Some third-party libs don't support LTO (if enabled above):
foreach(no_lto_target gtest gtest_main gmock gmock_main hpinuma_s hpinuma hpinuma_base_s hpinuma_base hpinuma_util_tool hpinuma_msource hpinuma_msource_s)
foreach(no_lto_target gtest gtest_main gmock gmock_main)
if(TARGET no_lto_target)
set_property(TARGET ${no_lto_target} PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
endif()
Expand Down
5 changes: 0 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ include_directories(
${PROJECT_SOURCE_DIR}/third_party/tpcds-result-reproduction
)

if (${ENABLE_NUMA_SUPPORT})
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third_party/pgasus/include)
include_directories(SYSTEM ${PROJECT_BINARY_DIR}/third_party/pgasus/src)
endif()

set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Run clang-tidy")
if (ENABLE_CLANG_TIDY)
message(STATUS "clang-tidy enabled")
Expand Down
4 changes: 1 addition & 3 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ set(
logical_query_plan/validate_node.cpp
logical_query_plan/validate_node.hpp
memory/boost_default_memory_resource.cpp
memory/numa_memory_resource.cpp
memory/numa_memory_resource.hpp
lossless_cast.cpp
lossless_cast.hpp
null_value.hpp
Expand Down Expand Up @@ -656,7 +654,7 @@ if (NOT APPLE)
endif()

if (${ENABLE_NUMA_SUPPORT})
set(LIBRARIES ${LIBRARIES} ${NUMA_LIBRARY} hpinuma_msource_s)
set(LIBRARIES ${LIBRARIES} ${NUMA_LIBRARY})
endif()

set(ERASE_SEGMENT_TYPES "" CACHE STRING "Erase iterators and accessors for these types (e.g., RunLength,FrameOfReference). Good for compile time, bad for run time (if these types end up being used)")
Expand Down
51 changes: 0 additions & 51 deletions src/lib/memory/numa_memory_resource.cpp

This file was deleted.

35 changes: 0 additions & 35 deletions src/lib/memory/numa_memory_resource.hpp

This file was deleted.

25 changes: 0 additions & 25 deletions src/lib/scheduler/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include <utility>
#include <vector>

#include "memory/numa_memory_resource.hpp"

namespace opossum {

#if HYRISE_NUMA_SUPPORT
Expand Down Expand Up @@ -104,8 +102,6 @@ void Topology::_init_numa_topology(uint32_t max_num_cores) {
}
}

_create_memory_resources();

numa_free_cpumask(affinity_cpu_bitmask);
numa_free_cpumask(this_node_cpu_bitmask);
#endif
Expand All @@ -128,8 +124,6 @@ void Topology::_init_non_numa_topology(uint32_t max_num_cores) {

auto node = TopologyNode(std::move(cpus));
_nodes.emplace_back(std::move(node));

_create_memory_resources();
}

void Topology::_init_fake_numa_topology(uint32_t max_num_workers, uint32_t workers_per_node) {
Expand Down Expand Up @@ -162,36 +156,17 @@ void Topology::_init_fake_numa_topology(uint32_t max_num_workers, uint32_t worke
}

_num_cpus = num_workers;
_create_memory_resources();
}

const std::vector<TopologyNode>& Topology::nodes() const { return _nodes; }

size_t Topology::num_cpus() const { return _num_cpus; }

boost::container::pmr::memory_resource* Topology::get_memory_resource(int node_id) {
DebugAssert(node_id >= 0 && node_id < static_cast<int>(_nodes.size()), "node_id is out of bounds");
return &_memory_resources[static_cast<size_t>(node_id)];
}

void Topology::_clear() {
_nodes.clear();
_memory_resources.clear();
_num_cpus = 0;
}

void Topology::_create_memory_resources() {
for (auto node_id = int{0}; node_id < static_cast<int>(_nodes.size()); ++node_id) {
auto memsource_name = std::stringstream();
memsource_name << "numa_" << std::setw(3) << std::setfill('0') << node_id;

// If we have a fake NUMA topology that has more nodes than our system has available,
// distribute the fake nodes among the physically available ones.
auto system_node_id = _fake_numa_topology ? node_id % _number_of_hardware_nodes : node_id;
_memory_resources.emplace_back(NUMAMemoryResource(system_node_id, memsource_name.str()));
}
}

std::ostream& operator<<(std::ostream& stream, const Topology& topology) {
stream << "Number of CPUs: " << topology.num_cpus() << std::endl;
if (topology._filtered_by_affinity) {
Expand Down
14 changes: 0 additions & 14 deletions src/lib/scheduler/topology.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,8 @@
#include <utility>
#include <vector>

#include "memory/numa_memory_resource.hpp"
#include "types.hpp"

namespace boost {
namespace container {
namespace pmr {
class memory_resource;
}
} // namespace container
} // namespace boost

namespace opossum {

struct TopologyCpu final {
Expand Down Expand Up @@ -82,8 +73,6 @@ class Topology final : public Noncopyable {

size_t num_cpus() const;

boost::container::pmr::memory_resource* get_memory_resource(int node_id);

private:
Topology();

Expand All @@ -96,16 +85,13 @@ class Topology final : public Noncopyable {
void _init_fake_numa_topology(uint32_t max_num_workers = 0, uint32_t workers_per_node = 1);

void _clear();
void _create_memory_resources();

std::vector<TopologyNode> _nodes;
uint32_t _num_cpus{0};
bool _fake_numa_topology{false};
bool _filtered_by_affinity{false};

static const int _number_of_hardware_nodes;

std::vector<NUMAMemoryResource> _memory_resources;
};

std::ostream& operator<<(std::ostream& stream, const Topology& topology);
Expand Down
1 change: 0 additions & 1 deletion src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ set(
logical_query_plan/validate_node_test.cpp
lossless_cast_test.cpp
memory/segments_using_allocators_test.cpp
memory/numa_memory_resource_test.cpp
operators/aggregate_test.cpp
operators/alias_operator_test.cpp
operators/change_meta_table_test.cpp
Expand Down
42 changes: 0 additions & 42 deletions src/test/memory/numa_memory_resource_test.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,6 @@ add_subdirectory(libpqxx)
add_subdirectory(tpch-dbgen)
add_subdirectory(nlohmann_json)

# Add PGASUS
if(${NUMA_FOUND})
set(PGASUS_WITH_TASKING OFF CACHE BOOL "" FORCE)
set(PGASUS_REPLACE_MALLOC OFF CACHE BOOL "" FORCE)
set(PGASUS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(PGASUS_BUILD_DOCUMENTATION OFF CACHE BOOL "" FORCE)
add_subdirectory(pgasus)
endif()

## Build lz4
set(LZ4_LIBRARY_DIR lz4/lib)

Expand Down
1 change: 0 additions & 1 deletion third_party/pgasus
Submodule pgasus deleted from 159260

0 comments on commit f5cb357

Please sign in to comment.