osrm-backend/include/partition/partition_config.hpp
Daniel J. Hofmann b9ed20bb9b Implements Compressed Node Based Graph (De-)Serialization Skeleton
Implements parallel recursion for the partitioner
Fixes osrm-extract's -dump-partition-graph: accept no further tokens

References:
- http://www.boost.org/doc/libs/1_55_0/doc/html/boost/program_options/bool_switch.html

Pulls parameters through to make them configurable from the outside

Defaults are equivalent to:

    ./osrm-partition \
      berlin-latest.osrm \
      --max-cell-size 4096 \
      --balance 1.2 \
      --boundary 0.25 \
      --optimizing-cuts 10

Fixes parallel_do call for Intel TBB 4.2 (Trusty): no range-based overload
2017-03-01 16:09:29 +00:00

55 lines
1.2 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) {}
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";
partition_path = basepath + ".osrm.partition";
}
// 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 partition_path;
unsigned requested_num_threads;
std::size_t maximum_cell_size;
double balance;
double boundary_factor;
std::size_t num_optimizing_cuts;
};
}
}
#endif // PARTITIONER_CONFIG_HPP