Scheduler-test: verify adapted schedule with stress-factor
- schedule can now be adapted to concurrency and expected distribution of runtimes - additional stress factor to press the schedule (1.0 is nominal speed) - observed run-time now without Scheduler start-up and pre-roll - document and verify computed numbers
This commit is contained in:
parent
813f8721f7
commit
bb2bbc0e02
3 changed files with 118 additions and 50 deletions
|
|
@ -149,8 +149,8 @@ namespace test {
|
|||
TestChainLoad testLoad{64};
|
||||
testLoad.configureShape_chain_loadBursts()
|
||||
.buildToplolgy()
|
||||
.printTopologyDOT()
|
||||
.printTopologyStatistics()
|
||||
// .printTopologyDOT()
|
||||
// .printTopologyStatistics()
|
||||
;
|
||||
|
||||
auto LOAD_BASE = 500us;
|
||||
|
|
@ -166,9 +166,9 @@ SHOW_EXPR(micros);
|
|||
// build a schedule sequence based on
|
||||
// summing up weight factors, with example concurrency ≔ 4
|
||||
uint concurrency = 4;
|
||||
auto stepsFactors = testLoad.levelScheduleSequence(concurrency).effuse();
|
||||
CHECK (stepsFactors.size() == 1+testLoad.topLevel());
|
||||
CHECK (stepsFactors.size() == 27);
|
||||
auto stepFactors = testLoad.levelScheduleSequence(concurrency).effuse();
|
||||
CHECK (stepFactors.size() == 1+testLoad.topLevel());
|
||||
CHECK (stepFactors.size() == 27);
|
||||
|
||||
|
||||
// Build-Performance-test-setup--------
|
||||
|
|
@ -179,48 +179,98 @@ SHOW_EXPR(micros);
|
|||
auto testSetup =
|
||||
testLoad.setupSchedule(scheduler)
|
||||
.withLoadTimeBase(LOAD_BASE)
|
||||
.withJobDeadline(20ms)
|
||||
.withJobDeadline(50ms)
|
||||
.withUpfrontPlanning();
|
||||
|
||||
auto schedule = testSetup.getScheduleSeq().effuse();
|
||||
CHECK (schedule.size() == testLoad.topLevel() + 2);
|
||||
CHECK (schedule[ 0] == _uTicks(0ms));
|
||||
CHECK (schedule[ 1] == _uTicks(1ms));
|
||||
CHECK (schedule[ 2] == _uTicks(2ms));
|
||||
// ....
|
||||
CHECK (schedule[25] == _uTicks(25ms));
|
||||
CHECK (schedule[26] == _uTicks(26ms));
|
||||
CHECK (schedule[27] == _uTicks(27ms));
|
||||
|
||||
// Adapted Schedule----------
|
||||
double stressFac = 1.0;
|
||||
testSetup.withAdaptedSchedule (stressFac, concurrency);
|
||||
schedule = testSetup.getScheduleSeq().effuse();
|
||||
CHECK (schedule.size() == testLoad.topLevel() + 2);
|
||||
SHOW_EXPR(schedule[0])
|
||||
SHOW_EXPR(schedule[1])
|
||||
SHOW_EXPR(schedule[2])
|
||||
SHOW_EXPR(schedule[3])
|
||||
SHOW_EXPR(schedule[4])
|
||||
SHOW_EXPR(schedule[5])
|
||||
SHOW_EXPR(schedule[6])
|
||||
SHOW_EXPR(schedule[7])
|
||||
SHOW_EXPR(schedule[8])
|
||||
SHOW_EXPR(schedule[9])
|
||||
SHOW_EXPR(schedule[10])
|
||||
SHOW_EXPR(schedule[11])
|
||||
SHOW_EXPR(schedule[12])
|
||||
SHOW_EXPR(schedule[13])
|
||||
SHOW_EXPR(schedule[14])
|
||||
SHOW_EXPR(schedule[15])
|
||||
SHOW_EXPR(schedule[16])
|
||||
SHOW_EXPR(schedule[17])
|
||||
SHOW_EXPR(schedule[18])
|
||||
SHOW_EXPR(schedule[19])
|
||||
SHOW_EXPR(schedule[20])
|
||||
SHOW_EXPR(schedule[21])
|
||||
SHOW_EXPR(schedule[22])
|
||||
SHOW_EXPR(schedule[23])
|
||||
SHOW_EXPR(schedule[24])
|
||||
SHOW_EXPR(schedule[25])
|
||||
SHOW_EXPR(schedule[26])
|
||||
SHOW_EXPR(schedule[27])
|
||||
CHECK (schedule[ 0] == _uTicks(0ms));
|
||||
CHECK (schedule[ 1] == _uTicks(0ms));
|
||||
|
||||
// verify the numbers in detail....
|
||||
_Fmt stepFmt{"lev:%-2d stepFac:%-6.3f schedule:%6.3f"};
|
||||
auto stepStr = [&](uint i){ return string{stepFmt % i % stepFactors[i>0?i-1:0] % (_raw(schedule[i])/1000.0)}; };
|
||||
|
||||
CHECK (stepStr( 0) == "lev:0 stepFac:0.000 schedule: 0.000"_expect);
|
||||
CHECK (stepStr( 1) == "lev:1 stepFac:0.000 schedule: 0.000"_expect);
|
||||
CHECK (stepStr( 2) == "lev:2 stepFac:0.000 schedule: 0.000"_expect);
|
||||
CHECK (stepStr( 3) == "lev:3 stepFac:2.000 schedule: 1.000"_expect);
|
||||
CHECK (stepStr( 4) == "lev:4 stepFac:2.000 schedule: 1.000"_expect);
|
||||
CHECK (stepStr( 5) == "lev:5 stepFac:2.000 schedule: 1.000"_expect);
|
||||
CHECK (stepStr( 6) == "lev:6 stepFac:2.000 schedule: 1.000"_expect);
|
||||
CHECK (stepStr( 7) == "lev:7 stepFac:3.000 schedule: 1.500"_expect);
|
||||
CHECK (stepStr( 8) == "lev:8 stepFac:5.000 schedule: 2.500"_expect);
|
||||
CHECK (stepStr( 9) == "lev:9 stepFac:7.000 schedule: 3.500"_expect);
|
||||
CHECK (stepStr(10) == "lev:10 stepFac:8.000 schedule: 4.000"_expect);
|
||||
CHECK (stepStr(11) == "lev:11 stepFac:8.000 schedule: 4.000"_expect);
|
||||
CHECK (stepStr(12) == "lev:12 stepFac:8.000 schedule: 4.000"_expect);
|
||||
CHECK (stepStr(13) == "lev:13 stepFac:9.000 schedule: 4.500"_expect);
|
||||
CHECK (stepStr(14) == "lev:14 stepFac:10.000 schedule: 5.000"_expect);
|
||||
CHECK (stepStr(15) == "lev:15 stepFac:12.000 schedule: 6.000"_expect);
|
||||
CHECK (stepStr(16) == "lev:16 stepFac:12.000 schedule: 6.000"_expect);
|
||||
CHECK (stepStr(17) == "lev:17 stepFac:13.000 schedule: 6.500"_expect);
|
||||
CHECK (stepStr(18) == "lev:18 stepFac:16.000 schedule: 8.000"_expect);
|
||||
CHECK (stepStr(19) == "lev:19 stepFac:16.000 schedule: 8.000"_expect);
|
||||
CHECK (stepStr(20) == "lev:20 stepFac:20.000 schedule:10.000"_expect);
|
||||
CHECK (stepStr(21) == "lev:21 stepFac:22.500 schedule:11.250"_expect);
|
||||
CHECK (stepStr(22) == "lev:22 stepFac:24.167 schedule:12.083"_expect);
|
||||
CHECK (stepStr(23) == "lev:23 stepFac:26.167 schedule:13.083"_expect);
|
||||
CHECK (stepStr(24) == "lev:24 stepFac:28.167 schedule:14.083"_expect);
|
||||
CHECK (stepStr(25) == "lev:25 stepFac:30.867 schedule:15.433"_expect);
|
||||
CHECK (stepStr(26) == "lev:26 stepFac:31.867 schedule:15.933"_expect);
|
||||
CHECK (stepStr(27) == "lev:27 stepFac:32.867 schedule:16.433"_expect);
|
||||
|
||||
|
||||
// Adapted Schedule with lower stress level and higher concurrency....
|
||||
stressFac = 0.3;
|
||||
concurrency = 6;
|
||||
stepFactors = testLoad.levelScheduleSequence(concurrency).effuse();
|
||||
|
||||
testSetup.withAdaptedSchedule (stressFac, concurrency);
|
||||
schedule = testSetup.getScheduleSeq().effuse();
|
||||
|
||||
CHECK (stepStr( 0) == "lev:0 stepFac:0.000 schedule: 0.000"_expect);
|
||||
CHECK (stepStr( 1) == "lev:1 stepFac:0.000 schedule: 0.000"_expect);
|
||||
CHECK (stepStr( 2) == "lev:2 stepFac:0.000 schedule: 0.000"_expect);
|
||||
CHECK (stepStr( 3) == "lev:3 stepFac:2.000 schedule: 3.333"_expect);
|
||||
CHECK (stepStr( 4) == "lev:4 stepFac:2.000 schedule: 3.333"_expect);
|
||||
CHECK (stepStr( 5) == "lev:5 stepFac:2.000 schedule: 3.333"_expect);
|
||||
CHECK (stepStr( 6) == "lev:6 stepFac:2.000 schedule: 3.333"_expect);
|
||||
CHECK (stepStr( 7) == "lev:7 stepFac:3.000 schedule: 5.000"_expect);
|
||||
CHECK (stepStr( 8) == "lev:8 stepFac:5.000 schedule: 8.333"_expect);
|
||||
CHECK (stepStr( 9) == "lev:9 stepFac:7.000 schedule:11.666"_expect);
|
||||
CHECK (stepStr(10) == "lev:10 stepFac:8.000 schedule:13.333"_expect);
|
||||
CHECK (stepStr(11) == "lev:11 stepFac:8.000 schedule:13.333"_expect);
|
||||
CHECK (stepStr(12) == "lev:12 stepFac:8.000 schedule:13.333"_expect);
|
||||
CHECK (stepStr(13) == "lev:13 stepFac:9.000 schedule:15.000"_expect);
|
||||
CHECK (stepStr(14) == "lev:14 stepFac:10.000 schedule:16.666"_expect);
|
||||
CHECK (stepStr(15) == "lev:15 stepFac:12.000 schedule:20.000"_expect);
|
||||
CHECK (stepStr(16) == "lev:16 stepFac:12.000 schedule:20.000"_expect);
|
||||
CHECK (stepStr(17) == "lev:17 stepFac:13.000 schedule:21.666"_expect);
|
||||
CHECK (stepStr(18) == "lev:18 stepFac:16.000 schedule:26.666"_expect);
|
||||
CHECK (stepStr(19) == "lev:19 stepFac:16.000 schedule:26.666"_expect);
|
||||
CHECK (stepStr(20) == "lev:20 stepFac:18.000 schedule:30.000"_expect); // note: here the higher concurrency allows to process all 5 concurrent nodes at once
|
||||
CHECK (stepStr(21) == "lev:21 stepFac:20.500 schedule:34.166"_expect);
|
||||
CHECK (stepStr(22) == "lev:22 stepFac:22.167 schedule:36.944"_expect);
|
||||
CHECK (stepStr(23) == "lev:23 stepFac:23.167 schedule:38.611"_expect);
|
||||
CHECK (stepStr(24) == "lev:24 stepFac:24.167 schedule:40.277"_expect);
|
||||
CHECK (stepStr(25) == "lev:25 stepFac:25.967 schedule:43.277"_expect);
|
||||
CHECK (stepStr(26) == "lev:26 stepFac:26.967 schedule:44.944"_expect);
|
||||
CHECK (stepStr(27) == "lev:27 stepFac:27.967 schedule:46.611"_expect);
|
||||
|
||||
|
||||
micros = testSetup.launch_and_wait();
|
||||
SHOW_EXPR(micros);
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ namespace test {
|
|||
const auto SAFETY_TIMEOUT = 5s; ///< maximum time limit for test run, abort if exceeded
|
||||
const auto STANDARD_DEADLINE = 10ms; ///< deadline to use for each individual computation job
|
||||
const size_t DEFAULT_CHUNKSIZE = 64; ///< number of computation jobs to prepare in each planning round
|
||||
const size_t UPFRONT_PLANNING_BOOST = 2; ///< factor to increase the computed pre-roll to ensure up-front planning
|
||||
const double UPFRONT_PLANNING_BOOST = 2.6; ///< factor to increase the computed pre-roll to ensure up-front planning
|
||||
const size_t GRAPH_BENCHMARK_RUNS = 5; ///< repetition count for reference calculation of a complete node graph
|
||||
const size_t LOAD_BENCHMARK_RUNS = 500; ///< repetition count for calibration benchmark for ComputationalLoad
|
||||
const double LOAD_SPEED_BASELINE = 100; ///< initial assumption for calculation speed (without calibration)
|
||||
|
|
@ -171,7 +171,17 @@ namespace test {
|
|||
const Duration SCHEDULE_LEVEL_STEP{_uTicks(1ms)}; ///< time budget to plan for the calculation of each »time level« of jobs
|
||||
const Duration SCHEDULE_PLAN_STEP{_uTicks(100us)}; ///< time budget to reserve for each node to be planned and scheduled
|
||||
|
||||
inline uint defaultConcurr() { return work::Config::getDefaultComputationCapacity(); }
|
||||
inline uint
|
||||
defaultConcurr()
|
||||
{
|
||||
return work::Config::getDefaultComputationCapacity();
|
||||
}
|
||||
|
||||
inline double
|
||||
_uSec (microseconds ticks)
|
||||
{
|
||||
return std::chrono::duration<double, std::micro>{ticks}.count();
|
||||
}
|
||||
}
|
||||
|
||||
struct LevelWeight
|
||||
|
|
@ -1737,8 +1747,9 @@ namespace test {
|
|||
{
|
||||
awaitBlocking(
|
||||
performRun());
|
||||
});
|
||||
}
|
||||
})
|
||||
-_uSec(preRoll_);
|
||||
} // timing starts with nominal zero without pre-roll
|
||||
|
||||
auto
|
||||
getScheduleSeq()
|
||||
|
|
@ -1954,7 +1965,7 @@ namespace test {
|
|||
startTimes_.reserve (numPoints);
|
||||
startTimes_.push_back (Time::ZERO);
|
||||
chainLoad_.levelScheduleSequence (concurrency)
|
||||
.transform([&](double scheduleFact){ return (scheduleFact/stressFac) / levelSpeed_;})
|
||||
.transform([&](double scheduleFact){ return (scheduleFact/stressFac) * Offset{1,levelSpeed_};})
|
||||
.effuse(startTimes_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107721,26 +107721,33 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1704130248910" ID="ID_279203774" MODIFIED="1704130263076" TEXT="Verifikation und Testbarkeit">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1704130265344" ID="ID_1639859235" MODIFIED="1704130312923" TEXT="effektives Schedule abrufbar machen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1704130248910" ID="ID_279203774" MODIFIED="1704151060730" TEXT="Verifikation und Testbarkeit">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1704130265344" ID="ID_1639859235" MODIFIED="1704150121024" TEXT="effektives Schedule abrufbar machen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1704130314106" ID="ID_623101139" MODIFIED="1704130342207" TEXT="initialen pre-roll eigens konfiguieren">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#5b280f" CREATED="1704130314106" ID="ID_623101139" MODIFIED="1704150126125" TEXT="initialen pre-roll eigens konfiguieren">
|
||||
<icon BUILTIN="button_cancel"/>
|
||||
<node CREATED="1704150127077" ID="ID_1396686542" MODIFIED="1704150179937" TEXT="YAGNI">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1704130345454" ID="ID_599280470" MODIFIED="1704130368483" TEXT="initialen pre-roll vom Meßergebnis abziehen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1704150136478" ID="ID_1234809664" MODIFIED="1704150164816" TEXT="fest verdrahtete Puffer-Konstante genügt">
|
||||
<linktarget COLOR="#844a82" DESTINATION="ID_1234809664" ENDARROW="Default" ENDINCLINATION="3;42;" ID="Arrow_ID_1872499512" SOURCE="ID_1769532330" STARTARROW="None" STARTINCLINATION="52;6;"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1704130345454" ID="ID_599280470" MODIFIED="1704151049600" TEXT="initialen pre-roll vom Meßergebnis abziehen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1704130400942" ID="ID_1446554344" MODIFIED="1704130409312" TEXT="Test-Parametrisierung">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1702945731584" ID="ID_572123244" MODIFIED="1702945745735" TEXT="stress-Faktor relativ zu diesem Schema">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1702945731584" ID="ID_572123244" MODIFIED="1704151052631" TEXT="stress-Faktor relativ zu diesem Schema">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1704130423451" ID="ID_828141465" MODIFIED="1704143001031" TEXT="komplett-Planung vorneweg">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1704142955950" ID="ID_1769532330" MODIFIED="1704142991446" TEXT="KISS-Lösung genügt!">
|
||||
<node CREATED="1704142955950" ID="ID_1769532330" MODIFIED="1704150174895" TEXT="KISS-Lösung genügt!">
|
||||
<arrowlink COLOR="#844a82" DESTINATION="ID_1234809664" ENDARROW="Default" ENDINCLINATION="3;42;" ID="Arrow_ID_1872499512" STARTARROW="None" STARTINCLINATION="52;6;"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1704142966181" ID="ID_1582448622" MODIFIED="1704142997956" TEXT="chunk-Size maximal setzen">
|
||||
|
|
|
|||
Loading…
Reference in a new issue