Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
PAPI tracing was broken with latest instr changes.
[simgrid.git] / src / smpi / internals / smpi_bench.cpp
index 0c2d89b..6ce0054 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
@@ -158,13 +158,12 @@ void smpi_bench_end()
 
 #if HAVE_PAPI
   if (not smpi_cfg_papi_events_file().empty() && TRACE_smpi_is_enabled()) {
-    const simgrid::instr::Container* container =
+    simgrid::instr::Container* container =
         simgrid::instr::Container::by_name(std::string("rank-") + std::to_string(simgrid::s4u::this_actor::get_pid()));
     const papi_counter_t& counter_data = smpi_process()->papi_counters();
 
     for (auto const& pair : counter_data) {
-      auto* variable = static_cast<simgrid::instr::VariableType*>(container->type_->by_name(pair.first));
-      variable->set_event(SIMIX_get_clock(), pair.second);
+      container->get_variable(pair.first)->set_event(SIMIX_get_clock(), pair.second);
     }
   }
 #endif