- void set_amount(double amount);
- double get_amount() const { return amount_; }
- int get_count() const { return count_; }
- void set_parallelism_degree(int n);
- int get_parallelism_degree() const { return parallelism_degree_; }
-
+ /** @param amount The new amount of work this instance of this Task has to do
+ * @note In flops for ExecTasks instances and in bytes for CommTasks instances. In flops for dispatcher and collector
+ * instances */
+ void set_amount(double amount, std::string instance = "instance_0");
+ /** @return Amout of work this instance of this Task has to process */
+ double get_amount(std::string instance = "instance_0") const { return amount_.at(instance); }
+ /** @return Amount of queued firings for this instance of this Task */
+ int get_queued_firings(std::string instance = "instance_0") const { return queued_firings_.at(instance); }
+ /** @return Amount currently running of this instance of this Task */
+ int get_running_count(std::string instance = "instance_0") const { return running_instances_.at(instance); }
+ /** @return Number of times this instance of this Task has been completed */
+ int get_count(std::string instance = "collector") const { return count_.at(instance); }
+ /** @param n The parallelism degree to set
+ * @brief The parallelism degree defines how many of this instance can run in parallel. */
+ void set_parallelism_degree(int n, std::string instance = "all");
+ /** @return Parallelism degree of this instance of this Task */
+ int get_parallelism_degree(std::string instance = "instance_0") const { return parallelism_degree_.at(instance); }
+ /** @param bytes The amount of bytes this instance has to send to the next instance of this Task
+ * @note This amount is used when the host is different between the dispatcher and the instance doing the work of the
+ * Task, or between the instance and the collector. */
+ void set_internal_bytes(int bytes, std::string instance = "instance_0");
+ /** @return Amount of bytes this instance of the Task has to send to the next instance */
+ double get_internal_bytes(std::string instance = "instance_0") const { return internal_bytes_to_send_.at(instance); }
+ /** @param func The new balancing function
+ * @note This function is used by the dispatcher to determine which instance will effectively do the work. This
+ * function must return the name of the instance as a string. The default balancing function always returns
+ * "instance_0" */
+ void set_load_balancing_function(std::function<std::string()> func);
+ /** @param token The new token */