MC_ignore_heap(&(id_), sizeof(id_));
}
-Task::Task(std::string name, std::vector<s4u::Host*> hosts, std::vector<double> flops_amount,
- std::vector<double> bytes_amount, void* data)
+Task::Task(std::string name, std::vector<s4u::Host*>&& hosts, std::vector<double>&& flops_amount,
+ std::vector<double>&& bytes_amount, void* data)
: Task(std::move(name), 1.0, 0, data)
{
parallel_ = true;
this->comm = nullptr;
msg_global->sent_msg++;
- s4u::CommPtr comm = s4u::Mailbox::by_name(alias)->put_init(this, bytes_amount)->set_rate(get_rate());
- this->comm = comm;
+ s4u::CommPtr s4u_comm = s4u::Mailbox::by_name(alias)->put_init(this, bytes_amount)->set_rate(get_rate());
+ comm = s4u_comm;
if (detached)
comm->detach(cleanup);
comm->start();
if (TRACE_is_enabled() && has_tracing_category())
- simgrid::simix::simcall([comm, this] { comm->get_impl()->set_category(std::move(tracing_category_)); });
+ simgrid::simix::simcall([this] { comm->get_impl()->set_category(std::move(tracing_category_)); });
return comm;
}
msg_error_t ret = MSG_OK;
/* Try to send it */
try {
+ comm = nullptr; // needed, otherwise MC gets confused.
s4u::CommPtr s4u_comm = send_async(alias, nullptr, false);
comm = s4u_comm;
comm->wait_for(timeout);