The new numbering uses the partition information to sort border nodes first to compactify storages that need access indexed by border node ID. We also get an optimized cache performance for free sincr we can also recursively sort the nodes by cell ID. This implements issue #3779.
71 lines
1.9 KiB
C++
71 lines
1.9 KiB
C++
#ifndef PARTITIONER_CONFIG_HPP
|
|
#define PARTITIONER_CONFIG_HPP
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
#include <array>
|
|
#include <string>
|
|
|
|
namespace osrm
|
|
{
|
|
namespace partition
|
|
{
|
|
|
|
struct PartitionConfig
|
|
{
|
|
PartitionConfig()
|
|
: requested_num_threads(0), balance(1.2), boundary_factor(0.25), num_optimizing_cuts(10),
|
|
small_component_size(1000),
|
|
max_cell_sizes{128, 128 * 32, 128 * 32 * 16, 128 * 32 * 16 * 32}
|
|
{
|
|
}
|
|
|
|
void UseDefaults()
|
|
{
|
|
std::string basepath = base_path.string();
|
|
|
|
const std::string ext = ".osrm";
|
|
const auto pos = basepath.find(ext);
|
|
if (pos != std::string::npos)
|
|
{
|
|
basepath.replace(pos, ext.size(), "");
|
|
}
|
|
else
|
|
{
|
|
// unknown extension
|
|
}
|
|
|
|
edge_based_graph_path = basepath + ".osrm.ebg";
|
|
compressed_node_based_graph_path = basepath + ".osrm.cnbg";
|
|
cnbg_ebg_mapping_path = basepath + ".osrm.cnbg_to_ebg";
|
|
file_index_path = basepath + ".osrm.fileIndex";
|
|
partition_path = basepath + ".osrm.partition";
|
|
storage_path = basepath + ".osrm.cells";
|
|
node_data_path = basepath + ".osrm.ebg_nodes";
|
|
hsgr_path = basepath + ".osrm.hsgr";
|
|
}
|
|
|
|
// might be changed to the node based graph at some point
|
|
boost::filesystem::path base_path;
|
|
boost::filesystem::path edge_based_graph_path;
|
|
boost::filesystem::path compressed_node_based_graph_path;
|
|
boost::filesystem::path cnbg_ebg_mapping_path;
|
|
boost::filesystem::path partition_path;
|
|
boost::filesystem::path file_index_path;
|
|
boost::filesystem::path storage_path;
|
|
boost::filesystem::path node_data_path;
|
|
boost::filesystem::path hsgr_path;
|
|
|
|
unsigned requested_num_threads;
|
|
|
|
double balance;
|
|
double boundary_factor;
|
|
std::size_t num_optimizing_cuts;
|
|
std::size_t small_component_size;
|
|
std::vector<std::size_t> max_cell_sizes;
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif // PARTITIONER_CONFIG_HPP
|