1 /* Copyright (c) 2017-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 SIMGRID_S4U_EXEC_HPP
7 #define SIMGRID_S4U_EXEC_HPP
9 #include <simgrid/forward.h>
10 #include <simgrid/s4u/Activity.hpp>
11 #include <simgrid/s4u/forward.hpp>
18 class XBT_PUBLIC Exec : public Activity {
19 Exec() : Activity() {}
21 friend XBT_PUBLIC void intrusive_ptr_release(simgrid::s4u::Exec * e);
22 friend XBT_PUBLIC void intrusive_ptr_add_ref(simgrid::s4u::Exec * e);
23 friend XBT_PUBLIC ExecPtr this_actor::exec_init(double flops_amount);
27 Activity* start() override;
28 Activity* wait() override;
29 Activity* wait(double timeout) override;
32 ExecPtr setPriority(double priority);
33 ExecPtr setBound(double bound);
34 ExecPtr setHost(Host * host);
35 Host* getHost() { return host_; }
37 double getRemains() override;
38 double getRemainingRatio();
41 Host* host_ = nullptr;
42 double flops_amount_ = 0.0;
43 double priority_ = 1.0;
45 std::atomic_int_fast32_t refcount_{0};
48 }; // Namespace simgrid::s4u
50 #endif /* SIMGRID_S4U_EXEC_HPP */