Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Only allocate memory for call-loc when cfg-option is given
[simgrid.git] / src / smpi / smpi_bench.cpp
index 4fd4581..de5c96e 100644 (file)
@@ -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<std::string, double>::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<std::string, double>::const_iterator it = location2speedup.find(key);
     if (it != location2speedup.end()) {
       speedup = it->second;
     }
@@ -738,15 +738,12 @@ void smpi_destroy_global_memory_segments(){
 #endif
 }
 
-extern "C" {
-
-  smpi_trace_call_location_t trace_call_location;
-
+extern "C" { /** These functions will be called from the user code **/
   smpi_trace_call_location_t* smpi_trace_get_call_location() {
     return smpi_process_get_call_location();
   }
 
-  void smpi_trace_set_call_location(const char* file, int line) {
+  void smpi_trace_set_call_location(const char* file, const int line) {
     smpi_trace_call_location_t* loc = smpi_process_get_call_location();
 
     loc->previous_filename   = loc->filename;