#include "src/simix/smx_private.hpp"
#include <algorithm>
#include <cmath>
+#include <simgrid/modelchecker.h>
+#include <simgrid/s4u/Comm.hpp>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
-void s_simdata_task_t::reportMultipleUse() const
+void s_simdata_task_t::report_multiple_use() const
{
if (msg_global->debug_multiple_use){
XBT_ERROR("This task is already used in there:");
*/
msg_task_t MSG_task_create(const char *name, double flop_amount, double message_size, void *data)
{
+ static std::atomic_ullong counter{0};
+
msg_task_t task = new s_msg_task_t;
simdata_task_t simdata = new s_simdata_task_t();
task->simdata = simdata;
simdata->bytes_amount = message_size;
simdata->flops_amount = flop_amount;
- TRACE_msg_task_create(task);
+ task->counter = counter++;
+ task->category = nullptr;
+
+ if (MC_is_active())
+ MC_ignore_heap(&(task->counter), sizeof(task->counter));
return task;
}
*/
msg_error_t MSG_task_destroy(msg_task_t task)
{
- if (task->simdata->isused) {
+ if (task->simdata->is_used) {
/* the task is being sent or executed: cancel it first */
MSG_task_cancel(task);
}
- TRACE_msg_task_destroy(task);
+ xbt_free(task->category);
xbt_free(task->name);
/* free main structures */
if (simdata->compute) {
simgrid::simix::simcall([simdata] { simdata->compute->cancel(); });
} else if (simdata->comm) {
- simgrid::simix::simcall([simdata] { simdata->comm->cancel(); });
+ simdata->comm->cancel();
}
- simdata->setNotUsed();
+ simdata->set_not_used();
return MSG_OK;
}
double MSG_task_get_remaining_communication(msg_task_t task)
{
XBT_DEBUG("calling simcall_communication_get_remains(%p)", task->simdata->comm.get());
- return task->simdata->comm->remains();
+ return task->simdata->comm->get_remaining();
}
/** @brief Returns the size of the data attached to the given task. */