Scheduler-test: incremental calibration of both variants
- Generally speaking, the calibration uses current baseline settings; - There are now two different load generation methods, thus both must be calibrated - Performance contains some socked and non-linear effects, thus calibration should be done close to the work point, which can be achieved by incremental calibration until the error is < 5% Interestingly, longer time-base values run slightly faster than predicted, which is consistent with the expectation (socket cost). And using a larger memory block increases time values, which is also plausible, since cache effects will be diminishing
This commit is contained in:
parent
9ef8e78459
commit
db1ff7ded7
3 changed files with 162 additions and 22 deletions
|
|
@ -872,7 +872,6 @@ SHOW_EXPR(testLoad.getHash())
|
|||
{
|
||||
ComputationalLoad cpuLoad;
|
||||
CHECK (cpuLoad.timeBase == 100us);
|
||||
cpuLoad.useAllocation = true;
|
||||
|
||||
double micros = cpuLoad.invoke();
|
||||
SHOW_EXPR(micros)
|
||||
|
|
@ -890,6 +889,59 @@ SHOW_EXPR(micros)
|
|||
SHOW_EXPR(micros)
|
||||
CHECK (micros < 110);
|
||||
CHECK (micros > 90);
|
||||
|
||||
cpuLoad.useAllocation = true;
|
||||
SHOW_EXPR(cpuLoad.useAllocation)
|
||||
micros = cpuLoad.invoke();
|
||||
SHOW_EXPR(micros)
|
||||
CHECK (micros < 133);
|
||||
CHECK (micros > 80);
|
||||
|
||||
micros = cpuLoad.benchmark();
|
||||
SHOW_EXPR(micros)
|
||||
CHECK (micros < 110);
|
||||
CHECK (micros > 90);
|
||||
|
||||
cpuLoad.timeBase = 1ms;
|
||||
cpuLoad.sizeBase *= 100;
|
||||
SHOW_EXPR(cpuLoad.sizeBase)
|
||||
|
||||
cpuLoad.useAllocation = false;
|
||||
micros = cpuLoad.benchmark();
|
||||
SHOW_EXPR(micros)
|
||||
cpuLoad.useAllocation = true;
|
||||
micros = cpuLoad.benchmark();
|
||||
SHOW_EXPR(micros)
|
||||
|
||||
cpuLoad.calibrate();
|
||||
|
||||
cpuLoad.useAllocation = false;
|
||||
micros = cpuLoad.benchmark();
|
||||
SHOW_EXPR(micros)
|
||||
cpuLoad.useAllocation = true;
|
||||
micros = cpuLoad.benchmark();
|
||||
SHOW_EXPR(micros)
|
||||
SHOW_EXPR(5)
|
||||
cpuLoad.useAllocation = false;
|
||||
micros = cpuLoad.invoke(5);
|
||||
SHOW_EXPR(micros)
|
||||
cpuLoad.useAllocation = true;
|
||||
micros = cpuLoad.invoke(5);
|
||||
SHOW_EXPR(micros)
|
||||
SHOW_EXPR(10)
|
||||
cpuLoad.useAllocation = false;
|
||||
micros = cpuLoad.invoke(10);
|
||||
SHOW_EXPR(micros)
|
||||
cpuLoad.useAllocation = true;
|
||||
micros = cpuLoad.invoke(10);
|
||||
SHOW_EXPR(micros)
|
||||
SHOW_EXPR(100)
|
||||
cpuLoad.useAllocation = false;
|
||||
micros = cpuLoad.invoke(100);
|
||||
SHOW_EXPR(micros)
|
||||
cpuLoad.useAllocation = true;
|
||||
micros = cpuLoad.invoke(100);
|
||||
SHOW_EXPR(micros)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1117,11 +1117,10 @@ namespace test {
|
|||
calibrate()
|
||||
{
|
||||
cout<<">CAL: speed="<<computationSpeed(useAllocation)<<" rounds:"<<roundsNeeded(1)<<endl;
|
||||
auto speed = determineSpeed();
|
||||
cout<<".CAL: speed="<<speed<<endl;
|
||||
speed = determineSpeed();
|
||||
cout<<".CAL: speed="<<speed<<endl;
|
||||
computationSpeed(useAllocation) = determineSpeed();
|
||||
TRANSIENTLY(useAllocation) = false;
|
||||
performIncrementalCalibration();
|
||||
useAllocation = true;
|
||||
performIncrementalCalibration();
|
||||
cout<<"<CAL: speed="<<computationSpeed(useAllocation)<<" rounds:"<<roundsNeeded(1)<<endl;
|
||||
}
|
||||
|
||||
|
|
@ -1146,10 +1145,10 @@ cout<<"<CAL: speed="<<computationSpeed(useAllocation)<<" rounds:"<<roundsNeeded(
|
|||
{
|
||||
auto cnt = roundsNeeded(scaleStep);
|
||||
auto siz = scaleStep * sizeBase;
|
||||
auto rep = max (cnt/siz, 1u);
|
||||
// increase size to fit
|
||||
siz = cnt /(cnt/siz);
|
||||
cnt /= siz;
|
||||
return make_pair (siz,cnt);
|
||||
siz = cnt / rep;
|
||||
return make_pair (siz,rep);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1184,6 +1183,20 @@ cout<<"<CAL: speed="<<computationSpeed(useAllocation)<<" rounds:"<<roundsNeeded(
|
|||
auto stepsDone = roundsNeeded (step4gauge);
|
||||
return stepsDone / micros;
|
||||
}
|
||||
|
||||
void
|
||||
performIncrementalCalibration()
|
||||
{
|
||||
double& speed = computationSpeed(useAllocation);
|
||||
double prev{speed},delta;
|
||||
do {
|
||||
speed = determineSpeed();
|
||||
delta = abs(1.0 - speed/prev);
|
||||
cout<<".CAL: "<<prev<<"->"<<speed<<" Δ="<<delta<<endl;
|
||||
prev = speed;
|
||||
}
|
||||
while (delta > 0.05);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -99536,9 +99536,9 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="stop-sign"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1702175359697" ID="ID_514427629" MODIFIED="1702175909285" TEXT="entwickle eine einfache reine lokale CPU-Last">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1702175912809" ID="ID_163082441" MODIFIED="1702176005420" TEXT="als eigenständige Komponente realisiert">
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1702175359697" ID="ID_514427629" MODIFIED="1702264066131" TEXT="entwickle eine einfache reine lokale CPU-Last">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#435e98" CREATED="1702175912809" ID="ID_163082441" MODIFIED="1702264184671" TEXT="als eigenständige Komponente realisiert">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
|
|
@ -99598,7 +99598,7 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1702176870348" ID="ID_1843992678" MODIFIED="1702176878242" TEXT="soll statisch kalibrierbar sein">
|
||||
<node COLOR="#435e98" CREATED="1702176870348" ID="ID_1843992678" MODIFIED="1702264178196" TEXT="soll statisch kalibrierbar sein">
|
||||
<node CREATED="1702176883018" ID="ID_1063649357" MODIFIED="1702177162816" TEXT="auf 1 LoadUnit ≙ 500ms"/>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1702177164613" ID="ID_1363806337" MODIFIED="1702177174397" TEXT="potentiell schwieriges Thema">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
|
|
@ -99606,10 +99606,14 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1702177263500" ID="ID_1442486267" MODIFIED="1702177272676" TEXT="der Arbeitspunkt kann extrem stark vom System abhängen"/>
|
||||
<node CREATED="1702177960453" ID="ID_1625146144" MODIFIED="1702177990715" TEXT="der konkrete Aufruf bedingt einen zusätzlichen, schwer kalkulierbaren Overhead"/>
|
||||
</node>
|
||||
<node CREATED="1702177290852" ID="ID_67369431" MODIFIED="1702177302130" TEXT="muß dafür mindestends 3 microbenchmark-Läufe machen">
|
||||
<node COLOR="#435e98" CREATED="1702177290852" ID="ID_67369431" MODIFIED="1702264175024" TEXT="muß dafür mehrere microbenchmark-Läufe machen">
|
||||
<icon BUILTIN="yes"/>
|
||||
<node CREATED="1702177304850" ID="ID_807191919" MODIFIED="1702177310093" TEXT="eine Grobmessung"/>
|
||||
<node CREATED="1702177310801" ID="ID_1861526014" MODIFIED="1702177325890" TEXT="eine Feinmessung nach erster Kalibrierung"/>
|
||||
<node CREATED="1702177355580" ID="ID_592613013" MODIFIED="1702177360463" TEXT="eine Bestätigungsmessung"/>
|
||||
<node COLOR="#338800" CREATED="1702264146445" ID="ID_183329724" MODIFIED="1702264157063" TEXT="noch besser: inkrementell bis Fehler < 5%">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1702232217892" ID="ID_683123783" MODIFIED="1702232389856" TEXT="die Kalibrierung verwendet aktuelle Einstellungen">
|
||||
<arrowlink COLOR="#61778b" DESTINATION="ID_94944522" ENDARROW="Default" ENDINCLINATION="138;-14;" ID="Arrow_ID_1125419326" STARTARROW="None" STARTINCLINATION="54;3;"/>
|
||||
|
|
@ -99618,20 +99622,19 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1702232438440" ID="ID_1878954665" MODIFIED="1702232455960" TEXT="man muß für die jeweiligen Einstellungen (re)kalibrieren"/>
|
||||
<node CREATED="1702232412226" HGAP="34" ID="ID_43541079" MODIFIED="1702232463171" TEXT="damit werden nicht-Linearitäten ausgeschaltet" VSHIFT="-7"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1702260328321" ID="ID_1651629984" MODIFIED="1702260339078" TEXT="beide Varianten inkrementell kalibrieren">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1702260328321" ID="ID_1651629984" MODIFIED="1702263255195" TEXT="beide Varianten inkrementell kalibrieren">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1702180295927" ID="ID_773261601" MODIFIED="1702180308206" TEXT="Komponente testen">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1702180295927" ID="ID_773261601" MODIFIED="1702264050859" TEXT="Komponente testen">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1702170514679" ID="ID_1603893065" MODIFIED="1702180426043" TEXT="Infrastruktur für einen »weight«-Parameter">
|
||||
<arrowlink COLOR="#68cb83" DESTINATION="ID_1963766841" ENDARROW="Default" ENDINCLINATION="549;30;" ID="Arrow_ID_1920696609" STARTARROW="None" STARTINCLINATION="47;-145;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1702180446234" ID="ID_257805938" MODIFIED="1702245405826" TEXT="Last und Eichung">
|
||||
<node CREATED="1702180446234" ID="ID_257805938" MODIFIED="1702264012440" TEXT="Last und Eichung">
|
||||
<arrowlink COLOR="#c26a36" DESTINATION="ID_168687387" ENDARROW="Default" ENDINCLINATION="-214;715;" ID="Arrow_ID_917319622" STARTARROW="None" STARTINCLINATION="-169;-474;"/>
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1702245098652" ID="ID_1449908056" MODIFIED="1702260306418" TEXT="Fehler im Test?">
|
||||
<node COLOR="#435e98" CREATED="1702245098652" ID="ID_1449908056" MODIFIED="1702263276344" TEXT="Fehler im Test?">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
|
|
@ -99654,6 +99657,31 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</richcontent>
|
||||
<icon BUILTIN="help"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1702263260126" ID="ID_1499147739" MODIFIED="1702264010690" TEXT="funktioniert ordentlich">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node CREATED="1702263313431" ID="ID_895745548" MODIFIED="1702264006022" TEXT="CPU sogar mit scaleStep OK"/>
|
||||
<node CREATED="1702265746035" ID="ID_1709742498" MODIFIED="1702265757916" TEXT="größere Timebase ⟶ schneller"/>
|
||||
<node CREATED="1702263578440" ID="ID_1625923973" MODIFIED="1702264017267" TEXT="mem wird langsamer">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
bei..
|
||||
</p>
|
||||
<p>
|
||||
sizeBase = 10000 ⟼ +5%
|
||||
</p>
|
||||
<p>
|
||||
sizeBase = 100000 ⟼ +10-20%
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -99666,10 +99694,29 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
<node CREATED="1702178113354" ID="ID_1844351587" MODIFIED="1702178121761" TEXT="der Eichfaktor aus der Kalibrierung">
|
||||
<node CREATED="1702232275607" ID="ID_1593878835" MODIFIED="1702232401866" TEXT="platformFactor">
|
||||
<node CREATED="1702232275607" ID="ID_1593878835" MODIFIED="1702264132798" TEXT="computationSpeed()">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
repetitions/µs
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<linktarget COLOR="#61778b" DESTINATION="ID_1593878835" ENDARROW="Default" ENDINCLINATION="138;-14;" ID="Arrow_ID_193276040" SOURCE="ID_683123783" STARTARROW="None" STARTINCLINATION="54;3;"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1702264216478" ID="ID_1256970210" MODIFIED="1702265717124" TEXT="per default mit 100µs aktiv">
|
||||
<arrowlink COLOR="#f41958" DESTINATION="ID_880925728" ENDARROW="Default" ENDINCLINATION="91;4;" ID="Arrow_ID_669621335" STARTARROW="None" STARTINCLINATION="-10;15;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1702264248082" ID="ID_880925728" MODIFIED="1702265717124" TEXT="⟹ Konsequenz: muß Graph-Berechnung statisch messen können">
|
||||
<arrowlink COLOR="#b04460" DESTINATION="ID_1821698627" ENDARROW="Default" ENDINCLINATION="-913;-87;" ID="Arrow_ID_423579693" STARTARROW="None" STARTINCLINATION="-1124;53;"/>
|
||||
<linktarget COLOR="#f41958" DESTINATION="ID_880925728" ENDARROW="Default" ENDINCLINATION="91;4;" ID="Arrow_ID_669621335" SOURCE="ID_1256970210" STARTARROW="None" STARTINCLINATION="-10;15;"/>
|
||||
</node>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1699756460900" ID="ID_1877216077" MODIFIED="1699758391567" TEXT="Implementierung per boost-Hash">
|
||||
|
|
@ -100943,6 +100990,34 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1702264364035" ID="ID_1821698627" MODIFIED="1702265701973" TEXT="Basis-Messung (non-concurrent)">
|
||||
<linktarget COLOR="#b04460" DESTINATION="ID_1821698627" ENDARROW="Default" ENDINCLINATION="-913;-87;" ID="Arrow_ID_423579693" SOURCE="ID_880925728" STARTARROW="None" STARTINCLINATION="-1124;53;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node CREATED="1702264442593" ID="ID_1012991246" MODIFIED="1702264507186" TEXT="lineare Berechnungs-Zeit mühsam bis unmöglich zu ermitteln">
|
||||
<icon BUILTIN="info"/>
|
||||
</node>
|
||||
<node CREATED="1702264696031" ID="ID_1280925602" MODIFIED="1702264716392" TEXT="daher Benchmark eines Berechnungs-Durchganges"/>
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1702264680182" ID="ID_1945693212" MODIFIED="1702264692151" TEXT="kann man einen theoretischen Concurrency-Faktor bestimmen?">
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1702265262323" ID="ID_1908727445" MODIFIED="1702265353793" TEXT="ja ... die Datenstruktur ist günstig">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
und zwar der Umstand, daß die Nodes <i>innerhalb eines Levels stets voneinander unabhängig sind; </i>deshalb sind <i>zumindest</i> diese Nodes komplett parallelisierbar
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
</richcontent>
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
<node CREATED="1702265418472" ID="ID_565310505" MODIFIED="1702265468382" TEXT="Beschleunigungsfaktor: ∅w / floor(∅w/concurrency)">
|
||||
<icon BUILTIN="forward"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1700105555476" ID="ID_587761135" MODIFIED="1700105558876" TEXT="Scheduling">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1701488317653" ID="ID_502099140" MODIFIED="1702158167293" TEXT="Art der Integration festlegen">
|
||||
|
|
|
|||
Loading…
Reference in a new issue