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 "surf/surf.hpp"
16 class XBT_PUBLIC ExecImpl : public ActivityImpl {
20 explicit ExecImpl(std::string name, std::string tracing_category, resource::Action* timeout_detector,
22 ExecImpl* start(double flops_amount, double priority, double bound);
25 double get_remaining();
26 double get_remaining_ratio();
27 void set_bound(double bound);
28 void set_priority(double priority);
29 virtual ActivityImpl* migrate(s4u::Host* to);
31 /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
32 s4u::Host* host_ = nullptr;
35 resource::Action* timeout_detector_ = nullptr;
38 static simgrid::xbt::signal<void(ExecImplPtr)> on_creation;
39 static simgrid::xbt::signal<void(ExecImplPtr)> on_completion;
40 static simgrid::xbt::signal<void(ExecImplPtr, simgrid::s4u::Host*)> on_migration;
44 } // namespace simgrid::kernel::activity