diff --git a/src/vault/gear/scheduler.hpp b/src/vault/gear/scheduler.hpp index 87d24727a..42a32aac4 100644 --- a/src/vault/gear/scheduler.hpp +++ b/src/vault/gear/scheduler.hpp @@ -723,7 +723,7 @@ cout<<" ·‖ "+markThread()+": @ "+relT(now)+" HT:"+relT(layer1_.headTime())+ return activity::WAIT; // prompts to switch this thread into sleep mode case LoadController::TENDNEXT: doTendNextHead(); - doTargetedSleep(); // let this thread wait until nest head time is due + doTargetedSleep(); // let this thread wait until next head time is due return activity::SKIP; default: doTargetedSleep(); diff --git a/tests/vault/gear/test-chain-load-test.cpp b/tests/vault/gear/test-chain-load-test.cpp index 82fb6d01f..f2e667d1a 100644 --- a/tests/vault/gear/test-chain-load-test.cpp +++ b/tests/vault/gear/test-chain-load-test.cpp @@ -1018,6 +1018,7 @@ SHOW_EXPR(testLoad.getHash()) // Let the callbacks create a clone — which at the end should generate the same hash array clone; size_t lastTouched(-1); + size_t lastNode (-1); size_t lastLevel(-1); bool shallContinue{false}; auto getNodeIdx = [&](Node* n) { return n - &nodes[0]; }; @@ -1038,8 +1039,9 @@ SHOW_EXPR(testLoad.getHash()) // replicate this relation into the clone array clone[predIdx].addSucc(clone[succIdx]); }; - auto continuation = [&](size_t levelDone, bool work_left) + auto continuation = [&](size_t nodeDone, size_t levelDone, bool work_left) { + lastNode =nodeDone; lastLevel = levelDone; shallContinue = work_left; }; @@ -1049,15 +1051,16 @@ SHOW_EXPR(testLoad.getHash()) ,setDependency ,continuation}; Job jobP1{planJob - ,InvocationInstanceID() - ,planJob.encodeLevel(1)}; + ,planJob.encodeNodeID(1) + ,Time::ANYTIME}; Job jobP2{planJob - ,InvocationInstanceID() - ,planJob.encodeLevel(3)}; + ,planJob.encodeNodeID(5) + ,Time::ANYTIME}; jobP1.triggerJob(); - CHECK (lastTouched = 2); CHECK (lastLevel = 1); + CHECK (lastTouched = 2); + CHECK (lastTouched == lastNode); Node* lastN = &clone[lastTouched]; CHECK (lastN->level == lastLevel); CHECK ( isnil (lastN->succ)); @@ -1065,8 +1068,9 @@ SHOW_EXPR(testLoad.getHash()) CHECK (shallContinue); jobP2.triggerJob(); - CHECK (lastTouched = 3); CHECK (lastLevel = 3); + CHECK (lastTouched = 3); + CHECK (lastTouched == lastNode); lastN = &clone[lastTouched]; CHECK (lastN->level == 2); CHECK (lastN->level < lastLevel); diff --git a/tests/vault/gear/test-chain-load.hpp b/tests/vault/gear/test-chain-load.hpp index ddeb939b6..9076d8cca 100644 --- a/tests/vault/gear/test-chain-load.hpp +++ b/tests/vault/gear/test-chain-load.hpp @@ -1159,9 +1159,9 @@ cout<<_Fmt{"\n!◆! %s: calc(i=%d, lev:%d)"} % markThread() % nodeIdx % level << { using Node = typename TestChainLoad::Node; - function scheduleCalcJob_; - function markDependency_; - function continuation_; + function scheduleCalcJob_; + function markDependency_; + function continuation_; size_t maxCnt_; Node* nodes_; @@ -1188,19 +1188,24 @@ cout<<_Fmt{"\n!◆! %s: calc(i=%d, lev:%d)"} % markThread() % nodeIdx % level << void invokeJobOperation (JobParameter param) override { - size_t targetLevel = decodeLevel (TimeValue{param.nominalTime}); -cout<<_Fmt{"\n!◆!plan...to:%d%19t|curr=%d (max:%d)"} % targetLevel % currIdx_ % maxCnt_<level <level > targetLevel) - break; + if (currIdx_ <= targetNodeIDX) + reachedLevel = n->level; + else // continue until end of current level + if (n->level > reachedLevel) + break; scheduleCalcJob_(currIdx_, n->level); for (Node* pred: n->pred) markDependency_(pred,n); } - continuation_(targetLevel, currIdx_ < maxCnt_); + ENSURE (currIdx_ > 0); + continuation_(currIdx_-1, reachedLevel, currIdx_ < maxCnt_); } @@ -1273,15 +1278,15 @@ cout <<_Fmt{"... dispose(i=%d,lev:%d) -> @%s"} % idx % level % relT(calcStartTim /** continue planning: schedule follow-up planning job */ void - continuation (size_t levelDone, bool work_left) + continuation (size_t lastNodeIDX, size_t levelDone, bool work_left) { -cout <<_Fmt{"+++ %s: Continuation(levelDone=%d, work_left:%s)"} % markThread() % levelDone % work_left < reschedule to "< reschedule to ..."< reschedule to "<{chainLoad_.nodes_[0], chainLoad_.numNodes_ ,[this](size_t i, size_t l){ disposeStep(i,l); } ,[this](auto* p, auto* s) { setDependency(p,s);} - ,[this](size_t l, bool w) { continuation(l,w); } + ,[this](size_t n,size_t l, bool w){ continuation(n,l,w); } }} { } @@ -1352,11 +1358,11 @@ cout <<"+++ "<encodeLevel(level) + , planFunctor_->encodeNodeID(endNodeIDX) + , Time::ANYTIME }; } @@ -1389,9 +1395,9 @@ cout<<"ANCHOR="+relT(ank)+" preRoll="+util::toString(_raw(preRoll_))< - - - + + + + + + + + + +

+ targetNode : bis einschießlich diese Node-ID soll mindestens behandelt werden +

+ + +
+
+ + + + + + + + + + + + + + + @@ -101308,9 +101336,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + @@ -101368,9 +101396,13 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- + - + + + + +
@@ -101425,9 +101457,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200
- - - + + +