IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.ParallelJobDispatcherBase Class Reference

Base class for parallel job dispatchers. Accepts job requests and dispatches jobs to parallel job servers when available and redy to run a job. More...

+ Inheritance diagram for IG.Num.ParallelJobDispatcherBase:
+ Collaboration diagram for IG.Num.ParallelJobDispatcherBase:

Public Member Functions

void IncrementNumSentJobs ()
 Increments by one the number of sent jobs (all jobs sent to the current dispatcher for execution). More...
 
void IncrementNumStartedJobs ()
 Increments by one the number of started by the dispatcher up to this point. More...
 
void IncrementNumFinishedJobs ()
 Increments by one the number of finished jobs (of those handled by the current dispatcher) up to this point. More...
 
void IncrementNumAbortedJobs ()
 Increments by one the number of aborted jobs (of those handled by the current dispatcher) up to this point. More...
 

Protected Member Functions

void ResetNumIdleJobServers ()
 Resets number of idle job servers to 0. More...
 

Static Protected Member Functions

static int GetNextId ()
 Returns another ID that is unique for objects of the containing class its and derived classes. More...
 

Protected Attributes

readonly object ServersLock = new object()
 Lock that is usef for locking code that can be run from servers. More...
 
volatile int _outputLevel = ParallelJobContainerBase.DefaultOutputLevel
 Output level for objects of this class. More...
 
bool _isTestMode = ParallelJobContainerBase.DefaultIsTestMode
 
int _sleepTimeMs = DefaultSleepTimeMs
 
int _numSentJobs = 0
 

Properties

object Lock [get]
 This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More...
 
static int DefaultOutputLevel [get, set]
 Default output level for objects of this and derived types. More...
 
int OutputLevel [get, set]
 Output level the current object. More...
 
static bool DefaultIsTestMode [get, set]
 Default value of test mode flag. More...
 
bool IsTestMode [get, set]
 Whether the current job data conntainer is in test mode. In this mode, delays specified by internal variables are automatically added in job execution. More...
 
int Id [get]
 Unique ID for objects of the currnet and derived classes. More...
 
static int DefaultSleepTimeMs [get, set]
 Default sleeping time, in milliseconds, used by parallel job data objects when waiting for fulfillment of some condition in a loop that includes sleeping when condition is not met. More...
 
int SleepTimeMs [get, set]
 Sleeping time, in milliseconds, used by the current object when waiting for fulfillment of some condition in a loop that includes sleeping when condition is not met. More...
 
int NumIdleJobServers [get]
 Gets the number of idle job servers that are currently available on the dispatcher. More...
 
int NumSentJobs [get]
 Gets the number of sent jobs (all jobs sent to the current dispatcher for execution). More...
 
int NumStartedJobs [get]
 Gets the number of jobs started by the dispatcher up to this point. More...
 
int NumFinishedJobs [get]
 Gets the number of finished jobs (of those handled by the current dispatcher) up to this point. More...
 
int NumAbortedJobs [get]
 Gets the number of aborted jobs (of those handled by the current dispatcher) up to this point. More...
 
int NumUncompletedJobs [get]
 Gets the number of idle job runners that are currently available on the dispatcher. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 
- Properties inherited from IG.Lib.IIdentifiable
int Id [get]
 Returns unique ID (in the scope of a given type) of the current object. More...
 

Private Attributes

readonly object _mainLock = new object()
 
int _id = GetNextId()
 
int _nextJobId = 0
 
int _numIdleJobServers = 0
 
int _numStartedJobs = 0
 
int _numFinishedJobs = 0
 
int _numAbortedJobs = 0
 

Static Private Attributes

static int _nextId = 0
 
static int _defaultSleepTimeMs = 2
 

Detailed Description

Base class for parallel job dispatchers. Accepts job requests and dispatches jobs to parallel job servers when available and redy to run a job.

Template Parameters
DataContainerTypeType of the container that holds data for the job (input and output).

A non-generic class is defined in order to be used in the job data container class (ParallelJobContainerBase).

$A Igor Aug08;

Member Function Documentation

static int IG.Num.ParallelJobDispatcherBase.GetNextId ( )
inlinestaticprotected

Returns another ID that is unique for objects of the containing class its and derived classes.

References IG.Num.ParallelJobContainerBase.LockId.

void IG.Num.ParallelJobDispatcherBase.ResetNumIdleJobServers ( )
inlineprotected

Resets number of idle job servers to 0.

void IG.Num.ParallelJobDispatcherBase.IncrementNumSentJobs ( )
inline

Increments by one the number of sent jobs (all jobs sent to the current dispatcher for execution).

