// The token sent by SA is forwarded by both communication tasks
SA_to_B1->on_this_start_cb([&](simgrid::plugins::Task* t) {
- t->set_token(t->get_tokens()[SA]);
+ t->set_token(t->get_next_execution_tokens()[SA]);
});
SA_to_B2->on_this_start_cb([&](simgrid::plugins::Task* t) {
- t->set_token(t->get_tokens()[SA]);
+ t->set_token(t->get_next_execution_tokens()[SA]);
});
/* B1 and B2 read the value of the token received by their predecessors
and use it to adapt their amount of work to do.
*/
B1->on_this_start_cb([&](simgrid::plugins::Task* t) {
- auto tokens_map = t->get_tokens();
+ auto tokens_map = t->get_next_execution_tokens();
Token* tok = (Token*)(tokens_map[SA_to_B1].get());
t->set_amount(tok->data_ * 10);
});
B2->on_this_start_cb([&](simgrid::plugins::Task* t) {
- auto tokens_map = t->get_tokens();
+ auto tokens_map = t->get_next_execution_tokens();
Token* tok = (Token*)(tokens_map[SA_to_B2].get());
t->set_amount(tok->data_ * 10);
});
void set_amount(double amount);
double get_amount() const { return amount_; }
void set_token(std::shared_ptr<void> token);
- std::map<TaskPtr, std::shared_ptr<void>> get_tokens() const;
+ std::map<TaskPtr, std::shared_ptr<void>> get_next_execution_tokens() const;
void add_successor(TaskPtr t);
void remove_successor(TaskPtr t);
void remove_all_successors();
* @return Map of tokens received for the next execution.
* @note If there is no queued execution for this task the map might not exist or be partially empty.
*/
-std::map<TaskPtr, std::shared_ptr<void>> Task::get_tokens() const
+std::map<TaskPtr, std::shared_ptr<void>> Task::get_next_execution_tokens() const
{
return tokens_received_.front();
}