Job-Planning: code up simplest use case
This commit is contained in:
parent
b9f8356afc
commit
73a9e4495a
4 changed files with 107 additions and 24 deletions
|
|
@ -324,7 +324,7 @@ namespace engine {
|
|||
* @return Iterator to pull a sequence of render jobs, ready for processing
|
||||
*/
|
||||
auto
|
||||
feedTo (play::DataSink sink)
|
||||
feedTo (play::DataSink& sink)
|
||||
{
|
||||
return terminatePipeline (
|
||||
SRC::transform(
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include "vault/engine/job.h"
|
||||
#include "steam/engine/job-ticket.hpp"
|
||||
#include "steam/engine/frame-coord.hpp"
|
||||
#include "steam/play/output-slot.hpp"
|
||||
#include "lib/time/timevalue.hpp"
|
||||
//#include "lib/iter-explorer.hpp"
|
||||
//#include "lib/iter-adapter.hpp"
|
||||
|
|
@ -60,7 +61,8 @@ namespace steam {
|
|||
namespace engine {
|
||||
|
||||
namespace error = lumiera::error;
|
||||
|
||||
|
||||
using play::DataSink;
|
||||
using lib::time::TimeValue;
|
||||
using util::unConst;
|
||||
using util::isnil;
|
||||
|
|
@ -84,15 +86,15 @@ namespace engine {
|
|||
*/
|
||||
class JobPlanning
|
||||
{
|
||||
// JobTicket::ExplorationState plannedOperations_;
|
||||
FrameCoord point_to_calculate_;
|
||||
FrameCoord frameCoord_;
|
||||
JobTicket& jobTicket_;
|
||||
DataSink& outputSink_;
|
||||
|
||||
public:
|
||||
/** by default create the bottom element of job planning,
|
||||
* which happens to to plan no job at all. It is represented
|
||||
* using an inactive state core (default constructed)
|
||||
*/
|
||||
JobPlanning()
|
||||
JobPlanning(FrameCoord frame, JobTicket& ticket, DataSink& sink)
|
||||
: frameCoord_{frame}
|
||||
, jobTicket_{ticket}
|
||||
, outputSink_{sink}
|
||||
{ }
|
||||
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1276 :: to be refactored...
|
||||
|
|
@ -109,19 +111,16 @@ namespace engine {
|
|||
// using the standard copy operations
|
||||
|
||||
|
||||
/** cast and explicate this job planning information
|
||||
* to create a frame job descriptor, ready to be scheduled
|
||||
/**
|
||||
* Connect and complete the planning information assembled thus far
|
||||
* to create a frame job descriptor, ready to be scheduled.
|
||||
*/
|
||||
operator Job()
|
||||
Job
|
||||
buildJob()
|
||||
{
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1276 :: to be refactored...
|
||||
if (isnil (plannedOperations_))
|
||||
throw error::Logic("Attempt to plan a frame-Job based on a missing, "
|
||||
"unspecified, exhausted or superseded job description"
|
||||
,error::LUMIERA_ERROR_BOTTOM_VALUE);
|
||||
|
||||
return plannedOperations_->createJobFor (point_to_calculate_);
|
||||
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1276 :: to be refactored...
|
||||
Job job = jobTicket_.createJobFor (frameCoord_);
|
||||
//////////////////////////////////////////////////////TICKET #1295 : somehow package and communicate the DataSink info
|
||||
return job;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
//#include "steam/engine/procnode.hpp"
|
||||
//#include "steam/play/dummy-play-connection.hpp"
|
||||
//#include "steam/mobject/model-port.hpp"
|
||||
//#include "steam/engine/dispatcher.hpp"
|
||||
#include "steam/engine/mock-dispatcher.hpp"
|
||||
#include "steam/play/timings.hpp"
|
||||
#include "lib/time/timevalue.hpp"
|
||||
//#include "lib/time/timequant.hpp"
|
||||
|
|
@ -58,7 +58,7 @@ namespace steam {
|
|||
namespace engine{
|
||||
namespace test {
|
||||
|
||||
// using lib::time::FrameRate;
|
||||
using lib::time::FrameRate;
|
||||
// using lib::time::Duration;
|
||||
// using lib::time::Offset;
|
||||
// using lib::time::TimeVar;
|
||||
|
|
@ -108,6 +108,19 @@ namespace test {
|
|||
void
|
||||
simpleUsage()
|
||||
{
|
||||
MockDispatcher dispatcher;
|
||||
play::Timings timings (FrameRate::PAL);
|
||||
auto [port,sink] = dispatcher.getDummyConnection(1);
|
||||
|
||||
Time nominalTime{200,0};
|
||||
size_t portIDX = dispatcher.resolveModelPort (port);
|
||||
FrameCoord frame{nominalTime, portIDX};
|
||||
JobTicket& ticket = dispatcher.getJobTicketFor(frame);
|
||||
|
||||
JobPlanning plan{frame,ticket,sink};
|
||||
Job job = plan.buildJob();
|
||||
|
||||
CHECK (dispatcher.verify (job, port, sink));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -70012,6 +70012,19 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<node CREATED="1686841807901" ID="ID_886837998" MODIFIED="1686841818018" TEXT="war ein zentraler Daten-Aggregator im 1.Entwurf"/>
|
||||
<node CREATED="1686841818526" ID="ID_834625454" MODIFIED="1686841830837" TEXT="mit dem Wegfall des TimeAnchor nimmt die Bedeutung sehr ab"/>
|
||||
<node CREATED="1686841831377" ID="ID_1948825773" MODIFIED="1686841838684" TEXT="derzeit noch in der Planning-Pipeline verwendet"/>
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1686867570930" ID="ID_1291057680" MODIFIED="1686867716668" TEXT="könnten komplett aufgelöst werden?">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
eigentlich werden nur zwei Felder genutzt, und davon der ModelPort-IDX nur an einer einzigen Stelle (beim Zugriff auf das JobTicket). Die absolute Frame-Nr geht bisher nirgends ein — sie ist redundant, wenn man die Timings kennt, und jenseits der Job-Erstellung komplett irrelevant (soll auch irrelevant sein)
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="help"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1681169265752" ID="ID_388188594" MODIFIED="1681169268100" TEXT="JobTicket">
|
||||
<node COLOR="#435e98" CREATED="1681169270184" ID="ID_778864690" MODIFIED="1686697119512" TEXT="die schon gecodete Logik sieht sehr nach Skizze aus">
|
||||
|
|
@ -75685,10 +75698,24 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686793407407" ID="ID_194609603" MODIFIED="1686793411216" TEXT="Erzeugung">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1686840957950" ID="ID_845216336" MODIFIED="1686840973262" TEXT="benötigte Daten">
|
||||
<node COLOR="#435e98" CREATED="1686840957950" ID="ID_845216336" MODIFIED="1686867992404" TEXT="benötigte Daten">
|
||||
<icon BUILTIN="info"/>
|
||||
<node CREATED="1686840974924" ID="ID_652755563" MODIFIED="1686840977248" TEXT="FrameCoord"/>
|
||||
<node CREATED="1686840974924" ID="ID_652755563" MODIFIED="1686840977248" TEXT="FrameCoord">
|
||||
<linktarget COLOR="#a9b4c1" DESTINATION="ID_652755563" ENDARROW="Default" ENDINCLINATION="45;0;" ID="Arrow_ID_153003944" SOURCE="ID_84700425" STARTARROW="None" STARTINCLINATION="45;0;"/>
|
||||
</node>
|
||||
<node CREATED="1686840978452" ID="ID_265897681" MODIFIED="1686840982768" TEXT="JobTIcket"/>
|
||||
<node CREATED="1686846340230" ID="ID_84700425" MODIFIED="1686866970333" TEXT="ModelPort-IDX">
|
||||
<arrowlink DESTINATION="ID_652755563" ENDARROW="Default" ENDINCLINATION="45;0;" ID="Arrow_ID_153003944" STARTARROW="None" STARTINCLINATION="45;0;"/>
|
||||
</node>
|
||||
<node CREATED="1686846346240" ID="ID_599217760" MODIFIED="1686846349747" TEXT="DataSink"/>
|
||||
</node>
|
||||
<node COLOR="#435e98" CREATED="1686868037369" ID="ID_240161255" MODIFIED="1686868049388" TEXT="Design: RAII-style oder builder-style?">
|
||||
<node CREATED="1686868053988" ID="ID_1964324480" MODIFIED="1686868070029" TEXT="Berechnungen können nicht wirklich scheitern"/>
|
||||
<node CREATED="1686868070689" ID="ID_391399208" MODIFIED="1686868077468" TEXT="aber in manchen Fällen kommen Infos dazu"/>
|
||||
<node BACKGROUND_COLOR="#e0ceaa" COLOR="#690f14" CREATED="1686868079216" ID="ID_20062168" MODIFIED="1686868093219" TEXT="Builder">
|
||||
<icon BUILTIN="forward"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686868094902" ID="ID_1505078713" MODIFIED="1686868116317" TEXT="⟹ Timing-Berechnungen erfolgen erst bei Bedarf"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686793412168" ID="ID_566542363" MODIFIED="1686793437280" TEXT="Deadline festsetzen">
|
||||
|
|
@ -76721,6 +76748,50 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1686872190656" ID="ID_670265387" MODIFIED="1686872207758" TEXT="„Arbeitsdaten“">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node CREATED="1686872245768" ID="ID_1141513319" MODIFIED="1686872255066" TEXT="Arten">
|
||||
<icon BUILTIN="info"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686872215460" ID="ID_1558835210" MODIFIED="1686872231247" TEXT="Job / Functor - Parameter">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686872232642" ID="ID_656864702" MODIFIED="1686872236953" TEXT="Output-Handles">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1686872616987" ID="ID_1351243761" MODIFIED="1686872629371" TEXT="Vorsicht mit DataSink">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1686872256462" ID="ID_120877815" MODIFIED="1686872267372" TEXT="Lebenszyklus">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686872321254" ID="ID_1857168941" MODIFIED="1686872455222" TEXT="Check-Points einführen">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
wir können nicht die Daten für jeden Job einzeln nachverfolgen (dann würden wir etwa den Level von Arbeit leisten, wie ein Garbage-Collector) — vielmehr muß es sowas wie »epochs« geben
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1686872343058" ID="ID_1227545358" MODIFIED="1686872608735" TEXT="Obsolete Reste beobachten können">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
In extremen Situationen kann es vorkommen, daß das Checkpoint-System eine Rest-Menge identifiziert, die aus <i>anderen Gründen</i>  zuverlässig beobachtet werden muß. Als Beispiel denke ich über obsolete Reste einer aufwendigen Berechnungskette, die unterwegs geändert wurde: hier müssen diejenigen (wenigen) Activities gefunden werden, die bereits „unterwegs“ sind; erst wenn diese alle wieder zurückgekommen sind, kann ein Clean-up-Trigger feuern
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1681086215092" ID="ID_688439359" MODIFIED="1681425384986" TEXT="Activity">
|
||||
<linktarget COLOR="#f4fec9" DESTINATION="ID_688439359" ENDARROW="Default" ENDINCLINATION="-522;-149;" ID="Arrow_ID_1352278228" SOURCE="ID_1926192234" STARTARROW="None" STARTINCLINATION="1598;114;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue