void intrusive_ptr_add_ref(Actor* actor)
{
- xbt_assert(actor != nullptr);
intrusive_ptr_add_ref(actor->pimpl_);
}
void intrusive_ptr_release(Actor* actor)
{
- xbt_assert(actor != nullptr);
intrusive_ptr_release(actor->pimpl_);
}
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->runner_ = SIMIX_process_self();
- 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 {
void execute(double flops)
{
- smx_activity_t s = simcall_execution_start(nullptr,flops,1.0/*priority*/,0./*bound*/);
+ smx_activity_t s = simcall_execution_start(nullptr, flops, 1.0 /*priority*/, 0. /*bound*/, getHost());
simcall_execution_wait(s);
}
void execute(double flops, double priority)
{
- smx_activity_t s = simcall_execution_start(nullptr,flops,1 / priority/*priority*/,0./*bound*/);
+ smx_activity_t s = simcall_execution_start(nullptr, flops, 1 / priority /*priority*/, 0. /*bound*/, getHost());
simcall_execution_wait(s);
}
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);
}
}
}