Class Job

java.lang.Object
   |
   +----Job

public class Job
extends Object
Implements a job. A unique number, called the global job identifier, is associated with each job.

See Also:
JobManager, Task

Constructor Index

 o Job(JobManager, int, int, float, int, int, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, float, float, String)
Constructs a job.

Method Index

 o generateTask(float, int, float)
Generates a task and adds it to this job.
 o generateTasks(int, float, int, float)
Generates the given number of tasks and adds them to this job.
 o getExecutionTime()
Returns the total execution time of the job.
 o getId()
Returns the global job identifier for this object.
 o getJobType()
 o getManager()
Returns the manager of this job.
 o getSimulator()
Returns the simulator that this object belongs to.
 o getTask(long)
Returns the sought task.
 o hasEnded()
Tests if the job has ended.
 o initiateGlobalSynchronization(Task)
Initiates global synchronization.
 o initiateLocalSynchronization(Task)
Initiates local synchronization.
 o isContainedWithin(int, int)
Specifies whether or not the execution of this job is completely contained within the given interval of time.
 o jobClass()
Returns the user-defined class of the job.
 o numberOfLivingTasks()
Returns the number of living tasks contained by this object.
 o numberOfTasks()
Returns the number of tasks contained by this object.
 o numberOfTasks(int)
Returns the number of tasks in the given state, contained by this object.
 o numberOfTasksOnPE(int)
Returns the number of tasks on the given processing element, contained by this object.
 o numberOfTasksOnPE(int, int)
Returns the number of tasks on the given processing element in the given state, contained by this object.
 o numberOfTasksSpinning()
Returns the number of tasks spinning, contained by this object.
 o numberOfTasksSpinSync()
Returns the number of tasks spinning due to synchronization, contained by this object.
 o randomTask(Task)
Returns a randomly chosen task.
 o randomTasks(float, Task)
Returns an array of randomly chosen tasks.
 o synchronizationRequested(Task)
Tests if a synchronization has been requested for the given task.
 o synchronize(Task)
Notifies this job that a tasks synchronizes.
 o taskEnded(Task, float)
Called by an ended task.
 o tasks()
Returns an array with global task identifiers for all tasks contained by this object.
 o tasks(int)
Returns an array with global task identifiers for all tasks in the given state, contained by this object.
 o tasksOnPE(int)
Returns an array with global task identifiers for all tasks on the given processing element, contained by this object.
 o tasksOnPE(int, int)
Returns an array with global task identifiers for all tasks on the given processing element in the given state, contained by this object.
 o toString()
Returns a string representation of this object.

Constructors

 o Job
 public Job(JobManager manager,
            int id,
            int numberOfTasks,
            float startTime,
            int peId,
            int jobTypeId,
            ProbabilityDistribution endDist,
            ProbabilityDistribution spawnDist,
            ProbabilityDistribution spawnSizeDist,
            ProbabilityDistribution ioDist,
            ProbabilityDistribution ioDurationDist,
            ProbabilityDistribution commDist,
            ProbabilityDistribution laxityDist,
            float syncProb,
            float globalSyncProb,
            String jClass)
Constructs a job.

Parameters:
manager - manager for this job.
id - global job identifier.
numberOfTasks - initial number of tasks.
startTime - start time of job.
peId - processing element identifier.
endDist - end task distribution.
spawnDist - task spawning distribution.
spawnSizeDist - distribution for task spawning size.
ioDist - task I/O distribution.
ioDurationDist - task I/O duration distribution.
commDist - task communication distribution.
syncProb - probability for communication being synchronization.
laxityDist - deadline laxity distribution
globalSyncProb - probability for synchronization being global.

Methods

 o getManager
 protected JobManager getManager()
Returns the manager of this job.

Returns:
the manager of this job.
 o getSimulator
 protected TheSimulator getSimulator()
Returns the simulator that this object belongs to.

Returns:
the simulator that this object belongs to.
 o getId
 public int getId()
Returns the global job identifier for this object.

Returns:
the global job identifier for this object.
 o numberOfTasks
 public int numberOfTasks()
Returns the number of tasks contained by this object.

Returns:
the number of tasks contained by this object.
See Also:
Task
 o numberOfLivingTasks
 public int numberOfLivingTasks()
Returns the number of living tasks contained by this object.

Returns:
the number of living tasks contained by this object.
See Also:
Task
 o numberOfTasks
 public int numberOfTasks(int taskState)
Returns the number of tasks in the given state, contained by this object.

Parameters:
state - a task state.
Returns:
the number of tasks in the given state, contained by this object.
See Also:
Task
 o numberOfTasksSpinning
 public int numberOfTasksSpinning()
Returns the number of tasks spinning, contained by this object.

Returns:
the number of tasks spinning, contained by this object.
See Also:
Task
 o numberOfTasksSpinSync
 public int numberOfTasksSpinSync()
