From: Martin Quinson Date: Thu, 26 May 2016 22:22:05 +0000 (+0200) Subject: use unordered_map instead of map for sake of speed X-Git-Tag: v3_14~1156 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ed511a15702f5a82f740888d43348bc1c7e07205 use unordered_map instead of map for sake of speed an also hopefully to avoid a FTBFS on travis: /home/travis/build/simgrid/simgrid/src/smpi/private.hpp:13:36: error: wrong number of template arguments (2, should be 4) /usr/include/boost/detail/container_fwd.hpp:132:73: error: provided for ‘template class std::map’ --- diff --git a/examples/s4u/io/s4u_io.cpp b/examples/s4u/io/s4u_io.cpp index b5a06a99ff..4ebaea7bf5 100644 --- a/examples/s4u/io/s4u_io.cpp +++ b/examples/s4u/io/s4u_io.cpp @@ -3,7 +3,6 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include #include #include diff --git a/src/smpi/private.hpp b/src/smpi/private.hpp index 6d3e172357..53233742e8 100644 --- a/src/smpi/private.hpp +++ b/src/smpi/private.hpp @@ -6,6 +6,7 @@ #ifndef SMPI_PRIVATE_HPP #define SMPI_PRIVATE_HPP +#include #include "src/instr/instr_smpi.h" #ifdef HAVE_PAPI @@ -15,7 +16,7 @@ XBT_PRIVATE papi_counter_t& smpi_process_counter_data(void); XBT_PRIVATE int smpi_process_event_set(void); #endif -extern std::map location2speedup; +extern std::unordered_map location2speedup; /** @brief Returns the last call location (filename, linenumber). Process-specific. */ XBT_PUBLIC(smpi_trace_call_location_t*) smpi_process_get_call_location(void); diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index 891b66338f..31dce5b38f 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -266,9 +266,9 @@ void smpi_bench_end(void) if (xbt_cfg_get_string("smpi/comp-adjustment-file")[0] != '\0') { // Maybe we need to artificially speed up or slow // down our computation based on our statistical analysis. - smpi_trace_call_location_t* loc = smpi_process_get_call_location(); - std::string key = loc->get_composed_key(); - std::map::const_iterator it = location2speedup.find(key); + smpi_trace_call_location_t* loc = smpi_process_get_call_location(); + std::string key = loc->get_composed_key(); + std::unordered_map::const_iterator it = location2speedup.find(key); if (it != location2speedup.end()) { speedup = it->second; } diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 2dd5af60fe..33b69b5545 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -28,7 +28,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke #include #include /* trim_right / trim_left */ -std::map location2speedup; +std::unordered_map location2speedup; typedef struct s_smpi_process_data { double simulated; diff --git a/src/surf/plugins/energy.hpp b/src/surf/plugins/energy.hpp index b854921247..59db005032 100644 --- a/src/surf/plugins/energy.hpp +++ b/src/surf/plugins/energy.hpp @@ -8,7 +8,7 @@ #include -#include +#include #include "src/surf/HostImpl.hpp" diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index bf34da15d5..e48ee7b001 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -16,7 +16,6 @@ #include #include -#include SG_BEGIN_DECL() XBT_PUBLIC(void) routing_model_create(Link *loopback);