1 /* Copyright (c) 2007-2018. 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(const char* name, sg_host_t host);
21 void suspend() override;
22 void resume() override;
24 double get_remaining();
25 double get_remaining_ratio();
26 void set_bound(double bound);
27 virtual ActivityImpl* migrate(s4u::Host* to);
29 /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
30 s4u::Host* host_ = nullptr;
31 resource::Action* surfAction_ = nullptr; /* The Surf execution action encapsulated */
32 resource::Action* timeoutDetector = nullptr;
33 static simgrid::xbt::signal<void(kernel::activity::ExecImplPtr)> onCreation;
34 static simgrid::xbt::signal<void(kernel::activity::ExecImplPtr)> onCompletion;
35 static simgrid::xbt::signal<void(simgrid::kernel::activity::ExecImplPtr, simgrid::s4u::Host*)> onMigration;
40 } // namespace simgrid::kernel::activity