Replace bool for using shared memory with MemorySetting enum
This commit is contained in:
committed by
Patrick Niklaus
parent
70b3962c35
commit
266e65e6d2
@@ -28,7 +28,7 @@ constexpr int32_t WORLD_MAX_LON = 180 * COORDINATE_PRECISION;
|
||||
|
||||
using RTreeLeaf = extractor::EdgeBasedNode;
|
||||
using BenchStaticRTree =
|
||||
util::StaticRTree<RTreeLeaf, util::ShM<util::Coordinate, false>::vector, false>;
|
||||
util::StaticRTree<RTreeLeaf, util::ShM<util::Coordinate, osrm::storage::MemorySetting::InternalMemory>::vector, osrm::storage::MemorySetting::InternalMemory>;
|
||||
|
||||
std::vector<util::Coordinate> loadCoordinates(const boost::filesystem::path &nodes_file)
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "partition/io.hpp"
|
||||
#include "partition/multi_level_partition.hpp"
|
||||
|
||||
#include "storage/shared_memory.hpp"
|
||||
|
||||
#include "updater/updater.hpp"
|
||||
|
||||
#include "util/log.hpp"
|
||||
@@ -83,7 +85,7 @@ auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config,
|
||||
auto tidied =
|
||||
partition::prepareEdgesForUsageInGraph<StaticEdgeBasedGraphEdge>(std::move(directed));
|
||||
auto edge_based_graph =
|
||||
std::make_unique<partition::MultiLevelGraph<EdgeBasedGraphEdgeData, false>>(
|
||||
std::make_unique<partition::MultiLevelGraph<EdgeBasedGraphEdgeData, osrm::storage::MemorySetting::InternalMemory>>(
|
||||
mlp, num_nodes, std::move(tidied));
|
||||
|
||||
util::Log() << "Loaded edge based graph for mapping partition ids: "
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace storage
|
||||
|
||||
using RTreeLeaf = engine::datafacade::BaseDataFacade::RTreeLeaf;
|
||||
using RTreeNode =
|
||||
util::StaticRTree<RTreeLeaf, util::ShM<util::Coordinate, true>::vector, true>::TreeNode;
|
||||
util::StaticRTree<RTreeLeaf, util::ShM<util::Coordinate, osrm::storage::MemorySetting::SharedMemory>::vector, osrm::storage::MemorySetting::SharedMemory>::TreeNode;
|
||||
using QueryGraph = util::StaticGraph<contractor::QueryEdge::EdgeData>;
|
||||
using EdgeBasedGraph = util::StaticGraph<extractor::EdgeBasedEdge::EdgeData>;
|
||||
|
||||
@@ -364,12 +364,12 @@ void Storage::PopulateLayout(DataLayout &layout)
|
||||
intersection_file.Skip<std::uint32_t>(1); // sum_lengths
|
||||
|
||||
layout.SetBlockSize<unsigned>(DataLayout::BEARING_OFFSETS, bearing_blocks);
|
||||
layout.SetBlockSize<typename util::RangeTable<16, true>::BlockT>(DataLayout::BEARING_BLOCKS,
|
||||
layout.SetBlockSize<typename util::RangeTable<16, osrm::storage::MemorySetting::SharedMemory>::BlockT>(DataLayout::BEARING_BLOCKS,
|
||||
bearing_blocks);
|
||||
|
||||
// No need to read the data
|
||||
intersection_file.Skip<unsigned>(bearing_blocks);
|
||||
intersection_file.Skip<typename util::RangeTable<16, true>::BlockT>(bearing_blocks);
|
||||
intersection_file.Skip<typename util::RangeTable<16, osrm::storage::MemorySetting::SharedMemory>::BlockT>(bearing_blocks);
|
||||
|
||||
const auto num_bearings = intersection_file.ReadElementCount64();
|
||||
|
||||
@@ -694,7 +694,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
|
||||
layout.GetBlockPtr<util::Coordinate, true>(memory_ptr, DataLayout::COORDINATE_LIST);
|
||||
const auto osmnodeid_ptr =
|
||||
layout.GetBlockPtr<std::uint64_t, true>(memory_ptr, DataLayout::OSM_NODE_ID_LIST);
|
||||
util::PackedVector<OSMNodeID, true> osmnodeid_list;
|
||||
util::PackedVector<OSMNodeID, osrm::storage::MemorySetting::SharedMemory> osmnodeid_list;
|
||||
|
||||
osmnodeid_list.reset(osmnodeid_ptr, layout.num_entries[DataLayout::OSM_NODE_ID_LIST]);
|
||||
|
||||
@@ -803,7 +803,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
|
||||
intersection_file.Skip<std::uint32_t>(1); // sum_lengths
|
||||
|
||||
std::vector<unsigned> bearing_offsets_data(bearing_blocks);
|
||||
std::vector<typename util::RangeTable<16, true>::BlockT> bearing_blocks_data(
|
||||
std::vector<typename util::RangeTable<16, osrm::storage::MemorySetting::SharedMemory>::BlockT> bearing_blocks_data(
|
||||
bearing_blocks);
|
||||
|
||||
intersection_file.ReadInto(bearing_offsets_data.data(), bearing_blocks);
|
||||
@@ -844,7 +844,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
|
||||
if (layout.GetBlockSize(DataLayout::BEARING_BLOCKS) > 0)
|
||||
{
|
||||
const auto bearing_blocks_ptr =
|
||||
layout.GetBlockPtr<typename util::RangeTable<16, true>::BlockT, true>(
|
||||
layout.GetBlockPtr<typename util::RangeTable<16, osrm::storage::MemorySetting::SharedMemory>::BlockT, true>(
|
||||
memory_ptr, DataLayout::BEARING_BLOCKS);
|
||||
BOOST_ASSERT(
|
||||
static_cast<std::size_t>(layout.GetBlockSize(DataLayout::BEARING_BLOCKS)) >=
|
||||
|
||||
Reference in New Issue
Block a user