Add namespace around all files
This commit is contained in:
+25
-17
@@ -12,45 +12,53 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
using EdgeData = QueryEdge::EdgeData;
|
||||
using QueryGraph = StaticGraph<EdgeData>;
|
||||
namespace osrm
|
||||
{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
using EdgeData = contractor::QueryEdge::EdgeData;
|
||||
using QueryGraph = util::StaticGraph<EdgeData>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
osrm::util::LogPolicy::GetInstance().Unmute();
|
||||
try
|
||||
{
|
||||
if (argc != 2)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "usage: " << argv[0] << " <file.hsgr>";
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "usage: " << argv[0] << " <file.hsgr>";
|
||||
return 1;
|
||||
}
|
||||
|
||||
boost::filesystem::path hsgr_path(argv[1]);
|
||||
|
||||
std::vector<QueryGraph::NodeArrayEntry> node_list;
|
||||
std::vector<QueryGraph::EdgeArrayEntry> edge_list;
|
||||
SimpleLogger().Write() << "loading graph from " << hsgr_path.string();
|
||||
std::vector<osrm::tools::QueryGraph::NodeArrayEntry> node_list;
|
||||
std::vector<osrm::tools::QueryGraph::EdgeArrayEntry> edge_list;
|
||||
osrm::util::SimpleLogger().Write() << "loading graph from " << hsgr_path.string();
|
||||
|
||||
unsigned m_check_sum = 0;
|
||||
unsigned m_number_of_nodes =
|
||||
readHSGRFromStream(hsgr_path, node_list, edge_list, &m_check_sum);
|
||||
SimpleLogger().Write() << "expecting " << m_number_of_nodes
|
||||
osrm::util::SimpleLogger().Write() << "expecting " << m_number_of_nodes
|
||||
<< " nodes, checksum: " << m_check_sum;
|
||||
BOOST_ASSERT_MSG(0 != node_list.size(), "node list empty");
|
||||
SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " << edge_list.size()
|
||||
osrm::util::SimpleLogger().Write() << "loaded " << node_list.size() << " nodes and " << edge_list.size()
|
||||
<< " edges";
|
||||
auto m_query_graph = std::make_shared<QueryGraph>(node_list, edge_list);
|
||||
auto m_query_graph = std::make_shared<osrm::tools::QueryGraph>(node_list, edge_list);
|
||||
|
||||
BOOST_ASSERT_MSG(0 == node_list.size(), "node list not flushed");
|
||||
BOOST_ASSERT_MSG(0 == edge_list.size(), "edge list not flushed");
|
||||
|
||||
Percent progress(m_query_graph->GetNumberOfNodes());
|
||||
for (const auto node_u : osrm::irange(0u, m_query_graph->GetNumberOfNodes()))
|
||||
osrm::util::Percent progress(m_query_graph->GetNumberOfNodes());
|
||||
for (const auto node_u : osrm::util::irange(0u, m_query_graph->GetNumberOfNodes()))
|
||||
{
|
||||
for (const auto eid : m_query_graph->GetAdjacentEdgeRange(node_u))
|
||||
{
|
||||
const EdgeData &data = m_query_graph->GetEdgeData(eid);
|
||||
const osrm::tools::EdgeData &data = m_query_graph->GetEdgeData(eid);
|
||||
if (!data.shortcut)
|
||||
{
|
||||
continue;
|
||||
@@ -59,7 +67,7 @@ int main(int argc, char *argv[])
|
||||
const EdgeID edge_id_1 = m_query_graph->FindEdgeInEitherDirection(node_u, data.id);
|
||||
if (SPECIAL_EDGEID == edge_id_1)
|
||||
{
|
||||
throw osrm::exception("cannot find first segment of edge (" +
|
||||
throw osrm::util::exception("cannot find first segment of edge (" +
|
||||
std::to_string(node_u) + "," + std::to_string(data.id) +
|
||||
"," + std::to_string(node_v) + "), eid: " +
|
||||
std::to_string(eid));
|
||||
@@ -67,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
const EdgeID edge_id_2 = m_query_graph->FindEdgeInEitherDirection(data.id, node_v);
|
||||
if (SPECIAL_EDGEID == edge_id_2)
|
||||
{
|
||||
throw osrm::exception("cannot find second segment of edge (" +
|
||||
throw osrm::util::exception("cannot find second segment of edge (" +
|
||||
std::to_string(node_u) + "," + std::to_string(data.id) +
|
||||
"," + std::to_string(node_v) + "), eid: " +
|
||||
std::to_string(eid));
|
||||
@@ -76,11 +84,11 @@ int main(int argc, char *argv[])
|
||||
progress.printStatus(node_u);
|
||||
}
|
||||
m_query_graph.reset();
|
||||
SimpleLogger().Write() << "Data file " << argv[0] << " appears to be OK";
|
||||
osrm::util::SimpleLogger().Write() << "Data file " << argv[0] << " appears to be OK";
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+41
-38
@@ -26,7 +26,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace
|
||||
namespace osrm
|
||||
{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
struct TarjanEdgeData
|
||||
@@ -37,7 +39,7 @@ struct TarjanEdgeData
|
||||
unsigned name_id;
|
||||
};
|
||||
|
||||
using TarjanGraph = StaticGraph<TarjanEdgeData>;
|
||||
using TarjanGraph = util::StaticGraph<TarjanEdgeData>;
|
||||
using TarjanEdge = TarjanGraph::InputEdge;
|
||||
|
||||
void deleteFileIfExists(const std::string &file_name)
|
||||
@@ -47,27 +49,26 @@ void deleteFileIfExists(const std::string &file_name)
|
||||
boost::filesystem::remove(file_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::size_t loadGraph(const char *path,
|
||||
std::vector<QueryNode> &coordinate_list,
|
||||
std::vector<extractor::QueryNode> &coordinate_list,
|
||||
std::vector<TarjanEdge> &graph_edge_list)
|
||||
{
|
||||
std::ifstream input_stream(path, std::ifstream::in | std::ifstream::binary);
|
||||
if (!input_stream.is_open())
|
||||
{
|
||||
throw osrm::exception("Cannot open osrm file");
|
||||
throw util::exception("Cannot open osrm file");
|
||||
}
|
||||
|
||||
// load graph data
|
||||
std::vector<NodeBasedEdge> edge_list;
|
||||
std::vector<extractor::NodeBasedEdge> edge_list;
|
||||
std::vector<NodeID> traffic_light_node_list;
|
||||
std::vector<NodeID> barrier_node_list;
|
||||
|
||||
auto number_of_nodes = loadNodesFromFile(input_stream, barrier_node_list,
|
||||
auto number_of_nodes = util::loadNodesFromFile(input_stream, barrier_node_list,
|
||||
traffic_light_node_list, coordinate_list);
|
||||
|
||||
loadEdgesFromFile(input_stream, edge_list);
|
||||
util::loadEdgesFromFile(input_stream, edge_list);
|
||||
|
||||
traffic_light_node_list.clear();
|
||||
traffic_light_node_list.shrink_to_fit();
|
||||
@@ -94,46 +95,48 @@ std::size_t loadGraph(const char *path,
|
||||
|
||||
return number_of_nodes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::vector<QueryNode> coordinate_list;
|
||||
std::vector<osrm::extractor::QueryNode> coordinate_list;
|
||||
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
osrm::util::LogPolicy::GetInstance().Unmute();
|
||||
try
|
||||
{
|
||||
// enable logging
|
||||
if (argc < 2)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "usage:\n" << argv[0] << " <osrm>";
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "usage:\n" << argv[0] << " <osrm>";
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<TarjanEdge> graph_edge_list;
|
||||
auto number_of_nodes = loadGraph(argv[1], coordinate_list, graph_edge_list);
|
||||
std::vector<osrm::tools::TarjanEdge> graph_edge_list;
|
||||
auto number_of_nodes = osrm::tools::loadGraph(argv[1], coordinate_list, graph_edge_list);
|
||||
|
||||
tbb::parallel_sort(graph_edge_list.begin(), graph_edge_list.end());
|
||||
const auto graph = std::make_shared<TarjanGraph>(number_of_nodes, graph_edge_list);
|
||||
const auto graph = std::make_shared<osrm::tools::TarjanGraph>(number_of_nodes, graph_edge_list);
|
||||
graph_edge_list.clear();
|
||||
graph_edge_list.shrink_to_fit();
|
||||
|
||||
SimpleLogger().Write() << "Starting SCC graph traversal";
|
||||
osrm::util::SimpleLogger().Write() << "Starting SCC graph traversal";
|
||||
|
||||
auto tarjan = osrm::make_unique<TarjanSCC<TarjanGraph>>(graph);
|
||||
auto tarjan = osrm::util::make_unique<osrm::extractor::TarjanSCC<osrm::tools::TarjanGraph>>(graph);
|
||||
tarjan->run();
|
||||
SimpleLogger().Write() << "identified: " << tarjan->get_number_of_components()
|
||||
osrm::util::SimpleLogger().Write() << "identified: " << tarjan->get_number_of_components()
|
||||
<< " many components";
|
||||
SimpleLogger().Write() << "identified " << tarjan->get_size_one_count() << " size 1 SCCs";
|
||||
osrm::util::SimpleLogger().Write() << "identified " << tarjan->get_size_one_count() << " size 1 SCCs";
|
||||
|
||||
// output
|
||||
TIMER_START(SCC_RUN_SETUP);
|
||||
|
||||
// remove files from previous run if exist
|
||||
deleteFileIfExists("component.dbf");
|
||||
deleteFileIfExists("component.shx");
|
||||
deleteFileIfExists("component.shp");
|
||||
osrm::tools::deleteFileIfExists("component.dbf");
|
||||
osrm::tools::deleteFileIfExists("component.shx");
|
||||
osrm::tools::deleteFileIfExists("component.shp");
|
||||
|
||||
Percent percentage(graph->GetNumberOfNodes());
|
||||
osrm::util::Percent percentage(graph->GetNumberOfNodes());
|
||||
|
||||
OGRRegisterAll();
|
||||
|
||||
@@ -142,13 +145,13 @@ int main(int argc, char *argv[])
|
||||
OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(psz_driver_name);
|
||||
if (nullptr == po_driver)
|
||||
{
|
||||
throw osrm::exception("ESRI Shapefile driver not available");
|
||||
throw osrm::util::exception("ESRI Shapefile driver not available");
|
||||
}
|
||||
auto *po_datasource = po_driver->CreateDataSource("component.shp", nullptr);
|
||||
|
||||
if (nullptr == po_datasource)
|
||||
{
|
||||
throw osrm::exception("Creation of output file failed");
|
||||
throw osrm::util::exception("Creation of output file failed");
|
||||
}
|
||||
|
||||
auto *po_srs = new OGRSpatialReference();
|
||||
@@ -158,26 +161,26 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (nullptr == po_layer)
|
||||
{
|
||||
throw osrm::exception("Layer creation failed.");
|
||||
throw osrm::util::exception("Layer creation failed.");
|
||||
}
|
||||
TIMER_STOP(SCC_RUN_SETUP);
|
||||
SimpleLogger().Write() << "shapefile setup took " << TIMER_MSEC(SCC_RUN_SETUP) / 1000.
|
||||
osrm::util::SimpleLogger().Write() << "shapefile setup took " << TIMER_MSEC(SCC_RUN_SETUP) / 1000.
|
||||
<< "s";
|
||||
|
||||
uint64_t total_network_length = 0;
|
||||
percentage.reinit(graph->GetNumberOfNodes());
|
||||
TIMER_START(SCC_OUTPUT);
|
||||
for (const NodeID source : osrm::irange(0u, graph->GetNumberOfNodes()))
|
||||
for (const NodeID source : osrm::util::irange(0u, graph->GetNumberOfNodes()))
|
||||
{
|
||||
percentage.printIncrement();
|
||||
for (const auto current_edge : graph->GetAdjacentEdgeRange(source))
|
||||
{
|
||||
const TarjanGraph::NodeIterator target = graph->GetTarget(current_edge);
|
||||
const auto target = graph->GetTarget(current_edge);
|
||||
|
||||
if (source < target || SPECIAL_EDGEID == graph->FindEdge(target, source))
|
||||
{
|
||||
total_network_length +=
|
||||
100 * coordinate_calculation::greatCircleDistance(
|
||||
100 * osrm::util::coordinate_calculation::greatCircleDistance(
|
||||
coordinate_list[source].lat, coordinate_list[source].lon,
|
||||
coordinate_list[target].lat, coordinate_list[target].lon);
|
||||
|
||||
@@ -193,17 +196,17 @@ int main(int argc, char *argv[])
|
||||
if (size_of_containing_component < 1000)
|
||||
{
|
||||
OGRLineString line_string;
|
||||
line_string.addPoint(coordinate_list[source].lon / COORDINATE_PRECISION,
|
||||
coordinate_list[source].lat / COORDINATE_PRECISION);
|
||||
line_string.addPoint(coordinate_list[target].lon / COORDINATE_PRECISION,
|
||||
coordinate_list[target].lat / COORDINATE_PRECISION);
|
||||
line_string.addPoint(coordinate_list[source].lon / osrm::COORDINATE_PRECISION,
|
||||
coordinate_list[source].lat / osrm::COORDINATE_PRECISION);
|
||||
line_string.addPoint(coordinate_list[target].lon / osrm::COORDINATE_PRECISION,
|
||||
coordinate_list[target].lat / osrm::COORDINATE_PRECISION);
|
||||
|
||||
OGRFeature *po_feature = OGRFeature::CreateFeature(po_layer->GetLayerDefn());
|
||||
|
||||
po_feature->SetGeometry(&line_string);
|
||||
if (OGRERR_NONE != po_layer->CreateFeature(po_feature))
|
||||
{
|
||||
throw osrm::exception("Failed to create feature in shapefile.");
|
||||
throw osrm::util::exception("Failed to create feature in shapefile.");
|
||||
}
|
||||
OGRFeature::DestroyFeature(po_feature);
|
||||
}
|
||||
@@ -213,18 +216,18 @@ int main(int argc, char *argv[])
|
||||
OGRSpatialReference::DestroySpatialReference(po_srs);
|
||||
OGRDataSource::DestroyDataSource(po_datasource);
|
||||
TIMER_STOP(SCC_OUTPUT);
|
||||
SimpleLogger().Write() << "generating output took: " << TIMER_MSEC(SCC_OUTPUT) / 1000.
|
||||
osrm::util::SimpleLogger().Write() << "generating output took: " << TIMER_MSEC(SCC_OUTPUT) / 1000.
|
||||
<< "s";
|
||||
|
||||
SimpleLogger().Write() << "total network distance: "
|
||||
osrm::util::SimpleLogger().Write() << "total network distance: "
|
||||
<< static_cast<uint64_t>(total_network_length / 100 / 1000.)
|
||||
<< " km";
|
||||
|
||||
SimpleLogger().Write() << "finished component analysis";
|
||||
osrm::util::SimpleLogger().Write() << "finished component analysis";
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+19
-17
@@ -11,28 +11,30 @@
|
||||
#include <new>
|
||||
#include <ostream>
|
||||
|
||||
using namespace osrm;
|
||||
|
||||
int main(int argc, char *argv[]) try
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
ContractorConfig contractor_config;
|
||||
util::LogPolicy::GetInstance().Unmute();
|
||||
contractor::ContractorConfig contractor_config;
|
||||
|
||||
const return_code result = ContractorOptions::ParseArguments(argc, argv, contractor_config);
|
||||
const contractor::return_code result = contractor::ContractorOptions::ParseArguments(argc, argv, contractor_config);
|
||||
|
||||
if (return_code::fail == result)
|
||||
if (contractor::return_code::fail == result)
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (return_code::exit == result)
|
||||
if (contractor::return_code::exit == result)
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
ContractorOptions::GenerateOutputFilesNames(contractor_config);
|
||||
contractor::ContractorOptions::GenerateOutputFilesNames(contractor_config);
|
||||
|
||||
if (1 > contractor_config.requested_num_threads)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Number of threads must be 1 or larger";
|
||||
util::SimpleLogger().Write(logWARNING) << "Number of threads must be 1 or larger";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
@@ -40,43 +42,43 @@ int main(int argc, char *argv[]) try
|
||||
|
||||
if (recommended_num_threads != contractor_config.requested_num_threads)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "The recommended number of threads is "
|
||||
util::SimpleLogger().Write(logWARNING) << "The recommended number of threads is "
|
||||
<< recommended_num_threads
|
||||
<< "! This setting may have performance side-effects.";
|
||||
}
|
||||
|
||||
if (!boost::filesystem::is_regular_file(contractor_config.osrm_input_path))
|
||||
{
|
||||
SimpleLogger().Write(logWARNING)
|
||||
util::SimpleLogger().Write(logWARNING)
|
||||
<< "Input file " << contractor_config.osrm_input_path.string() << " not found!";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!boost::filesystem::is_regular_file(contractor_config.profile_path))
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Profile " << contractor_config.profile_path.string()
|
||||
util::SimpleLogger().Write(logWARNING) << "Profile " << contractor_config.profile_path.string()
|
||||
<< " not found!";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
SimpleLogger().Write() << "Input file: "
|
||||
util::SimpleLogger().Write() << "Input file: "
|
||||
<< contractor_config.osrm_input_path.filename().string();
|
||||
SimpleLogger().Write() << "Profile: " << contractor_config.profile_path.filename().string();
|
||||
SimpleLogger().Write() << "Threads: " << contractor_config.requested_num_threads;
|
||||
util::SimpleLogger().Write() << "Profile: " << contractor_config.profile_path.filename().string();
|
||||
util::SimpleLogger().Write() << "Threads: " << contractor_config.requested_num_threads;
|
||||
|
||||
tbb::task_scheduler_init init(contractor_config.requested_num_threads);
|
||||
|
||||
return Prepare(contractor_config).Run();
|
||||
return contractor::Prepare(contractor_config).Run();
|
||||
}
|
||||
catch (const std::bad_alloc &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
SimpleLogger().Write(logWARNING)
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING)
|
||||
<< "Please provide more memory or consider using a larger swapfile";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
+63
-49
@@ -19,10 +19,6 @@
|
||||
|
||||
#include "osrm/coordinate.hpp"
|
||||
|
||||
using RTreeLeaf = BaseDataFacade<QueryEdge::EdgeData>::RTreeLeaf;
|
||||
using RTreeNode = StaticRTree<RTreeLeaf, ShM<FixedPointCoordinate, true>::vector, true>::TreeNode;
|
||||
using QueryGraph = StaticGraph<QueryEdge::EdgeData>;
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
@@ -36,6 +32,20 @@ using QueryGraph = StaticGraph<QueryEdge::EdgeData>;
|
||||
#include <new>
|
||||
#include <string>
|
||||
|
||||
// FIXME remove after move to datastore
|
||||
using namespace osrm::engine::datafacade;
|
||||
using namespace osrm::datastore;
|
||||
using namespace osrm;
|
||||
|
||||
using RTreeLeaf = typename engine::datafacade::BaseDataFacade<contractor::QueryEdge::EdgeData>::RTreeLeaf;
|
||||
using RTreeNode = util::StaticRTree<RTreeLeaf, util::ShM<util::FixedPointCoordinate, true>::vector, true>::TreeNode;
|
||||
using QueryGraph = util::StaticGraph<contractor::QueryEdge::EdgeData>;
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
// delete a shared memory region. report warning if it could not be deleted
|
||||
void deleteRegion(const SharedDataType region)
|
||||
{
|
||||
@@ -62,13 +72,16 @@ void deleteRegion(const SharedDataType region)
|
||||
}
|
||||
}();
|
||||
|
||||
SimpleLogger().Write(logWARNING) << "could not delete shared memory region " << name;
|
||||
util::SimpleLogger().Write(logWARNING) << "could not delete shared memory region " << name;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int main(const int argc, const char *argv[]) try
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
util::LogPolicy::GetInstance().Unmute();
|
||||
SharedBarriers barrier;
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -76,7 +89,7 @@ int main(const int argc, const char *argv[]) try
|
||||
const bool lock_flags = MCL_CURRENT | MCL_FUTURE;
|
||||
if (-1 == mlockall(lock_flags))
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Process " << argv[0] << " could not request RAM lock";
|
||||
util::SimpleLogger().Write(logWARNING) << "Process " << argv[0] << " could not request RAM lock";
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -91,45 +104,45 @@ int main(const int argc, const char *argv[]) try
|
||||
barrier.pending_update_mutex.unlock();
|
||||
}
|
||||
|
||||
SimpleLogger().Write(logDEBUG) << "Checking input parameters";
|
||||
util::SimpleLogger().Write(logDEBUG) << "Checking input parameters";
|
||||
|
||||
std::unordered_map<std::string, boost::filesystem::path> server_paths;
|
||||
if (!GenerateDataStoreOptions(argc, argv, server_paths))
|
||||
if (!util::GenerateDataStoreOptions(argc, argv, server_paths))
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
if (server_paths.find("hsgrdata") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no hsgr file found");
|
||||
throw util::exception("no hsgr file found");
|
||||
}
|
||||
if (server_paths.find("ramindex") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no ram index file found");
|
||||
throw util::exception("no ram index file found");
|
||||
}
|
||||
if (server_paths.find("fileindex") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no leaf index file found");
|
||||
throw util::exception("no leaf index file found");
|
||||
}
|
||||
if (server_paths.find("nodesdata") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no nodes file found");
|
||||
throw util::exception("no nodes file found");
|
||||
}
|
||||
if (server_paths.find("edgesdata") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no edges file found");
|
||||
throw util::exception("no edges file found");
|
||||
}
|
||||
if (server_paths.find("namesdata") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no names file found");
|
||||
throw util::exception("no names file found");
|
||||
}
|
||||
if (server_paths.find("geometry") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no geometry file found");
|
||||
throw util::exception("no geometry file found");
|
||||
}
|
||||
if (server_paths.find("core") == server_paths.end())
|
||||
{
|
||||
throw osrm::exception("no core file found");
|
||||
throw util::exception("no core file found");
|
||||
}
|
||||
|
||||
auto paths_iterator = server_paths.find("hsgrdata");
|
||||
@@ -173,19 +186,19 @@ int main(const int argc, const char *argv[]) try
|
||||
|
||||
// determine segment to use
|
||||
bool segment2_in_use = SharedMemory::RegionExists(LAYOUT_2);
|
||||
const SharedDataType layout_region = [&]
|
||||
const engine::datafacade::SharedDataType layout_region = [&]
|
||||
{
|
||||
return segment2_in_use ? LAYOUT_1 : LAYOUT_2;
|
||||
}();
|
||||
const SharedDataType data_region = [&]
|
||||
const engine::datafacade::SharedDataType data_region = [&]
|
||||
{
|
||||
return segment2_in_use ? DATA_1 : DATA_2;
|
||||
}();
|
||||
const SharedDataType previous_layout_region = [&]
|
||||
const engine::datafacade::SharedDataType previous_layout_region = [&]
|
||||
{
|
||||
return segment2_in_use ? LAYOUT_2 : LAYOUT_1;
|
||||
}();
|
||||
const SharedDataType previous_data_region = [&]
|
||||
const engine::datafacade::SharedDataType previous_data_region = [&]
|
||||
{
|
||||
return segment2_in_use ? DATA_2 : DATA_1;
|
||||
}();
|
||||
@@ -198,15 +211,15 @@ int main(const int argc, const char *argv[]) try
|
||||
file_index_path.length() + 1);
|
||||
|
||||
// collect number of elements to store in shared memory object
|
||||
SimpleLogger().Write() << "load names from: " << names_data_path;
|
||||
util::SimpleLogger().Write() << "load names from: " << names_data_path;
|
||||
// number of entries in name index
|
||||
boost::filesystem::ifstream name_stream(names_data_path, std::ios::binary);
|
||||
unsigned name_blocks = 0;
|
||||
name_stream.read((char *)&name_blocks, sizeof(unsigned));
|
||||
shared_layout_ptr->SetBlockSize<unsigned>(SharedDataLayout::NAME_OFFSETS, name_blocks);
|
||||
shared_layout_ptr->SetBlockSize<typename RangeTable<16, true>::BlockT>(
|
||||
shared_layout_ptr->SetBlockSize<typename util::RangeTable<16, true>::BlockT>(
|
||||
SharedDataLayout::NAME_BLOCKS, name_blocks);
|
||||
SimpleLogger().Write() << "name offsets size: " << name_blocks;
|
||||
util::SimpleLogger().Write() << "name offsets size: " << name_blocks;
|
||||
BOOST_ASSERT_MSG(0 != name_blocks, "name file broken");
|
||||
|
||||
unsigned number_of_chars = 0;
|
||||
@@ -223,9 +236,9 @@ int main(const int argc, const char *argv[]) try
|
||||
number_of_original_edges);
|
||||
shared_layout_ptr->SetBlockSize<unsigned>(SharedDataLayout::NAME_ID_LIST,
|
||||
number_of_original_edges);
|
||||
shared_layout_ptr->SetBlockSize<TravelMode>(SharedDataLayout::TRAVEL_MODE,
|
||||
shared_layout_ptr->SetBlockSize<extractor::TravelMode>(SharedDataLayout::TRAVEL_MODE,
|
||||
number_of_original_edges);
|
||||
shared_layout_ptr->SetBlockSize<TurnInstruction>(SharedDataLayout::TURN_INSTRUCTION,
|
||||
shared_layout_ptr->SetBlockSize<extractor::TurnInstruction>(SharedDataLayout::TURN_INSTRUCTION,
|
||||
number_of_original_edges);
|
||||
// note: there are 32 geometry indicators in one unsigned block
|
||||
shared_layout_ptr->SetBlockSize<unsigned>(SharedDataLayout::GEOMETRIES_INDICATORS,
|
||||
@@ -233,16 +246,16 @@ int main(const int argc, const char *argv[]) try
|
||||
|
||||
boost::filesystem::ifstream hsgr_input_stream(hsgr_path, std::ios::binary);
|
||||
|
||||
FingerPrint fingerprint_valid = FingerPrint::GetValid();
|
||||
FingerPrint fingerprint_loaded;
|
||||
hsgr_input_stream.read((char *)&fingerprint_loaded, sizeof(FingerPrint));
|
||||
util::FingerPrint fingerprint_valid = util::FingerPrint::GetValid();
|
||||
util::FingerPrint fingerprint_loaded;
|
||||
hsgr_input_stream.read((char *)&fingerprint_loaded, sizeof(util::FingerPrint));
|
||||
if (fingerprint_loaded.TestGraphUtil(fingerprint_valid))
|
||||
{
|
||||
SimpleLogger().Write(logDEBUG) << "Fingerprint checked out ok";
|
||||
util::SimpleLogger().Write(logDEBUG) << "Fingerprint checked out ok";
|
||||
}
|
||||
else
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << ".hsgr was prepared with different build. "
|
||||
util::SimpleLogger().Write(logWARNING) << ".hsgr was prepared with different build. "
|
||||
"Reprocess to get rid of this warning.";
|
||||
}
|
||||
|
||||
@@ -279,7 +292,7 @@ int main(const int argc, const char *argv[]) try
|
||||
boost::filesystem::ifstream timestamp_stream(timestamp_path);
|
||||
if (!timestamp_stream)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << timestamp_path << " not found. setting to default";
|
||||
util::SimpleLogger().Write(logWARNING) << timestamp_path << " not found. setting to default";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -309,7 +322,7 @@ int main(const int argc, const char *argv[]) try
|
||||
boost::filesystem::ifstream nodes_input_stream(nodes_data_path, std::ios::binary);
|
||||
unsigned coordinate_list_size = 0;
|
||||
nodes_input_stream.read((char *)&coordinate_list_size, sizeof(unsigned));
|
||||
shared_layout_ptr->SetBlockSize<FixedPointCoordinate>(SharedDataLayout::COORDINATE_LIST,
|
||||
shared_layout_ptr->SetBlockSize<util::FixedPointCoordinate>(SharedDataLayout::COORDINATE_LIST,
|
||||
coordinate_list_size);
|
||||
|
||||
// load geometries sizes
|
||||
@@ -326,7 +339,7 @@ int main(const int argc, const char *argv[]) try
|
||||
shared_layout_ptr->SetBlockSize<unsigned>(SharedDataLayout::GEOMETRIES_LIST,
|
||||
number_of_compressed_geometries);
|
||||
// allocate shared memory block
|
||||
SimpleLogger().Write() << "allocating shared memory of " << shared_layout_ptr->GetSizeOfLayout()
|
||||
util::SimpleLogger().Write() << "allocating shared memory of " << shared_layout_ptr->GetSizeOfLayout()
|
||||
<< " bytes";
|
||||
SharedMemory *shared_memory =
|
||||
SharedMemoryFactory::Get(data_region, shared_layout_ptr->GetSizeOfLayout());
|
||||
@@ -390,19 +403,19 @@ int main(const int argc, const char *argv[]) try
|
||||
unsigned *name_id_ptr = shared_layout_ptr->GetBlockPtr<unsigned, true>(
|
||||
shared_memory_ptr, SharedDataLayout::NAME_ID_LIST);
|
||||
|
||||
TravelMode *travel_mode_ptr = shared_layout_ptr->GetBlockPtr<TravelMode, true>(
|
||||
extractor::TravelMode *travel_mode_ptr = shared_layout_ptr->GetBlockPtr<extractor::TravelMode, true>(
|
||||
shared_memory_ptr, SharedDataLayout::TRAVEL_MODE);
|
||||
|
||||
TurnInstruction *turn_instructions_ptr = shared_layout_ptr->GetBlockPtr<TurnInstruction, true>(
|
||||
extractor::TurnInstruction *turn_instructions_ptr = shared_layout_ptr->GetBlockPtr<extractor::TurnInstruction, true>(
|
||||
shared_memory_ptr, SharedDataLayout::TURN_INSTRUCTION);
|
||||
|
||||
unsigned *geometries_indicator_ptr = shared_layout_ptr->GetBlockPtr<unsigned, true>(
|
||||
shared_memory_ptr, SharedDataLayout::GEOMETRIES_INDICATORS);
|
||||
|
||||
OriginalEdgeData current_edge_data;
|
||||
extractor::OriginalEdgeData current_edge_data;
|
||||
for (unsigned i = 0; i < number_of_original_edges; ++i)
|
||||
{
|
||||
edges_input_stream.read((char *)&(current_edge_data), sizeof(OriginalEdgeData));
|
||||
edges_input_stream.read((char *)&(current_edge_data), sizeof(extractor::OriginalEdgeData));
|
||||
via_node_ptr[i] = current_edge_data.via_node;
|
||||
name_id_ptr[i] = current_edge_data.name_id;
|
||||
travel_mode_ptr[i] = current_edge_data.travel_mode;
|
||||
@@ -456,15 +469,15 @@ int main(const int argc, const char *argv[]) try
|
||||
}
|
||||
|
||||
// Loading list of coordinates
|
||||
FixedPointCoordinate *coordinates_ptr =
|
||||
shared_layout_ptr->GetBlockPtr<FixedPointCoordinate, true>(
|
||||
util::FixedPointCoordinate *coordinates_ptr =
|
||||
shared_layout_ptr->GetBlockPtr<util::FixedPointCoordinate, true>(
|
||||
shared_memory_ptr, SharedDataLayout::COORDINATE_LIST);
|
||||
|
||||
QueryNode current_node;
|
||||
extractor::QueryNode current_node;
|
||||
for (unsigned i = 0; i < coordinate_list_size; ++i)
|
||||
{
|
||||
nodes_input_stream.read((char *)¤t_node, sizeof(QueryNode));
|
||||
coordinates_ptr[i] = FixedPointCoordinate(current_node.lat, current_node.lon);
|
||||
nodes_input_stream.read((char *)¤t_node, sizeof(extractor::QueryNode));
|
||||
coordinates_ptr[i] = util::FixedPointCoordinate(current_node.lat, current_node.lon);
|
||||
}
|
||||
nodes_input_stream.close();
|
||||
|
||||
@@ -552,20 +565,21 @@ int main(const int argc, const char *argv[]) try
|
||||
data_timestamp_ptr->layout = layout_region;
|
||||
data_timestamp_ptr->data = data_region;
|
||||
data_timestamp_ptr->timestamp += 1;
|
||||
deleteRegion(previous_data_region);
|
||||
deleteRegion(previous_layout_region);
|
||||
SimpleLogger().Write() << "all data loaded";
|
||||
tools::deleteRegion(previous_data_region);
|
||||
tools::deleteRegion(previous_layout_region);
|
||||
util::SimpleLogger().Write() << "all data loaded";
|
||||
|
||||
shared_layout_ptr->PrintInformation();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
catch (const std::bad_alloc &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
SimpleLogger().Write(logWARNING) << "Please provide more memory or disable locking the virtual "
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING) << "Please provide more memory or disable locking the virtual "
|
||||
"address space (note: this makes OSRM swap, i.e. slow)";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "caught exception: " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING) << "caught exception: " << e.what();
|
||||
}
|
||||
|
||||
+15
-13
@@ -8,55 +8,57 @@
|
||||
#include <exception>
|
||||
#include <new>
|
||||
|
||||
using namespace osrm;
|
||||
|
||||
int main(int argc, char *argv[]) try
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
ExtractorConfig extractor_config;
|
||||
util::LogPolicy::GetInstance().Unmute();
|
||||
extractor::ExtractorConfig extractor_config;
|
||||
|
||||
const return_code result = ExtractorOptions::ParseArguments(argc, argv, extractor_config);
|
||||
const extractor::return_code result = extractor::ExtractorOptions::ParseArguments(argc, argv, extractor_config);
|
||||
|
||||
if (return_code::fail == result)
|
||||
if (extractor::return_code::fail == result)
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (return_code::exit == result)
|
||||
if (extractor::return_code::exit == result)
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
ExtractorOptions::GenerateOutputFilesNames(extractor_config);
|
||||
extractor::ExtractorOptions::GenerateOutputFilesNames(extractor_config);
|
||||
|
||||
if (1 > extractor_config.requested_num_threads)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Number of threads must be 1 or larger";
|
||||
util::SimpleLogger().Write(logWARNING) << "Number of threads must be 1 or larger";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!boost::filesystem::is_regular_file(extractor_config.input_path))
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Input file " << extractor_config.input_path.string()
|
||||
util::SimpleLogger().Write(logWARNING) << "Input file " << extractor_config.input_path.string()
|
||||
<< " not found!";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!boost::filesystem::is_regular_file(extractor_config.profile_path))
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Profile " << extractor_config.profile_path.string()
|
||||
util::SimpleLogger().Write(logWARNING) << "Profile " << extractor_config.profile_path.string()
|
||||
<< " not found!";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return extractor(extractor_config).run();
|
||||
return extractor::extractor(extractor_config).run();
|
||||
}
|
||||
catch (const std::bad_alloc &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
SimpleLogger().Write(logWARNING)
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING)
|
||||
<< "Please provide more memory or consider using a larger swapfile";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
+59
-54
@@ -1,4 +1,3 @@
|
||||
#include "util/version.hpp"
|
||||
#include "util/osrm_exception.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/timing_util.hpp"
|
||||
@@ -20,7 +19,12 @@
|
||||
#include <random>
|
||||
#include <vector>
|
||||
|
||||
const unsigned number_of_elements = 268435456;
|
||||
namespace osrm
|
||||
{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
const unsigned NUMBER_OF_ELEMENTS = 268435456;
|
||||
|
||||
struct Statistics
|
||||
{
|
||||
@@ -41,33 +45,34 @@ void runStatistics(std::vector<double> &timings_vector, Statistics &stats)
|
||||
stats.dev = std::sqrt(primary_sq_sum / timings_vector.size() - (stats.mean * stats.mean));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
SimpleLogger().Write() << "Not supported on FreeBSD";
|
||||
osrm::util::SimpleLogger().Write() << "Not supported on FreeBSD";
|
||||
return 0;
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
SimpleLogger().Write() << "Not supported on Windows";
|
||||
osrm::util::SimpleLogger().Write() << "Not supported on Windows";
|
||||
return 0;
|
||||
#else
|
||||
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
osrm::util::LogPolicy::GetInstance().Unmute();
|
||||
boost::filesystem::path test_path;
|
||||
try
|
||||
{
|
||||
SimpleLogger().Write() << "starting up engines, " << OSRM_VERSION;
|
||||
|
||||
if (1 == argc)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "usage: " << argv[0] << " /path/on/device";
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "usage: " << argv[0] << " /path/on/device";
|
||||
return -1;
|
||||
}
|
||||
|
||||
test_path = boost::filesystem::path(argv[1]);
|
||||
test_path /= "osrm.tst";
|
||||
SimpleLogger().Write(logDEBUG) << "temporary file: " << test_path.string();
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "temporary file: " << test_path.string();
|
||||
|
||||
// create files for testing
|
||||
if (2 == argc)
|
||||
@@ -75,17 +80,17 @@ int main(int argc, char *argv[])
|
||||
// create file to test
|
||||
if (boost::filesystem::exists(test_path))
|
||||
{
|
||||
throw osrm::exception("Data file already exists");
|
||||
throw osrm::util::exception("Data file already exists");
|
||||
}
|
||||
|
||||
int *random_array = new int[number_of_elements];
|
||||
std::generate(random_array, random_array + number_of_elements, std::rand);
|
||||
int *random_array = new int[osrm::tools::NUMBER_OF_ELEMENTS];
|
||||
std::generate(random_array, random_array + osrm::tools::NUMBER_OF_ELEMENTS, std::rand);
|
||||
#ifdef __APPLE__
|
||||
FILE *fd = fopen(test_path.string().c_str(), "w");
|
||||
fcntl(fileno(fd), F_NOCACHE, 1);
|
||||
fcntl(fileno(fd), F_RDAHEAD, 0);
|
||||
TIMER_START(write_1gb);
|
||||
write(fileno(fd), (char *)random_array, number_of_elements * sizeof(unsigned));
|
||||
write(fileno(fd), (char *)random_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned));
|
||||
TIMER_STOP(write_1gb);
|
||||
fclose(fd);
|
||||
#endif
|
||||
@@ -94,24 +99,24 @@ int main(int argc, char *argv[])
|
||||
open(test_path.string().c_str(), O_CREAT | O_TRUNC | O_WRONLY | O_SYNC, S_IRWXU);
|
||||
if (-1 == file_desc)
|
||||
{
|
||||
throw osrm::exception("Could not open random data file");
|
||||
throw osrm::util::exception("Could not open random data file");
|
||||
}
|
||||
TIMER_START(write_1gb);
|
||||
int ret = write(file_desc, random_array, number_of_elements * sizeof(unsigned));
|
||||
int ret = write(file_desc, random_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned));
|
||||
if (0 > ret)
|
||||
{
|
||||
throw osrm::exception("could not write random data file");
|
||||
throw osrm::util::exception("could not write random data file");
|
||||
}
|
||||
TIMER_STOP(write_1gb);
|
||||
close(file_desc);
|
||||
#endif
|
||||
delete[] random_array;
|
||||
SimpleLogger().Write(logDEBUG) << "writing raw 1GB took " << TIMER_SEC(write_1gb)
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "writing raw 1GB took " << TIMER_SEC(write_1gb)
|
||||
<< "s";
|
||||
SimpleLogger().Write() << "raw write performance: " << std::setprecision(5)
|
||||
osrm::util::SimpleLogger().Write() << "raw write performance: " << std::setprecision(5)
|
||||
<< std::fixed << 1024 * 1024 / TIMER_SEC(write_1gb) << "MB/sec";
|
||||
|
||||
SimpleLogger().Write(logDEBUG)
|
||||
osrm::util::SimpleLogger().Write(logDEBUG)
|
||||
<< "finished creation of random data. Flush disk cache now!";
|
||||
}
|
||||
else
|
||||
@@ -119,15 +124,15 @@ int main(int argc, char *argv[])
|
||||
// Run Non-Cached I/O benchmarks
|
||||
if (!boost::filesystem::exists(test_path))
|
||||
{
|
||||
throw osrm::exception("data file does not exist");
|
||||
throw osrm::util::exception("data file does not exist");
|
||||
}
|
||||
|
||||
// volatiles do not get optimized
|
||||
Statistics stats;
|
||||
osrm::tools::Statistics stats;
|
||||
|
||||
#ifdef __APPLE__
|
||||
volatile unsigned single_block[1024];
|
||||
char *raw_array = new char[number_of_elements * sizeof(unsigned)];
|
||||
char *raw_array = new char[osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned)];
|
||||
FILE *fd = fopen(test_path.string().c_str(), "r");
|
||||
fcntl(fileno(fd), F_NOCACHE, 1);
|
||||
fcntl(fileno(fd), F_RDAHEAD, 0);
|
||||
@@ -138,33 +143,33 @@ int main(int argc, char *argv[])
|
||||
int file_desc = open(test_path.string().c_str(), O_RDONLY | O_DIRECT | O_SYNC);
|
||||
if (-1 == file_desc)
|
||||
{
|
||||
SimpleLogger().Write(logDEBUG) << "opened, error: " << strerror(errno);
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "opened, error: " << strerror(errno);
|
||||
return -1;
|
||||
}
|
||||
char *raw_array = (char *)memalign(512, number_of_elements * sizeof(unsigned));
|
||||
char *raw_array = (char *)memalign(512, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned));
|
||||
#endif
|
||||
TIMER_START(read_1gb);
|
||||
#ifdef __APPLE__
|
||||
read(fileno(fd), raw_array, number_of_elements * sizeof(unsigned));
|
||||
read(fileno(fd), raw_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned));
|
||||
close(fileno(fd));
|
||||
fd = fopen(test_path.string().c_str(), "r");
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
int ret = read(file_desc, raw_array, number_of_elements * sizeof(unsigned));
|
||||
SimpleLogger().Write(logDEBUG) << "read " << ret
|
||||
int ret = read(file_desc, raw_array, osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned));
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "read " << ret
|
||||
<< " bytes, error: " << strerror(errno);
|
||||
close(file_desc);
|
||||
file_desc = open(test_path.string().c_str(), O_RDONLY | O_DIRECT | O_SYNC);
|
||||
SimpleLogger().Write(logDEBUG) << "opened, error: " << strerror(errno);
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "opened, error: " << strerror(errno);
|
||||
#endif
|
||||
TIMER_STOP(read_1gb);
|
||||
|
||||
SimpleLogger().Write(logDEBUG) << "reading raw 1GB took " << TIMER_SEC(read_1gb) << "s";
|
||||
SimpleLogger().Write() << "raw read performance: " << std::setprecision(5) << std::fixed
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "reading raw 1GB took " << TIMER_SEC(read_1gb) << "s";
|
||||
osrm::util::SimpleLogger().Write() << "raw read performance: " << std::setprecision(5) << std::fixed
|
||||
<< 1024 * 1024 / TIMER_SEC(read_1gb) << "MB/sec";
|
||||
|
||||
std::vector<double> timing_results_raw_random;
|
||||
SimpleLogger().Write(logDEBUG) << "running 1000 random I/Os of 4KB";
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "running 1000 random I/Os of 4KB";
|
||||
|
||||
#ifdef __APPLE__
|
||||
fseek(fd, 0, SEEK_SET);
|
||||
@@ -173,7 +178,7 @@ int main(int argc, char *argv[])
|
||||
lseek(file_desc, 0, SEEK_SET);
|
||||
#endif
|
||||
// make 1000 random access, time each I/O seperately
|
||||
unsigned number_of_blocks = (number_of_elements * sizeof(unsigned) - 1) / 4096;
|
||||
unsigned number_of_blocks = (osrm::tools::NUMBER_OF_ELEMENTS * sizeof(unsigned) - 1) / 4096;
|
||||
std::random_device rd;
|
||||
std::default_random_engine e1(rd());
|
||||
std::uniform_int_distribution<unsigned> uniform_dist(0, number_of_blocks - 1);
|
||||
@@ -199,30 +204,30 @@ int main(int argc, char *argv[])
|
||||
TIMER_STOP(random_access);
|
||||
if (((off_t)-1) == ret1)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno);
|
||||
throw osrm::exception("seek error");
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno);
|
||||
throw osrm::util::exception("seek error");
|
||||
}
|
||||
if (-1 == ret2)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "read error " << strerror(errno);
|
||||
throw osrm::exception("read error");
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "read error " << strerror(errno);
|
||||
throw osrm::util::exception("read error");
|
||||
}
|
||||
timing_results_raw_random.push_back(TIMER_SEC(random_access));
|
||||
}
|
||||
|
||||
// Do statistics
|
||||
SimpleLogger().Write(logDEBUG) << "running raw random I/O statistics";
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "running raw random I/O statistics";
|
||||
std::ofstream random_csv("random.csv", std::ios::trunc);
|
||||
for (unsigned i = 0; i < timing_results_raw_random.size(); ++i)
|
||||
{
|
||||
random_csv << i << ", " << timing_results_raw_random[i] << std::endl;
|
||||
}
|
||||
random_csv.close();
|
||||
runStatistics(timing_results_raw_random, stats);
|
||||
osrm::tools::runStatistics(timing_results_raw_random, stats);
|
||||
|
||||
SimpleLogger().Write() << "raw random I/O: " << std::setprecision(5) << std::fixed
|
||||
osrm::util::SimpleLogger().Write() << "raw random I/O: " << std::setprecision(5) << std::fixed
|
||||
<< "min: " << stats.min << "ms, "
|
||||
<< "mean: " << stats.mean << "ms, "
|
||||
<< "med: " << stats.med << "ms, "
|
||||
@@ -260,15 +265,15 @@ int main(int argc, char *argv[])
|
||||
TIMER_STOP(read_every_100);
|
||||
if (((off_t)-1) == ret1)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno);
|
||||
throw osrm::exception("seek error");
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "seek error " << strerror(errno);
|
||||
throw osrm::util::exception("seek error");
|
||||
}
|
||||
if (-1 == ret2)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
SimpleLogger().Write(logWARNING) << "read error " << strerror(errno);
|
||||
throw osrm::exception("read error");
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "offset: " << current_offset;
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "read error " << strerror(errno);
|
||||
throw osrm::util::exception("read error");
|
||||
}
|
||||
timing_results_raw_seq.push_back(TIMER_SEC(read_every_100));
|
||||
}
|
||||
@@ -282,7 +287,7 @@ int main(int argc, char *argv[])
|
||||
close(file_desc);
|
||||
#endif
|
||||
// Do statistics
|
||||
SimpleLogger().Write(logDEBUG) << "running sequential I/O statistics";
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "running sequential I/O statistics";
|
||||
// print simple statistics: min, max, median, variance
|
||||
std::ofstream seq_csv("sequential.csv", std::ios::trunc);
|
||||
for (unsigned i = 0; i < timing_results_raw_seq.size(); ++i)
|
||||
@@ -290,8 +295,8 @@ int main(int argc, char *argv[])
|
||||
seq_csv << i << ", " << timing_results_raw_seq[i] << std::endl;
|
||||
}
|
||||
seq_csv.close();
|
||||
runStatistics(timing_results_raw_seq, stats);
|
||||
SimpleLogger().Write() << "raw sequential I/O: " << std::setprecision(5) << std::fixed
|
||||
osrm::tools::runStatistics(timing_results_raw_seq, stats);
|
||||
osrm::util::SimpleLogger().Write() << "raw sequential I/O: " << std::setprecision(5) << std::fixed
|
||||
<< "min: " << stats.min << "ms, "
|
||||
<< "mean: " << stats.mean << "ms, "
|
||||
<< "med: " << stats.med << "ms, "
|
||||
@@ -301,18 +306,18 @@ int main(int argc, char *argv[])
|
||||
if (boost::filesystem::exists(test_path))
|
||||
{
|
||||
boost::filesystem::remove(test_path);
|
||||
SimpleLogger().Write(logDEBUG) << "removing temporary files";
|
||||
osrm::util::SimpleLogger().Write(logDEBUG) << "removing temporary files";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "caught exception: " << e.what();
|
||||
SimpleLogger().Write(logWARNING) << "cleaning up, and exiting";
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "caught exception: " << e.what();
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "cleaning up, and exiting";
|
||||
if (boost::filesystem::exists(test_path))
|
||||
{
|
||||
boost::filesystem::remove(test_path);
|
||||
SimpleLogger().Write(logWARNING) << "removing temporary files";
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "removing temporary files";
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
+25
-23
@@ -39,25 +39,27 @@ BOOL WINAPI console_ctrl_handler(DWORD ctrl_type)
|
||||
}
|
||||
#endif
|
||||
|
||||
using namespace osrm;
|
||||
|
||||
int main(int argc, const char *argv[]) try
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
util::LogPolicy::GetInstance().Unmute();
|
||||
|
||||
bool trial_run = false;
|
||||
std::string ip_address;
|
||||
int ip_port, requested_thread_num;
|
||||
|
||||
LibOSRMConfig lib_config;
|
||||
const unsigned init_result = GenerateServerProgramOptions(
|
||||
const unsigned init_result = util::GenerateServerProgramOptions(
|
||||
argc, argv, lib_config.server_paths, ip_address, ip_port, requested_thread_num,
|
||||
lib_config.use_shared_memory, trial_run, lib_config.max_locations_trip,
|
||||
lib_config.max_locations_viaroute, lib_config.max_locations_distance_table,
|
||||
lib_config.max_locations_map_matching);
|
||||
if (init_result == INIT_OK_DO_NOT_START_ENGINE)
|
||||
if (init_result == util::INIT_OK_DO_NOT_START_ENGINE)
|
||||
{
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (init_result == INIT_FAILED)
|
||||
if (init_result == util::INIT_FAILED)
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
@@ -70,7 +72,7 @@ int main(int argc, const char *argv[]) try
|
||||
if (should_lock && -1 == mlockall(MCL_CURRENT | MCL_FUTURE))
|
||||
{
|
||||
could_lock = false;
|
||||
SimpleLogger().Write(logWARNING) << "memory could not be locked to RAM";
|
||||
util::SimpleLogger().Write(logWARNING) << "memory could not be locked to RAM";
|
||||
}
|
||||
}
|
||||
~MemoryLocker()
|
||||
@@ -81,16 +83,16 @@ int main(int argc, const char *argv[]) try
|
||||
bool should_lock = false, could_lock = true;
|
||||
} memory_locker(lib_config.use_shared_memory);
|
||||
#endif
|
||||
SimpleLogger().Write() << "starting up engines, " << OSRM_VERSION;
|
||||
util::SimpleLogger().Write() << "starting up engines, " << OSRM_VERSION;
|
||||
|
||||
if (lib_config.use_shared_memory)
|
||||
{
|
||||
SimpleLogger().Write(logDEBUG) << "Loading from shared memory";
|
||||
util::SimpleLogger().Write(logDEBUG) << "Loading from shared memory";
|
||||
}
|
||||
|
||||
SimpleLogger().Write(logDEBUG) << "Threads:\t" << requested_thread_num;
|
||||
SimpleLogger().Write(logDEBUG) << "IP address:\t" << ip_address;
|
||||
SimpleLogger().Write(logDEBUG) << "IP port:\t" << ip_port;
|
||||
util::SimpleLogger().Write(logDEBUG) << "Threads:\t" << requested_thread_num;
|
||||
util::SimpleLogger().Write(logDEBUG) << "IP address:\t" << ip_address;
|
||||
util::SimpleLogger().Write(logDEBUG) << "IP port:\t" << ip_port;
|
||||
|
||||
#ifndef _WIN32
|
||||
int sig = 0;
|
||||
@@ -101,13 +103,13 @@ int main(int argc, const char *argv[]) try
|
||||
#endif
|
||||
|
||||
OSRM osrm_lib(lib_config);
|
||||
auto routing_server = Server::CreateServer(ip_address, ip_port, requested_thread_num);
|
||||
auto routing_server = server::Server::CreateServer(ip_address, ip_port, requested_thread_num);
|
||||
|
||||
routing_server->GetRequestHandlerPtr().RegisterRoutingMachine(&osrm_lib);
|
||||
|
||||
if (trial_run)
|
||||
{
|
||||
SimpleLogger().Write() << "trial run, quitting after successful initialization";
|
||||
util::SimpleLogger().Write() << "trial run, quitting after successful initialization";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -127,18 +129,18 @@ int main(int argc, const char *argv[]) try
|
||||
sigaddset(&wait_mask, SIGQUIT);
|
||||
sigaddset(&wait_mask, SIGTERM);
|
||||
pthread_sigmask(SIG_BLOCK, &wait_mask, nullptr);
|
||||
SimpleLogger().Write() << "running and waiting for requests";
|
||||
util::SimpleLogger().Write() << "running and waiting for requests";
|
||||
sigwait(&wait_mask, &sig);
|
||||
#else
|
||||
// Set console control handler to allow server to be stopped.
|
||||
console_ctrl_function = std::bind(&Server::Stop, routing_server);
|
||||
console_ctrl_function = std::bind(&server::Server::Stop, routing_server);
|
||||
SetConsoleCtrlHandler(console_ctrl_handler, TRUE);
|
||||
SimpleLogger().Write() << "running and waiting for requests";
|
||||
util::SimpleLogger().Write() << "running and waiting for requests";
|
||||
routing_server->Run();
|
||||
#endif
|
||||
SimpleLogger().Write() << "initiating shutdown";
|
||||
util::SimpleLogger().Write() << "initiating shutdown";
|
||||
routing_server->Stop();
|
||||
SimpleLogger().Write() << "stopping threads";
|
||||
util::SimpleLogger().Write() << "stopping threads";
|
||||
|
||||
auto status = future.wait_for(std::chrono::seconds(2));
|
||||
|
||||
@@ -148,24 +150,24 @@ int main(int argc, const char *argv[]) try
|
||||
}
|
||||
else
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "Didn't exit within 2 seconds. Hard abort!";
|
||||
util::SimpleLogger().Write(logWARNING) << "Didn't exit within 2 seconds. Hard abort!";
|
||||
server_task.reset(); // just kill it
|
||||
}
|
||||
}
|
||||
|
||||
SimpleLogger().Write() << "freeing objects";
|
||||
util::SimpleLogger().Write() << "freeing objects";
|
||||
routing_server.reset();
|
||||
SimpleLogger().Write() << "shutdown completed";
|
||||
util::SimpleLogger().Write() << "shutdown completed";
|
||||
}
|
||||
catch (const std::bad_alloc &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
SimpleLogger().Write(logWARNING)
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING)
|
||||
<< "Please provide more memory or consider using a larger swapfile";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
util::SimpleLogger().Write(logWARNING) << "[exception] " << e.what();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
+14
-16
@@ -1,4 +1,3 @@
|
||||
#include "util/version.hpp"
|
||||
#include "util/json_renderer.hpp"
|
||||
#include "util/routed_options.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
@@ -12,32 +11,31 @@
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
osrm::util::LogPolicy::GetInstance().Unmute();
|
||||
try
|
||||
{
|
||||
std::string ip_address;
|
||||
int ip_port, requested_thread_num;
|
||||
bool trial_run = false;
|
||||
LibOSRMConfig lib_config;
|
||||
const unsigned init_result = GenerateServerProgramOptions(
|
||||
osrm::LibOSRMConfig lib_config;
|
||||
const unsigned init_result = osrm::util::GenerateServerProgramOptions(
|
||||
argc, argv, lib_config.server_paths, ip_address, ip_port, requested_thread_num,
|
||||
lib_config.use_shared_memory, trial_run, lib_config.max_locations_trip,
|
||||
lib_config.max_locations_viaroute, lib_config.max_locations_distance_table,
|
||||
lib_config.max_locations_map_matching);
|
||||
|
||||
if (init_result == INIT_OK_DO_NOT_START_ENGINE)
|
||||
if (init_result == osrm::util::INIT_OK_DO_NOT_START_ENGINE)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (init_result == INIT_FAILED)
|
||||
if (init_result == osrm::util::INIT_FAILED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
SimpleLogger().Write() << "starting up engines, " << OSRM_VERSION;
|
||||
|
||||
OSRM routing_machine(lib_config);
|
||||
osrm::OSRM routing_machine(lib_config);
|
||||
|
||||
RouteParameters route_parameters;
|
||||
osrm::RouteParameters route_parameters;
|
||||
route_parameters.zoom_level = 18; // no generalization
|
||||
route_parameters.print_instructions = true; // turn by turn instructions
|
||||
route_parameters.alternate_route = true; // get an alternate route, too
|
||||
@@ -51,19 +49,19 @@ int main(int argc, const char *argv[])
|
||||
// route_parameters.hints.push_back(); // see wiki, saves I/O if done properly
|
||||
|
||||
// start_coordinate
|
||||
route_parameters.coordinates.emplace_back(52.519930 * COORDINATE_PRECISION,
|
||||
13.438640 * COORDINATE_PRECISION);
|
||||
route_parameters.coordinates.emplace_back(52.519930 * osrm::COORDINATE_PRECISION,
|
||||
13.438640 * osrm::COORDINATE_PRECISION);
|
||||
// target_coordinate
|
||||
route_parameters.coordinates.emplace_back(52.513191 * COORDINATE_PRECISION,
|
||||
13.415852 * COORDINATE_PRECISION);
|
||||
route_parameters.coordinates.emplace_back(52.513191 * osrm::COORDINATE_PRECISION,
|
||||
13.415852 * osrm::COORDINATE_PRECISION);
|
||||
osrm::json::Object json_result;
|
||||
const int result_code = routing_machine.RunQuery(route_parameters, json_result);
|
||||
SimpleLogger().Write() << "http code: " << result_code;
|
||||
osrm::json::render(SimpleLogger().Write(), json_result);
|
||||
osrm::util::SimpleLogger().Write() << "http code: " << result_code;
|
||||
osrm::json::render(osrm::util::SimpleLogger().Write(), json_result);
|
||||
}
|
||||
catch (std::exception ¤t_exception)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "caught exception: " << current_exception.what();
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "caught exception: " << current_exception.what();
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
+23
-14
@@ -2,9 +2,17 @@
|
||||
|
||||
#include "datastore/shared_memory_factory.hpp"
|
||||
#include "engine/datafacade/shared_datatype.hpp"
|
||||
#include "util/version.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
// FIXME remove after folding back into datastore
|
||||
using namespace datastore;
|
||||
using namespace engine::datafacade;
|
||||
|
||||
void deleteRegion(const SharedDataType region)
|
||||
{
|
||||
if (SharedMemory::RegionExists(region) && !SharedMemory::Remove(region))
|
||||
@@ -30,46 +38,47 @@ void deleteRegion(const SharedDataType region)
|
||||
}
|
||||
}();
|
||||
|
||||
SimpleLogger().Write(logWARNING) << "could not delete shared memory region " << name;
|
||||
util::SimpleLogger().Write(logWARNING) << "could not delete shared memory region " << name;
|
||||
}
|
||||
}
|
||||
|
||||
// find all existing shmem regions and remove them.
|
||||
void springclean()
|
||||
{
|
||||
SimpleLogger().Write() << "spring-cleaning all shared memory regions";
|
||||
util::SimpleLogger().Write() << "spring-cleaning all shared memory regions";
|
||||
deleteRegion(DATA_1);
|
||||
deleteRegion(LAYOUT_1);
|
||||
deleteRegion(DATA_2);
|
||||
deleteRegion(LAYOUT_2);
|
||||
deleteRegion(CURRENT_REGIONS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
osrm::util::LogPolicy::GetInstance().Unmute();
|
||||
try
|
||||
{
|
||||
SimpleLogger().Write() << "starting up engines, " << OSRM_VERSION << "\n\n";
|
||||
SimpleLogger().Write() << "Releasing all locks";
|
||||
SimpleLogger().Write() << "ATTENTION! BE CAREFUL!";
|
||||
SimpleLogger().Write() << "----------------------";
|
||||
SimpleLogger().Write() << "This tool may put osrm-routed into an undefined state!";
|
||||
SimpleLogger().Write() << "Type 'Y' to acknowledge that you know what your are doing.";
|
||||
SimpleLogger().Write() << "\n\nDo you want to purge all shared memory allocated "
|
||||
osrm::util::SimpleLogger().Write() << "Releasing all locks";
|
||||
osrm::util::SimpleLogger().Write() << "ATTENTION! BE CAREFUL!";
|
||||
osrm::util::SimpleLogger().Write() << "----------------------";
|
||||
osrm::util::SimpleLogger().Write() << "This tool may put osrm-routed into an undefined state!";
|
||||
osrm::util::SimpleLogger().Write() << "Type 'Y' to acknowledge that you know what your are doing.";
|
||||
osrm::util::SimpleLogger().Write() << "\n\nDo you want to purge all shared memory allocated "
|
||||
<< "by osrm-datastore? [type 'Y' to confirm]";
|
||||
|
||||
const auto letter = getchar();
|
||||
if (letter != 'Y')
|
||||
{
|
||||
SimpleLogger().Write() << "aborted.";
|
||||
osrm::util::SimpleLogger().Write() << "aborted.";
|
||||
return 0;
|
||||
}
|
||||
springclean();
|
||||
osrm::tools::springclean();
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[excpetion] " << e.what();
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "[excpetion] " << e.what();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "util/version.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "engine/datafacade/shared_barriers.hpp"
|
||||
|
||||
@@ -6,19 +5,18 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
LogPolicy::GetInstance().Unmute();
|
||||
osrm::util::LogPolicy::GetInstance().Unmute();
|
||||
try
|
||||
{
|
||||
SimpleLogger().Write() << "starting up engines, " << OSRM_VERSION;
|
||||
SimpleLogger().Write() << "Releasing all locks";
|
||||
SharedBarriers barrier;
|
||||
osrm::util::SimpleLogger().Write() << "Releasing all locks";
|
||||
osrm::engine::datafacade::SharedBarriers barrier;
|
||||
barrier.pending_update_mutex.unlock();
|
||||
barrier.query_mutex.unlock();
|
||||
barrier.update_mutex.unlock();
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
SimpleLogger().Write(logWARNING) << "[excpetion] " << e.what();
|
||||
osrm::util::SimpleLogger().Write(logWARNING) << "[excpetion] " << e.what();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user