Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename get_tokens to get_next_execution_tokens
authorAdrien Gougeon <adrien.gougeon@ens-rennes.fr>
Wed, 14 Jun 2023 14:31:02 +0000 (16:31 +0200)
committerAdrien Gougeon <adrien.gougeon@ens-rennes.fr>
Wed, 14 Jun 2023 14:31:02 +0000 (16:31 +0200)
examples/cpp/task-storm/s4u-task-storm.cpp
include/simgrid/plugins/task.hpp
src/plugins/task.cpp

index 0319d17..2a0d1fd 100644 (file)
@@ -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);
   });
index a652cb6..67b5a68 100644 (file)
@@ -65,7 +65,7 @@ public:
   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();
index 4edfc3f..a2337dc 100644 (file)
@@ -151,7 +151,7 @@ void Task::set_token(std::shared_ptr<void> 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<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();
 }