From 8729da7ae2c4f5c7713c7d912c3e159227b2383b Mon Sep 17 00:00:00 2001 From: Adrien Gougeon Date: Wed, 14 Jun 2023 16:31:02 +0200 Subject: [PATCH] rename get_tokens to get_next_execution_tokens --- examples/cpp/task-storm/s4u-task-storm.cpp | 8 ++++---- include/simgrid/plugins/task.hpp | 2 +- src/plugins/task.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/cpp/task-storm/s4u-task-storm.cpp b/examples/cpp/task-storm/s4u-task-storm.cpp index 0319d17434..2a0d1fd3a3 100644 --- a/examples/cpp/task-storm/s4u-task-storm.cpp +++ b/examples/cpp/task-storm/s4u-task-storm.cpp @@ -101,22 +101,22 @@ int main(int argc, char* argv[]) // 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); }); diff --git a/include/simgrid/plugins/task.hpp b/include/simgrid/plugins/task.hpp index a652cb65d7..67b5a68b23 100644 --- a/include/simgrid/plugins/task.hpp +++ b/include/simgrid/plugins/task.hpp @@ -65,7 +65,7 @@ public: void set_amount(double amount); double get_amount() const { return amount_; } void set_token(std::shared_ptr token); - std::map> get_tokens() const; + std::map> get_next_execution_tokens() const; void add_successor(TaskPtr t); void remove_successor(TaskPtr t); void remove_all_successors(); diff --git a/src/plugins/task.cpp b/src/plugins/task.cpp index 4edfc3fb1a..a2337dc343 100644 --- a/src/plugins/task.cpp +++ b/src/plugins/task.cpp @@ -151,7 +151,7 @@ void Task::set_token(std::shared_ptr token) * @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> Task::get_tokens() const +std::map> Task::get_next_execution_tokens() const { return tokens_received_.front(); } -- 2.20.1