From a35bdf17b67c7101bccf155cb60c2d368ed0e78a Mon Sep 17 00:00:00 2001
From: Olivier BICHLER <olivier.bichler@cea.fr>
Date: Mon, 25 Sep 2023 17:49:22 +0200
Subject: [PATCH] If forward() calls generateScheduling(), then mStaticSchedule
 should be cleared

---
 src/scheduler/Scheduler.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/scheduler/Scheduler.cpp b/src/scheduler/Scheduler.cpp
index dc0768d2b..bf46f161c 100644
--- a/src/scheduler/Scheduler.cpp
+++ b/src/scheduler/Scheduler.cpp
@@ -107,6 +107,7 @@ void Aidge::SequentialScheduler::generateScheduling(bool verbose) {
 
         // Push consumers in the list of nodes to run and update the consumer producer system
         for (const auto& runnable : runnableConsumers) {
+            if (verbose) printf("Runnable: %s\n", (runnable->type() + "_" + std::to_string(reinterpret_cast<uintptr_t>(runnable.get()))).c_str());
             runnable->getOperator()->updateConsummerProducer();
             mStaticSchedule.push_back(runnable);
         }
@@ -178,6 +179,7 @@ void Aidge::SequentialScheduler::forward(bool forwardDims, bool verbose) {
     std::set<std::shared_ptr<Node>> computationOver;
 
     mScheduling.clear();
+    mStaticSchedule.clear();
 
     this->generateScheduling();
 
-- 
GitLab