-/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
xbt::signal<void(Actor const&)> s4u::Actor::on_resume;
xbt::signal<void(Actor const&)> s4u::Actor::on_sleep;
xbt::signal<void(Actor const&)> s4u::Actor::on_wake_up;
+#ifndef DOXYGEN
xbt::signal<void(Actor const&)> s4u::Actor::on_migration_start; // XBT_ATTRIB_DEPRECATED_v329
xbt::signal<void(Actor const&)> s4u::Actor::on_migration_end; // XBT_ATTRIB_DEPRECATED_v329
+#endif
xbt::signal<void(Actor const&, Host const& previous_location)> s4u::Actor::on_host_change;
xbt::signal<void(Actor const&)> s4u::Actor::on_termination;
xbt::signal<void(Actor const&)> s4u::Actor::on_destruction;
ActorPtr Actor::by_pid(aid_t pid)
{
- kernel::actor::ActorImpl* actor = SIMIX_process_from_PID(pid);
+ kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(pid);
if (actor != nullptr)
return actor->get_iface();
else
void execute(double flops, double priority)
{
- exec_init(flops)->set_priority(priority)->start()->wait();
+ exec_init(flops)->set_priority(priority)->vetoable_start()->wait();
}
void parallel_execute(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
ExecPtr exec_init(double flops_amount)
{
- ExecPtr exec(new Exec());
- exec->set_flops_amount(flops_amount)->set_host(get_host());
- return exec;
+ return Exec::init()->set_flops_amount(flops_amount)->set_host(get_host());
}
ExecPtr exec_init(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
xbt_assert(std::all_of(bytes_amounts.begin(), bytes_amounts.end(), [](double elm) { return std::isfinite(elm); }),
"flops_amounts comprises infinite values!");
- ExecPtr exec(new Exec());
- exec->set_flops_amounts(flops_amounts)->set_bytes_amounts(bytes_amounts)->set_hosts(hosts);
- return exec;
+ return Exec::init()->set_flops_amounts(flops_amounts)->set_bytes_amounts(bytes_amounts)->set_hosts(hosts);
}
ExecPtr exec_async(double flops)
{
ExecPtr res = exec_init(flops);
- res->start();
+ res->vetoable_start();
return res;
}
if (bytes_amount != nullptr)
bytes = std::vector<double>(bytes_amount, bytes_amount + host_nb * host_nb);
- simgrid::s4u::ExecPtr exec(new simgrid::s4u::Exec());
- exec->set_flops_amounts(flops)->set_bytes_amounts(bytes)->set_hosts(hosts);
+ simgrid::s4u::ExecPtr exec = simgrid::s4u::this_actor::exec_init(hosts, flops, bytes);
exec->add_ref();
return exec.get();
}