+public:
+ static Task* create(const std::string& name, double flops_amount, double bytes_amount, void* data);
+ static Task* create_parallel(const std::string& name, int host_nb, const msg_host_t* host_list, double* flops_amount,
+ double* bytes_amount, void* data);
+ msg_error_t execute();
+ msg_error_t send(const std::string& alias, double timeout);
+ s4u::CommPtr send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached);
+
+ void cancel();
+
+ Task(const Task&) = delete;
+ Task& operator=(const Task&) = delete;
+ ~Task() = default;
+
+ bool is_used() { return is_used_; }
+ bool is_parallel() { return parallel_; }
+
+ void set_used();
+ void set_not_used() { this->is_used_ = false; }
+ const std::string& get_name() const { return name_; }
+ const char* get_cname() { return name_.c_str(); }
+ void set_name(const char* new_name) { name_ = std::string(new_name); }
+ void set_tracing_category(const char* category) { tracing_category_ = category ? std::string(category) : ""; }
+ const std::string& get_tracing_category() { return tracing_category_; }
+ bool has_tracing_category() { return not tracing_category_.empty(); }
+ void* get_user_data() { return userdata_; }
+ void set_user_data(void* data) { userdata_ = data; }
+ long long int get_id() { return id_; }
+ double get_priority() { return priority_; }
+ void set_priority(double priority);
+ void set_bound(double bound) { bound_ = bound; }
+ double get_bound() { return bound_; }
+ void set_rate(double rate) { rate_ = rate; }
+ double get_rate() { return rate_; }
+ void set_timeout(double timeout) { timeout_ = timeout; }
+
+ s4u::Actor* get_sender();
+ s4u::Host* get_source();
+
+ s4u::ExecPtr compute = nullptr; /* S4U modeling of computation */
+ s4u::CommPtr comm = nullptr; /* S4U modeling of communication */
+ double flops_amount = 0.0; /* Computation size */
+ double bytes_amount = 0.0; /* Data size */
+
+ /******* Parallel Tasks Only !!!! *******/
+ bool parallel_ = false;
+ std::vector<s4u::Host*> hosts_;
+ std::vector<double> flops_parallel_amount;
+ std::vector<double> bytes_parallel_amount;
+};