/* MSG_task_put related functions */
void TRACE_msg_task_put_start(msg_task_t task)
{
- XBT_DEBUG("PUT,in %p, %lld, %s", task, task->get_counter(), task->get_tracing_category().c_str());
+ XBT_DEBUG("PUT,in %p, %lld, %s", task, task->get_id(), task->get_tracing_category().c_str());
if (TRACE_actor_is_enabled()) {
container_t process_container = simgrid::instr::Container::by_name(instr_pid(MSG_process_self()));
- std::string key = std::string("p") + std::to_string(task->get_counter());
+ std::string key = std::string("p") + std::to_string(task->get_id());
simgrid::instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->start_event(process_container, "SR", key);
}
}
if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
container_t process_container = simgrid::instr::Container::by_name(instr_pid(MSG_process_self()));
- std::string key = std::string("p") + std::to_string((*task)->get_counter());
+ std::string key = std::string("p") + std::to_string((*task)->get_id());
simgrid::instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->end_event(process_container, "SR", key);
}
return ret;
#include "src/kernel/activity/ExecImpl.hpp"
#include <simgrid/modelchecker.h>
-static long long int msg_task_max_counter = 0;
-
/**************** datatypes **********************************/
namespace simgrid {
namespace msg {
std::string name_ = "";
std::string tracing_category_ = "";
void* userdata_ = nullptr;
- long long int counter_;
+ long long int id_;
public:
~Task();
explicit Task(std::string name, double flops_amount, double bytes_amount, void* data)
: name_(std::move(name)), userdata_(data), flops_amount(flops_amount), bytes_amount(bytes_amount)
{
- counter_ = msg_task_max_counter++;
+ static std::atomic_ullong counter{0};
+ id_ = counter++;
if (MC_is_active())
- MC_ignore_heap(&(counter_), sizeof(long long int));
+ MC_ignore_heap(&(id_), sizeof(id_));
}
void set_used();
void set_not_used() { this->is_used = false; }
bool has_tracing_category() { return not tracing_category_.empty(); }
void* get_user_data() { return userdata_; }
void set_user_data(void* data) { userdata_ = data; }
- long long int get_counter() { return counter_; }
+ long long int get_id() { return id_; }
kernel::activity::ExecImplPtr compute = nullptr; /* SIMIX modeling of computation */
s4u::CommPtr comm = nullptr; /* S4U modeling of communication */
/* Simulator Data specific to parallel tasks */
task->host_nb = host_nb;
- host_list = new sg_host_t[host_nb];
+ task->host_list = new sg_host_t[host_nb];
std::copy_n(host_list, host_nb, task->host_list);
if (flops_amount != nullptr) {
task->flops_parallel_amount = new double[host_nb];