XBT_PRIVATE container_t smpi_container(int rank);
XBT_PRIVATE void TRACE_smpi_setup_container(int rank, sg_host_t host);
-XBT_PRIVATE void TRACE_internal_smpi_set_category(const std::string& category);
-XBT_PRIVATE std::string TRACE_internal_smpi_get_category();
XBT_PRIVATE void TRACE_smpi_computing_init(int rank);
XBT_PRIVATE void TRACE_smpi_computing_out(int rank);
XBT_PRIVATE void TRACE_smpi_computing_in(int rank, double amount);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "private.hpp"
+#include "simgrid/instr.h"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#include "smpi_comm.hpp"
{
//need to end bench otherwise categories for execution tasks are wrong
smpi_bench_end();
- if (category != nullptr)
- TRACE_internal_smpi_set_category(category);
+ if (category != nullptr) {
+ // declare category
+ TRACE_category(category);
+ smpi_process()->set_tracing_category(category);
+ }
//begin bench after changing process's category
smpi_bench_begin();
}
s4u::ActorPtr actor_ = nullptr;
smpi_privatization_region_t privatized_region_ = nullptr;
int optind = 0; /*for getopt replacement */
+ std::string tracing_category_ = "";
+
#if HAVE_PAPI
/** Contains hardware data as read by PAPI **/
int papi_event_set_;
void mark_as_initialized();
void set_replaying(bool value);
bool replaying();
+ void set_tracing_category(const std::string& category) { tracing_category_ = category; }
+ const std::string& get_tracing_category() { return tracing_category_; }
smpi_trace_call_location_t* call_location();
void set_privatized_region(smpi_privatization_region_t region);
smpi_privatization_region_t privatized_region();
return key;
}
-static std::unordered_map<smx_actor_t, std::string> process_category;
-
-void TRACE_internal_smpi_set_category(const std::string& category)
-{
- if (not TRACE_smpi_is_enabled())
- return;
-
- //declare category
- TRACE_category(category.c_str());
-
- if (not category.empty())
- process_category[SIMIX_process_self()] = category;
-}
-
-std::string TRACE_internal_smpi_get_category()
-{
- if (not TRACE_smpi_is_enabled())
- return "";
-
- auto it = process_category.find(SIMIX_process_self());
- return (it == process_category.end()) ? "" : it->second.c_str();
-}
-
void TRACE_smpi_setup_container(int rank, sg_host_t host)
{
container_t father = simgrid::instr::Container::get_root();
XBT_DEBUG("Handle real computation time: %f flops", flops);
simgrid::s4u::this_actor::exec_init(flops)
->set_name("computation")
- ->set_tracing_category(TRACE_internal_smpi_get_category())
+ ->set_tracing_category(smpi_process()->get_tracing_category())
->start()
->wait();
smpi_switch_data_segment(simgrid::s4u::Actor::self());
/* FIXME: detached sends are not traceable (action_ == nullptr) */
if (action_ != nullptr) {
- std::string category = TRACE_internal_smpi_get_category();
+ std::string category = smpi_process()->get_tracing_category();
simgrid::simix::simcall([this, category] { this->action_->set_category(category); });
}