Compare commits
6 Commits
v5.5.0-rc.4
...
v5.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
| f88f51fd98 | |||
| 98659fb0a0 | |||
| 8a1afe456f | |||
| f1384f5e44 | |||
| 1cd5394a16 | |||
| 8c7f744b1a |
@@ -220,3 +220,15 @@ Feature: Car - Restricted access
|
|||||||
Then routability should be
|
Then routability should be
|
||||||
| highway | toll | bothw |
|
| highway | toll | bothw |
|
||||||
| primary | yes | |
|
| primary | yes | |
|
||||||
|
|
||||||
|
Scenario: Car - directional access tags
|
||||||
|
Then routability should be
|
||||||
|
| highway | access | access:forward | access:backward | forw | backw |
|
||||||
|
| primary | yes | yes | yes | x | x |
|
||||||
|
| primary | yes | | no | x | |
|
||||||
|
| primary | yes | no | | | x |
|
||||||
|
| primary | yes | no | no | | |
|
||||||
|
| primary | no | no | no | | |
|
||||||
|
| primary | no | | yes | | x |
|
||||||
|
| primary | no | yes | | x | |
|
||||||
|
| primary | no | yes | yes | x | x |
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class Contractor
|
|||||||
EdgeID
|
EdgeID
|
||||||
LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
|
LoadEdgeExpandedGraph(const std::string &edge_based_graph_path,
|
||||||
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
|
std::vector<EdgeWeight> &node_weights,
|
||||||
const std::string &edge_segment_lookup_path,
|
const std::string &edge_segment_lookup_path,
|
||||||
const std::string &edge_penalty_path,
|
const std::string &edge_penalty_path,
|
||||||
const std::vector<std::string> &segment_speed_path,
|
const std::vector<std::string> &segment_speed_path,
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef MEMINFO_HPP
|
||||||
|
#define MEMINFO_HPP
|
||||||
|
|
||||||
|
#include "util/log.hpp"
|
||||||
|
|
||||||
|
#include <stxxl/mng>
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace osrm
|
||||||
|
{
|
||||||
|
namespace util
|
||||||
|
{
|
||||||
|
inline void DumpMemoryStats()
|
||||||
|
{
|
||||||
|
#if STXXL_VERSION_MAJOR > 1 || (STXXL_VERSION_MAJOR == 1 && STXXL_VERSION_MINOR >= 4)
|
||||||
|
auto manager = stxxl::block_manager::get_instance();
|
||||||
|
util::Log() << "STXXL: peak bytes used: " << manager->get_maximum_allocation();
|
||||||
|
util::Log() << "STXXL: total disk allocated: " << manager->get_total_bytes();
|
||||||
|
#else
|
||||||
|
#warning STXXL 1.4+ recommended - STXXL memory summary will not be available
|
||||||
|
util::Log() << "STXXL: memory summary not available, needs STXXL 1.4 or higher";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
rusage usage;
|
||||||
|
getrusage(RUSAGE_SELF, &usage);
|
||||||
|
#ifdef __linux__
|
||||||
|
// Under linux, ru.maxrss is in kb
|
||||||
|
util::Log() << "RAM: peak bytes used: " << usage.ru_maxrss * 1024;
|
||||||
|
#else // __linux__
|
||||||
|
// Under BSD systems (OSX), it's in bytes
|
||||||
|
util::Log() << "RAM: peak bytes used: " << usage.ru_maxrss;
|
||||||
|
#endif // __linux__
|
||||||
|
#else // _WIN32
|
||||||
|
util::Log() << "RAM: peak bytes used: <not implemented on Windows>";
|
||||||
|
#endif // _WIN32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -136,12 +136,24 @@ int Contractor::Run()
|
|||||||
|
|
||||||
TIMER_START(preparing);
|
TIMER_START(preparing);
|
||||||
|
|
||||||
|
util::Log() << "Reading node weights.";
|
||||||
|
std::vector<EdgeWeight> node_weights;
|
||||||
|
std::string node_file_name = config.osrm_input_path.string() + ".enw";
|
||||||
|
|
||||||
|
{
|
||||||
|
storage::io::FileReader node_file(node_file_name,
|
||||||
|
storage::io::FileReader::VerifyFingerprint);
|
||||||
|
node_file.DeserializeVector(node_weights);
|
||||||
|
}
|
||||||
|
util::Log() << "Done reading node weights.";
|
||||||
|
|
||||||
util::Log() << "Loading edge-expanded graph representation";
|
util::Log() << "Loading edge-expanded graph representation";
|
||||||
|
|
||||||
util::DeallocatingVector<extractor::EdgeBasedEdge> edge_based_edge_list;
|
util::DeallocatingVector<extractor::EdgeBasedEdge> edge_based_edge_list;
|
||||||
|
|
||||||
EdgeID max_edge_id = LoadEdgeExpandedGraph(config.edge_based_graph_path,
|
EdgeID max_edge_id = LoadEdgeExpandedGraph(config.edge_based_graph_path,
|
||||||
edge_based_edge_list,
|
edge_based_edge_list,
|
||||||
|
node_weights,
|
||||||
config.edge_segment_lookup_path,
|
config.edge_segment_lookup_path,
|
||||||
config.edge_penalty_path,
|
config.edge_penalty_path,
|
||||||
config.segment_speed_lookup_paths,
|
config.segment_speed_lookup_paths,
|
||||||
@@ -163,17 +175,6 @@ int Contractor::Run()
|
|||||||
ReadNodeLevels(node_levels);
|
ReadNodeLevels(node_levels);
|
||||||
}
|
}
|
||||||
|
|
||||||
util::Log() << "Reading node weights.";
|
|
||||||
std::vector<EdgeWeight> node_weights;
|
|
||||||
std::string node_file_name = config.osrm_input_path.string() + ".enw";
|
|
||||||
|
|
||||||
{
|
|
||||||
storage::io::FileReader node_file(node_file_name,
|
|
||||||
storage::io::FileReader::VerifyFingerprint);
|
|
||||||
node_file.DeserializeVector(node_weights);
|
|
||||||
}
|
|
||||||
util::Log() << "Done reading node weights.";
|
|
||||||
|
|
||||||
util::DeallocatingVector<QueryEdge> contracted_edge_list;
|
util::DeallocatingVector<QueryEdge> contracted_edge_list;
|
||||||
ContractGraph(max_edge_id,
|
ContractGraph(max_edge_id,
|
||||||
edge_based_edge_list,
|
edge_based_edge_list,
|
||||||
@@ -499,6 +500,7 @@ parse_turn_penalty_lookup_from_csv_files(const std::vector<std::string> &turn_pe
|
|||||||
EdgeID Contractor::LoadEdgeExpandedGraph(
|
EdgeID Contractor::LoadEdgeExpandedGraph(
|
||||||
std::string const &edge_based_graph_filename,
|
std::string const &edge_based_graph_filename,
|
||||||
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
util::DeallocatingVector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||||
|
std::vector<EdgeWeight> &node_weights,
|
||||||
const std::string &edge_segment_lookup_filename,
|
const std::string &edge_segment_lookup_filename,
|
||||||
const std::string &edge_penalty_filename,
|
const std::string &edge_penalty_filename,
|
||||||
const std::vector<std::string> &segment_speed_filenames,
|
const std::vector<std::string> &segment_speed_filenames,
|
||||||
@@ -914,6 +916,11 @@ EdgeID Contractor::LoadEdgeExpandedGraph(
|
|||||||
previous_osm_node_id = segmentblocks[i].this_osm_node_id;
|
previous_osm_node_id = segmentblocks[i].this_osm_node_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update the node-weight cache. This is the weight of the edge-based-node only,
|
||||||
|
// it doesn't include the turn. We may visit the same node multiple times, but
|
||||||
|
// we should always assign the same value here.
|
||||||
|
node_weights[inbuffer.source] = new_weight;
|
||||||
|
|
||||||
// We found a zero-speed edge, so we'll skip this whole edge-based-edge which
|
// We found a zero-speed edge, so we'll skip this whole edge-based-edge which
|
||||||
// effectively removes it from the routing network.
|
// effectively removes it from the routing network.
|
||||||
if (skip_this_edge)
|
if (skip_this_edge)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ util::Coordinate CoordinateExtractor::ExtractRepresentativeCoordinate(
|
|||||||
{
|
{
|
||||||
const auto result = ExtractCoordinateAtLength(
|
const auto result = ExtractCoordinateAtLength(
|
||||||
skipping_inaccuracies_distance, coordinates);
|
skipping_inaccuracies_distance, coordinates);
|
||||||
BOOST_ASSERT(is_valid_result(coordinates.back()));
|
BOOST_ASSERT(is_valid_result(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -186,11 +186,9 @@ operator()(const NodeID /*nid*/, const EdgeID source_edge_id, Intersection inter
|
|||||||
if (is_left_sliproad_turn)
|
if (is_left_sliproad_turn)
|
||||||
return main_road_intersection->intersection.getLeftmostRoad();
|
return main_road_intersection->intersection.getLeftmostRoad();
|
||||||
|
|
||||||
if (is_right_sliproad_turn)
|
BOOST_ASSERT_MSG(is_right_sliproad_turn,
|
||||||
return main_road_intersection->intersection.getRightmostRoad();
|
"Sliproad is neither a left nor right of obvious main road");
|
||||||
|
return main_road_intersection->intersection.getRightmostRoad();
|
||||||
BOOST_ASSERT_MSG(false, "Sliproad is neither a left nor right of obvious main road");
|
|
||||||
return main_road_intersection->intersection.getLeftmostRoad();
|
|
||||||
}();
|
}();
|
||||||
|
|
||||||
const auto &crossing_road_data = node_based_graph.GetEdgeData(crossing_road.eid);
|
const auto &crossing_road_data = node_based_graph.GetEdgeData(crossing_road.eid);
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
#include <new>
|
#include <new>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
|
#include "util/meminfo.hpp"
|
||||||
|
|
||||||
using namespace osrm;
|
using namespace osrm;
|
||||||
|
|
||||||
enum class return_code : unsigned
|
enum class return_code : unsigned
|
||||||
@@ -166,7 +168,11 @@ int main(int argc, char *argv[]) try
|
|||||||
|
|
||||||
tbb::task_scheduler_init init(contractor_config.requested_num_threads);
|
tbb::task_scheduler_init init(contractor_config.requested_num_threads);
|
||||||
|
|
||||||
return contractor::Contractor(contractor_config).Run();
|
auto exitcode = contractor::Contractor(contractor_config).Run();
|
||||||
|
|
||||||
|
util::DumpMemoryStats();
|
||||||
|
|
||||||
|
return exitcode;
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc &e)
|
catch (const std::bad_alloc &e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
#include <exception>
|
#include <exception>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
|
#include "util/meminfo.hpp"
|
||||||
|
|
||||||
using namespace osrm;
|
using namespace osrm;
|
||||||
|
|
||||||
enum class return_code : unsigned
|
enum class return_code : unsigned
|
||||||
@@ -153,7 +155,11 @@ int main(int argc, char *argv[]) try
|
|||||||
// setup scripting environment
|
// setup scripting environment
|
||||||
extractor::LuaScriptingEnvironment scripting_environment(
|
extractor::LuaScriptingEnvironment scripting_environment(
|
||||||
extractor_config.profile_path.string().c_str());
|
extractor_config.profile_path.string().c_str());
|
||||||
return extractor::Extractor(extractor_config).run(scripting_environment);
|
auto exitcode = extractor::Extractor(extractor_config).run(scripting_environment);
|
||||||
|
|
||||||
|
util::DumpMemoryStats();
|
||||||
|
|
||||||
|
return exitcode;
|
||||||
}
|
}
|
||||||
catch (const std::bad_alloc &e)
|
catch (const std::bad_alloc &e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user