// ***** Actor creation *****
ActorPtr Actor::self()
{
- smx_context_t self_context = SIMIX_context_self();
+ smx_context_t self_context = simgrid::kernel::context::Context::self();
if (self_context == nullptr)
return simgrid::s4u::ActorPtr();
ActorPtr Actor::create(std::string name, s4u::Host* host, std::string function, std::vector<std::string> args)
{
simgrid::simix::ActorCodeFactory& factory = SIMIX_get_actor_code_factory(function);
- simgrid::simix::ActorCode code = factory(std::move(args));
- simgrid::kernel::actor::ActorImpl* actor = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
- return actor->iface();
+ return create(name, host, factory(std::move(args)));
}
void intrusive_ptr_add_ref(Actor* actor)
simcall_execution_wait(s);
}
+// deprecated
void parallel_execute(int host_nb, s4u::Host** host_list, double* flops_amount, double* bytes_amount, double timeout)
{
smx_activity_t s =
delete[] bytes_amount;
}
+// deprecated
void parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount)
{
- parallel_execute(host_nb, host_list, flops_amount, bytes_amount, /* timeout */ -1);
+ smx_activity_t s = simcall_execution_parallel_start("", host_nb, host_list, flops_amount, bytes_amount,
+ /* rate */ -1, /*timeout*/ -1);
+ simcall_execution_wait(s);
+ delete[] flops_amount;
+ delete[] bytes_amount;
}
ExecPtr exec_init(double flops_amount)
simgrid::s4u::Actor::on_resume(process->iface());
}
-bool is_suspended()
-{
- smx_actor_t process = SIMIX_process_self();
- return simgrid::simix::simcall([process] { return process->suspended_; });
-}
-
void exit()
{
smx_actor_t process = SIMIX_process_self();
{
return get_host();
}
-bool isSuspended() /* deprecated */
-{
- return is_suspended();
-}
void on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
{
SIMIX_process_self()->iface()->on_exit([fun](int a, void* b) { fun((void*)(intptr_t)a, b); }, data);