1 /* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMIX_SYNCHRO_EXEC_HPP
7 #define SIMIX_SYNCHRO_EXEC_HPP
9 #include "src/kernel/activity/ActivityImpl.hpp"
10 #include "src/kernel/context/Context.hpp"
11 #include "surf/surf.hpp"
17 class XBT_PUBLIC ExecImpl : public ActivityImpl {
21 explicit ExecImpl(std::string name, std::string tracing_category, s4u::Host* host);
22 explicit ExecImpl(std::string name, std::string tracing_category, s4u::Host* host, double timeout);
23 ExecImpl* start(double flops_amount, double priority, double bound);
26 void finish() override;
27 double get_remaining();
28 double get_remaining_ratio();
29 void set_bound(double bound); // deprecated. To be removed in v3.25
30 void set_priority(double priority); // deprecated. To be removed in v3.25
31 virtual ActivityImpl* migrate(s4u::Host* to);
33 /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
34 s4u::Host* host_ = nullptr;
37 resource::Action* timeout_detector_ = nullptr;
40 static simgrid::xbt::signal<void(ExecImplPtr)> on_creation;
41 static simgrid::xbt::signal<void(ExecImplPtr)> on_completion;
42 static simgrid::xbt::signal<void(ExecImplPtr, simgrid::s4u::Host*)> on_migration;
46 } // namespace simgrid::kernel::activity