void Actor::migrate(Host* new_host)
{
- simgrid::simix::kernelImmediate([this, new_host]() { pimpl_->new_host = new_host; });
+ simgrid::simix::kernelImmediate([this, new_host]() {
+ pimpl_->new_host = new_host;
+ });
}
s4u::Host* Actor::getHost()
return simgrid::simix::kernelImmediate([this]() { return pimpl_->restart(); });
}
-ExecPtr Actor::exec_init(double flops_amount)
-{
- ExecPtr res = ExecPtr(new Exec());
- res->host_ = this->getHost();
- res->flops_amount_ = flops_amount;
- res->setRemains(flops_amount);
- return res;
-}
-
-ExecPtr Actor::exec_async(double flops)
-{
- ExecPtr res = exec_init(flops);
- res->start();
- return res;
-}
-
// ***** this_actor *****
namespace this_actor {
simcall_execution_wait(s);
}
+ExecPtr exec_init(double flops_amount)
+{
+ ExecPtr res = ExecPtr(new Exec());
+ res->host_ = getHost();
+ res->flops_amount_ = flops_amount;
+ res->setRemains(flops_amount);
+ return res;
+}
+
+ExecPtr exec_async(double flops)
+{
+ ExecPtr res = exec_init(flops);
+ res->start();
+ return res;
+}
+
void* recv(MailboxPtr chan) // deprecated
{
return chan->get();
void migrate(Host* new_host)
{
- smx_actor_t process = SIMIX_process_self();
- simgrid::simix::kernelImmediate([process, new_host] { process->new_host = new_host; });
+ SIMIX_process_self()->iface()->migrate(new_host);
}
}
}