Lumiera  0.pre.03
»edit your freedom«
job.h File Reference

Go to the source code of this file.

Description

Definition of a render job.

Jobs are defined within Steam-Layer and passed to the scheduler in the Back-end for time bound invocation. This header defines the data structures used to describe a job, and the basic data structures used by the scheduler to keep track of individual jobs. Moreover, within the C++ part of this header, some classes are layered on top of these data structures; especially the JobClosure ABC describes the generic part of each job, while the "moving parts" are embedded within the lumiera_jobParameter.

A render job is a parameterless function, ready to be invoked by the scheduler.. Since every non trivial job actually needs some parameters (at least a frame number) and relies on additional definitions and data structures, a closure is created to make these dependencies explicit and opaque for the scheduler. The actual job invocation is forwarded to a virtual function JobClosure::invokeJobOperation(JobParameter), which is defined "somewhere" in a subclass and remains opaque for the scheduler; the frame dispatcher takes care to configure each job descriptor with the correct pointer to a concrete closure prior to handing the job over to the scheduler.

Warning
as of 4/2023 the Job datastructure will be remoulded ///////////////////////////////////////////TICKET #1280
See also
SchedulerFrontend
JobTicket

Definition in file job.h.

#include "lib/llist.h"
#include "lib/hash-value.h"
#include "lib/time.h"
#include "lib/nocopy.hpp"
#include <string>

Classes

union  InvocationInstanceID
 opaque ID attached to each individual job invocation. More...
 
struct  InvocationInstanceID.code
 
struct  InvocationInstanceID.part
 
class  Job
 Individual frame rendering task, forwarding to a closure. More...
 
class  JobClosure
 Interface of the closure for frame rendering jobs. More...
 
class  JobFunctor
 
struct  LumieraJobClosure
 closure representing the execution context of a job. More...
 
struct  lumiera_jobDefinition
 complete definition of an individual job More...
 
struct  lumiera_jobDescriptor
 Description of a job. More...
 
struct  lumiera_jobParameter
 invocation parameter for the individual frame calculation job. More...
 

Typedefs

typedef int64_t FrameCnt
 
typedef lumiera_jobParameter const & JobParameter
 
typedef lumiera_jobDefinition * LumieraJobDefinition
 
typedef lumiera_jobDescriptor * LumieraJobDescriptor
 
typedef lumiera_jobParameter * LumieraJobParameter
 

Enumerations

enum  JobKind {
  CALC_JOB,
  LOAD_JOB,
  META_JOB,
  TEST_JOB
}
 
enum  JobPriority {
  TIMEBOUND_JOB,
  PAUSED_JOB,
  ASAP_JOB,
  BACKGROUND_JOB
}
 
enum  JobState {
  DONE,
  RUNNING,
  WAITING,
  REJECTED,
  EXPIRED,
  ABORTED
}
 

Functions

int lumiera_invokey_eq (void *l, void *r)
 
size_t lumiera_job_get_hash (LumieraJobDefinition)
 calculate a hash value based on the Job's identity. More...
 
void lumiera_job_invoke (LumieraJobDefinition)
 trigger execution of a specific job, assuming availability of all prerequisites
 
bool operator!= (Job const &left, Job const &right)
 
bool operator== (Job const &left, Job const &right)
 

Namespaces

 vault
 Vault-Layer implementation namespace root.
 
 vault::gear
 Active working gear and plumbing.
 

Enumeration Type Documentation

◆ JobState

enum JobState
Enumerator
DONE 

mission accomplished

RUNNING 

job is currently running

WAITING 

waiting for some prerequisite

REJECTED 

sorry, can't do that Dave

EXPIRED 

deadline expired

ABORTED 

got aborted

Definition at line 52 of file job.h.

◆ JobKind

enum JobKind
Enumerator
CALC_JOB 

calculating frame data, CPU bound

LOAD_JOB 

accessing prerequisites, IO bound

META_JOB 

render process self organisation

TEST_JOB 

test and diagnostic and research

Definition at line 62 of file job.h.

◆ JobPriority

Enumerator
TIMEBOUND_JOB 

regular job scheduled for time-bound delivery

PAUSED_JOB 
Todo:
do we need this special state?
ASAP_JOB 

job for freewheeling calculation of final results

BACKGROUND_JOB 

background rendering job

Definition at line 70 of file job.h.


Class Documentation

◆ InvocationInstanceID

union InvocationInstanceID
Class Members
lumiera_uid luid
FrameCnt frameNumber
struct InvocationInstanceID part
struct InvocationInstanceID code
+ Collaboration diagram for InvocationInstanceID:

◆ InvocationInstanceID.code

struct InvocationInstanceID.code
Class Members
uint64_t w1
uint64_t w2
+ Collaboration diagram for InvocationInstanceID.code:

◆ InvocationInstanceID.part

struct InvocationInstanceID.part
Class Members
int32_t a
int32_t b
int64_t t
+ Collaboration diagram for InvocationInstanceID.part:

◆ lumiera_jobDefinition_struct

struct lumiera_jobDefinition_struct
Class Members
LumieraJobClosure jobClosure type and context of the job, including the actual functor
lumiera_jobParameter parameter the "moving parts" for this individual invocation (Job)
+ Collaboration diagram for lumiera_jobDefinition:

◆ lumiera_jobDescriptor_struct

struct lumiera_jobDescriptor_struct
Class Members
gavl_time_t deadline given in real wall clock time
JobState jobState
lumiera_jobDefinition jobDefinition of interest only to Steam-Layer
LList waiting
LList failed
LList completed
+ Collaboration diagram for lumiera_jobDescriptor:

◆ lumiera_jobParameter_struct

struct lumiera_jobParameter_struct
Class Members
gavl_time_t nominalTime
InvocationInstanceID invoKey
+ Collaboration diagram for lumiera_jobParameter:

Function Documentation

◆ lumiera_job_get_hash()

size_t lumiera_job_get_hash ( LumieraJobDefinition  )

calculate a hash value based on the Job's identity.

Definition at line 144 of file job.cpp.