void IG.Num.ParallelJobDispatcherBase.IncrementNumStartedJobs ( )
inline

Increments by one the number of started by the dispatcher up to this point.

void IG.Num.ParallelJobDispatcherBase.IncrementNumFinishedJobs ( )
inline

Increments by one the number of finished jobs (of those handled by the current dispatcher) up to this point.

void IG.Num.ParallelJobDispatcherBase.IncrementNumAbortedJobs ( )
inline

Increments by one the number of aborted jobs (of those handled by the current dispatcher) up to this point.

Member Data Documentation

readonly object IG.Num.ParallelJobDispatcherBase._mainLock = new object()
private
readonly object IG.Num.ParallelJobDispatcherBase.ServersLock = new object()
protected

Lock that is usef for locking code that can be run from servers.

List of idle servers is locked by this lock, as well as various data that is accessed on job start, abort or finished events on servers, such as number of started jobs.

volatile int IG.Num.ParallelJobDispatcherBase._outputLevel = ParallelJobContainerBase.DefaultOutputLevel
protected

Output level for objects of this class.

Specifies how much output is printed to console during operation.

bool IG.Num.ParallelJobDispatcherBase._isTestMode = ParallelJobContainerBase.DefaultIsTestMode
protected
int IG.Num.ParallelJobDispatcherBase._nextId = 0
staticprivate
int IG.Num.ParallelJobDispatcherBase._id = GetNextId()
private
int IG.Num.ParallelJobDispatcherBase._defaultSleepTimeMs = 2
staticprivate
int IG.Num.ParallelJobDispatcherBase._sleepTimeMs = DefaultSleepTimeMs
protected
int IG.Num.ParallelJobDispatcherBase._nextJobId = 0
private
int IG.Num.ParallelJobDispatcherBase._numIdleJobServers = 0
private
int IG.Num.ParallelJobDispatcherBase._numSentJobs = 0
protected
int IG.Num.ParallelJobDispatcherBase._numStartedJobs = 0
private
int IG.Num.ParallelJobDispatcherBase._numFinishedJobs = 0
private
int IG.Num.ParallelJobDispatcherBase._numAbortedJobs = 0
private

Property Documentation

object IG.Num.ParallelJobDispatcherBase.Lock
get

This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.

int IG.Num.ParallelJobDispatcherBase.DefaultOutputLevel
staticgetset

Default output level for objects of this and derived types.

Just aliases the ParallelJobContainerBase.DefaultOutputLevel.

int IG.Num.ParallelJobDispatcherBase.OutputLevel
getset

Output level the current object.

Specifies how much output is printed to console during operation.

bool IG.Num.ParallelJobDispatcherBase.DefaultIsTestMode
staticgetset

Default value of test mode flag.

Just aliases the ParallelJobContainerBase.DefaultOutputLevel.

bool IG.Num.ParallelJobDispatcherBase.IsTestMode
getset

Whether the current job data conntainer is in test mode. In this mode, delays specified by internal variables are automatically added in job execution.

int IG.Num.ParallelJobDispatcherBase.Id
get

Unique ID for objects of the currnet and derived classes.

int IG.Num.ParallelJobDispatcherBase.DefaultSleepTimeMs
staticgetset

Default sleeping time, in milliseconds, used by parallel job data objects when waiting for fulfillment of some condition in a loop that includes sleeping when condition is not met.

int IG.Num.ParallelJobDispatcherBase.SleepTimeMs
getset

Sleeping time, in milliseconds, used by the current object when waiting for fulfillment of some condition in a loop that includes sleeping when condition is not met.

DefaultSleepTimeMs specifies the default value that is set when object is created.

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.CreateDispatcher().

int IG.Num.ParallelJobDispatcherBase.NumIdleJobServers
get

Gets the number of idle job servers that are currently available on the dispatcher.

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().

int IG.Num.ParallelJobDispatcherBase.NumSentJobs
get

Gets the number of sent jobs (all jobs sent to the current dispatcher for execution).

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().

int IG.Num.ParallelJobDispatcherBase.NumStartedJobs
get

Gets the number of jobs started by the dispatcher up to this point.

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().

int IG.Num.ParallelJobDispatcherBase.NumFinishedJobs
get

Gets the number of finished jobs (of those handled by the current dispatcher) up to this point.

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().

int IG.Num.ParallelJobDispatcherBase.NumAbortedJobs
get

Gets the number of aborted jobs (of those handled by the current dispatcher) up to this point.

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().

int IG.Num.ParallelJobDispatcherBase.NumUncompletedJobs
get

Gets the number of idle job runners that are currently available on the dispatcher.

Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().


The documentation for this class was generated from the following file: