Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
job.h File Reference

Definition of a render job. More...

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 <inttypes.h>
#include "lib/nocopy.hpp"
#include "lib/time/timevalue.hpp"
#include <string>

Namespaces

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

Typedefs

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

Enumerations

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

Classes

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

Functions

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

Typedef Documentation

◆ raw_time_64

typedef int64_t raw_time_64

Definition at line 50 of file job.h.

◆ FrameCnt

typedef int64_t FrameCnt

Definition at line 80 of file job.h.

◆ LumieraJobParameter

typedef lumiera_jobParameter* LumieraJobParameter

Definition at line 135 of file job.h.

◆ LumieraJobDefinition

typedef lumiera_jobDefinition* LumieraJobDefinition

Definition at line 145 of file job.h.

◆ LumieraJobDescriptor

typedef lumiera_jobDescriptor* LumieraJobDescriptor

Definition at line 181 of file job.h.

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 53 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 63 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 71 of file job.h.


Class Documentation

◆ InvocationInstanceID

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

◆ lumiera_jobParameter_struct

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

◆ 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
raw_time_64 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:

◆ InvocationInstanceID.part

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

◆ InvocationInstanceID.code

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

Function Documentation

◆ lumiera_job_invoke()

void lumiera_job_invoke ( LumieraJobDefinition  jobDef)

trigger execution of a specific job, assuming availability of all prerequisites

Definition at line 137 of file job.cpp.

References anonymous_namespace{job.cpp}::forwardInvocation(), and Job::triggerJob().

+ Here is the call graph for this function:

◆ lumiera_job_get_hash()

size_t lumiera_job_get_hash ( LumieraJobDefinition  jobDef)

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

Definition at line 144 of file job.cpp.

References anonymous_namespace{job.cpp}::forwardInvocation().

+ Here is the call graph for this function:

◆ lumiera_invokey_eq()

int lumiera_invokey_eq ( void *  l,
void *  r 
)

Definition at line 154 of file job.cpp.

References lumiera_uid_eq().

Referenced by MockJob::isNopJob(), JobTicket::isValid(), steam::engine::anonymous_namespace{job-ticket.cpp}::operator==(), MockSupport_test::verify_MockJobTicket(), and MockSupport_test::verify_MockSegmentation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: