Scheduler-test: --- instrumentation ---

This partially reverts commit 72f11549e6.
"Chain-Load: Scheduler instrumentation for observation"

Hint: revert this changeset to re-introduce the print statements for diagnostic
This commit is contained in:
Fischlurch 2023-12-11 23:55:55 +01:00
parent da57e3dfcd
commit 69faaef8cd
2 changed files with 1 additions and 43 deletions

View file

@ -115,7 +115,6 @@
//#include "lib/symbol.hpp"
#include "lib/nocopy.hpp"
//#include "lib/util.hpp"
#include "lib/format-cout.hpp"///////////////////////TODO
//#include <string>
#include <optional>
@ -586,26 +585,6 @@ namespace gear {
return move(*this);
}
namespace{
inline string
relT (int64_t pling)
{
static int64_t nulli{0};
if (nulli == 0) nulli = pling;
return util::toString(pling - nulli);
}
inline string
relT (Time plong)
{
return relT(_raw(plong));
}
inline string
markThread()
{
return util::showHashLSB (std::hash<std::thread::id>{}(thisThread()));
}
}
/**
* Enqueue for time-bound execution, possibly dispatch immediately.
@ -617,7 +596,6 @@ namespace{
Scheduler::postChain (ActivationEvent actEvent)
{
maybeScaleWorkForce (actEvent.startTime());
cout<<"‖SCH‖ "+markThread()+": @"+relT(RealClock::now())+" ○ start="+relT(actEvent.starting)+" dead:"+util::toString(actEvent.deadline - actEvent.starting)<<endl;
ExecutionCtx ctx{*this, actEvent};
layer2_.postDispatch (actEvent, ctx, layer1_);
}
@ -656,7 +634,6 @@ cout<<"‖SCH‖ "+markThread()+": @"+relT(RealClock::now())+" ○ start="+relT(
.performStep([&]{
Time now = getSchedTime();
auto toDispatch = layer2_.findWork (layer1_,now);
cout<<" ·‖ "+markThread()+": @ "+relT(now)+" HT:"+relT(layer1_.headTime())+" -> "+(toDispatch? ""+relT(toDispatch.starting): string(""))<<endl;
ExecutionCtx ctx{*this, toDispatch};
return layer2_.postDispatch (toDispatch, ctx, layer1_);
})
@ -753,7 +730,6 @@ cout<<" ·‖ "+markThread()+": @ "+relT(now)+" HT:"+relT(layer1_.headTime())+
inline void
Scheduler::handleDutyCycle (Time now, bool forceContinuation)
{
cout<<"‖▷▷▷‖ "+markThread()+": @ "+relT(now)+(empty()? string(" EMPTY"): " HT:"+relT(layer1_.headTime()))<<endl;
// consolidate queue content
layer1_.feedPrioritisation();
// clean-up of outdated tasks here
@ -793,8 +769,6 @@ cout<<"‖▷▷▷‖ "+markThread()+": @ "+relT(now)+(empty()? string(" EMPTY"
triggerEmergency();
else
loadControl_.markWorkerExit();
Time now = getSchedTime();
cout<<"‖▽▼▽‖ "+markThread()+": @ "+relT(now)<<endl;
}
/**
@ -809,15 +783,9 @@ cout<<"‖▽▼▽‖ "+markThread()+": @ "+relT(now)<<endl;
Scheduler::maybeScaleWorkForce (Time startHorizon)
{
if (empty())
{
ignite();
cout<<"‖IGN‖ wof:"+util::toString(workForce_.size())<<endl;
}
else
{
loadControl_.ensureCapacity (startHorizon);
cout<<"‖•△•‖ wof:"+util::toString(workForce_.size())+" HT:"+relT(layer1_.headTime())<<endl;
}
}
/**

View file

@ -1439,7 +1439,6 @@ namespace test {
Node& target = startNode_[nodeIdx];
ASSERT (target.level == level);
// invoke the »media calculation«
cout<<_Fmt{"\n!◆! %s: calc(i=%d, lev:%d)"} % markThread() % nodeIdx % level <<endl;
if (compuLoad_ and target.weight)
compuLoad_->invoke (target.weight);
target.calculate();
@ -1495,11 +1494,9 @@ cout<<_Fmt{"\n!◆! %s: calc(i=%d, lev:%d)"} % markThread() % nodeIdx % level <<
{
size_t reachedLevel{0};
size_t targetNodeIDX = decodeNodeID (param.invoKey);
cout<<_Fmt{"\n!◆!plan...to:%d%19t|curr=%d (max:%d)"} % targetNodeIDX % currIdx_ % maxCnt_<<endl;
for ( ; currIdx_<maxCnt_; ++currIdx_)
{
Node* n = &nodes_[currIdx_];
cout<<_Fmt{"%16t|n.(%d,lev:%d)"} % currIdx_ % n->level <<endl;
if (currIdx_ <= targetNodeIDX)
reachedLevel = n->level;
else // continue until end of current level
@ -1565,7 +1562,6 @@ cout<<_Fmt{"%16t|n.(%d,lev:%d)"} % currIdx_ % n->level <<endl;
void
disposeStep (size_t idx, size_t level)
{
cout <<_Fmt{"... dispose(i=%d,lev:%d) -> @%s"} % idx % level % relT(calcStartTime(level))<<endl;
schedule_[idx] = scheduler_.defineSchedule(calcJob (idx,level))
.manifestation(manID_)
.startTime (calcStartTime(level))
@ -1586,11 +1582,9 @@ cout <<_Fmt{"... dispose(i=%d,lev:%d) -> @%s"} % idx % level % relT(calcStartTim
void
continuation (size_t lastNodeIDX, size_t levelDone, bool work_left)
{
cout <<_Fmt{"+++ %s: Continuation(lastNode=%d, levelDone=%d, work_left:%s)"} % markThread() % lastNodeIDX % levelDone % work_left <<endl;
if (work_left)
{
size_t nextChunkEndNode = calcNextChunkEnd (lastNodeIDX);
cout <<"--> reschedule to ..."<<nextChunkEndNode<<endl;
scheduler_.continueMetaJob (calcPlanScheduleTime (nextChunkEndNode)
,planningJob (nextChunkEndNode)
,manID_);
@ -1607,7 +1601,6 @@ cout <<"--> reschedule to ..."<<nextChunkEndNode<<endl;
auto finished = attachNewCompletionSignal();
size_t numNodes = chainLoad_.size();
size_t firstChunkEndNode = calcNextChunkEnd(0)-1;
cout <<"+++ "<<markThread()<<": seed(num:"<<numNodes<<")"<<endl;
schedule_.allocate (numNodes);
compuLoad_->maybeCalibrate();
startTime_ = anchorStartTime();
@ -1756,10 +1749,7 @@ cout <<"+++ "<<markThread()<<": seed(num:"<<numNodes<<")"<<endl;
Time
anchorStartTime()
{
Time ank = RealClock::now() + _uTicks(preRoll_);
cout<<"ANCHOR="+relT(ank)+" preRoll="+util::toString(_raw(_uTicks(preRoll_)))<<endl;
// return RealClock::now() + _uTicks(preRoll_);
return ank;
return RealClock::now() + _uTicks(preRoll_);
}
static microseconds