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>
17 class XBT_PUBLIC Exec : public Activity {
18 Exec() : Activity() {}
20 friend XBT_PUBLIC void intrusive_ptr_release(simgrid::s4u::Exec * e);
21 friend XBT_PUBLIC void intrusive_ptr_add_ref(simgrid::s4u::Exec * e);
22 friend XBT_PUBLIC ExecPtr this_actor::exec_init(double flops_amount);
26 Activity* start() override;
27 Activity* wait() override;
28 Activity* wait(double timeout) override;
29 Activity* cancel() override;
32 ExecPtr set_priority(double priority);
33 ExecPtr set_bound(double bound);
34 ExecPtr set_host(Host* host);
35 ExecPtr set_name(std::string name);
36 ExecPtr set_tracing_category(std::string category);
39 double get_remaining() override;
40 double get_remaining_ratio();
42 //////////////// Deprecated functions
43 /** @deprecated See Exec::set_priority() */
44 XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_priority()") ExecPtr setPriority(double priority)
46 return set_priority(priority);
48 /** @deprecated See Exec::set_bound() */
49 XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_bound()") ExecPtr setBound(double bound) { return set_bound(bound); }
50 /** @deprecated See Exec::set_host() */
51 XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_host()") ExecPtr setHost(Host* host) { return set_host(host); }
52 /** @deprecated See Exec::get_host() */
53 XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_host()") Host* getHost() { return get_host(); }
54 /** @deprecated See Exec::get_remaining_ratio() */
55 XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_remaining_ratio()") double getRemainingRatio()
57 return get_remaining_ratio();
61 Host* host_ = nullptr;
62 double flops_amount_ = 0.0;
63 double priority_ = 1.0;
65 std::string name_ = "";
66 std::string tracing_category_ = "";
67 std::atomic_int_fast32_t refcount_{0};
70 }; // Namespace simgrid::s4u
72 #endif /* SIMGRID_S4U_EXEC_HPP */