IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
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...
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 |
Base class for parallel job dispatchers. Accepts job requests and dispatches jobs to parallel job servers when available and redy to run a job.
DataContainerType | Type 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;
|
inlinestaticprotected |
Returns another ID that is unique for objects of the containing class its and derived classes.
References IG.Num.ParallelJobContainerBase.LockId.
|
inlineprotected |
Resets number of idle job servers to 0.
|
inline |
Increments by one the number of sent jobs (all jobs sent to the current dispatcher for execution).
|
inline |
Increments by one the number of started by the dispatcher up to this point.
|
inline |
Increments by one the number of finished jobs (of those handled by the current dispatcher) up to this point.
|
inline |
Increments by one the number of aborted jobs (of those handled by the current dispatcher) up to this point.
|
private |
|
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.
|
protected |
Output level for objects of this class.
Specifies how much output is printed to console during operation.
|
protected |
|
staticprivate |
|
private |
|
staticprivate |
|
protected |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
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.
|
staticgetset |
Default output level for objects of this and derived types.
Just aliases the ParallelJobContainerBase.DefaultOutputLevel.
|
getset |
Output level the current object.
Specifies how much output is printed to console during operation.
|
staticgetset |
Default value of test mode flag.
Just aliases the ParallelJobContainerBase.DefaultOutputLevel.
|
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.
|
get |
Unique ID for objects of the currnet and derived classes.
|
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.
|
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().
|
get |
Gets the number of idle job servers that are currently available on the dispatcher.
Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().
|
get |
Gets the number of sent jobs (all jobs sent to the current dispatcher for execution).
Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().
|
get |
Gets the number of jobs started by the dispatcher up to this point.
Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().
|
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().
|
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().
|
get |
Gets the number of idle job runners that are currently available on the dispatcher.
Referenced by IG.Num.ParallelJobContainerGen< InputType, ResultType >.TestPerformance().