Returns the number of tasks spinning due to synchronization, contained by this object.

Returns:
the number of tasks spinning due to synchronization, contained by this object.
See Also:
Task
 o numberOfTasksOnPE
 public int numberOfTasksOnPE(int peId)
Returns the number of tasks on the given processing element, contained by this object.

Parameters:
peId - a processing element identifier.
Returns:
the number of tasks on the given proecssing element, contained by this object.
See Also:
Task
 o numberOfTasksOnPE
 public int numberOfTasksOnPE(int peId,
                              int taskState)
Returns the number of tasks on the given processing element in the given state, contained by this object.

Parameters:
peId - a processing element identifier.
taskState - a task state.
Returns:
the number of tasks on the given proecssing element, contained by this object.
See Also:
Task
 o tasks
 public long[] tasks()
Returns an array with global task identifiers for all tasks contained by this object.

Returns:
an array with global task identifiers for all tasks contained by this object.
See Also:
Task
 o tasks
 public long[] tasks(int taskState)
Returns an array with global task identifiers for all tasks in the given state, contained by this object.

Parameters:
taskState - a task state.
Returns:
an array with global task identifiers for all tasks in the given state, contained by this object.
See Also:
Task
 o tasksOnPE
 public long[] tasksOnPE(int peId)
Returns an array with global task identifiers for all tasks on the given processing element, contained by this object.

Parameters:
peId - a processing element identifier.
Returns:
an array with global task identifiers for all tasks on the given processing element, contained by this object.
See Also:
Task
 o tasksOnPE
 public long[] tasksOnPE(int peId,
                         int taskState)
Returns an array with global task identifiers for all tasks on the given processing element in the given state, contained by this object.

Parameters:
peId - a processing element identifier.
Returns:
an array with global task identifiers for all tasks on the given processing element in the given state, contained by this object.
See Also:
Task
 o generateTask
 public void generateTask(float time,
                          int peId,
                          float endTimeJob)
Generates a task and adds it to this job.

Parameters:
time - global time.
peId - identifier for processing element to put task in.
 o generateTasks
 public void generateTasks(int n,
                           float time,
                           int peId,
                           float endTimeJob)
Generates the given number of tasks and adds them to this job.

Parameters:
n - number of tasks.
time - global time.
peId - identifier for processing element to put tasks in.
 o getTask
 protected Task getTask(long taskId)
Returns the sought task.

Parameters:
taskId - global task identifier for sought task.
Returns:
the sought task.
 o randomTasks
 protected Task[] randomTasks(float fract,
                              Task excluded)
Returns an array of randomly chosen tasks.

Parameters:
fract - fraction of living tasks to choose.
excluded - task to exclude from selection.
Returns:
an array of randomly chosen tasks.
 o randomTask
 protected Task randomTask(Task excluded)
Returns a randomly chosen task.

Parameters:
excluded - task to exclude from selection.
Returns:
a randomly chosen task.
 o taskEnded
 protected void taskEnded(Task task,
                          float taskEndTime)
Called by an ended task.

Parameters:
task - ended task.
taskEndTime - time when task ended.
 o hasEnded
 public boolean hasEnded()
Tests if the job has ended.

Returns:
true if there are no living tasks left in this job; false otherwise.
 o getExecutionTime
 public float getExecutionTime()
Returns the total execution time of the job.

Returns:
the total execution time of the job.
 o getJobType
 public int getJobType()
 o jobClass
 public String jobClass()
Returns the user-defined class of the job.

Returns:
the user-defined class of the job.
 o isContainedWithin
 protected boolean isContainedWithin(int start,
                                     int end)
Specifies whether or not the execution of this job is completely contained within the given interval of time.

Parameters:
start - start of time interval.
end - end of time interval.
Returns:
true if the execution of this job is completely contained within the given interval of time; false otherwise.
 o toString
 public String toString()
Returns a string representation of this object.

Returns:
a string representation of this object.
Overrides:
toString in class Object
 o synchronizationRequested
 protected boolean synchronizationRequested(Task task)
Tests if a synchronization has been requested for the given task.

Parameters:
task - a task.
Returns:
true if the given task is expected to synchronize; false otherwise.
 o synchronize
 protected void synchronize(Task task)
Notifies this job that a tasks synchronizes.

Parameters:
task - synchronizing task.
 o initiateGlobalSynchronization
 protected boolean initiateGlobalSynchronization(Task task)
Initiates global synchronization.

Parameters:
task - initiating task.
Returns:
true if synchronization could be initiated; false otherwise.
 o initiateLocalSynchronization
 protected boolean initiateLocalSynchronization(Task task)
Initiates local synchronization.

Parameters:
task - initiating task.
Returns:
true if synchronization could be initiated; false otherwise.