Class JobManager

java.lang.Object
   |
   +----JobManager

public class JobManager
extends Object
implements EventDestination
Implements a job manager. All interaction with jobs and tasks should go through an instance of this class.

See Also:
Job, Task

Constructor Index

 o JobManager(TheSimulator)
Constructs a job manager.

Method Index

 o endedJobs()
Returns an array with global job identifier for ended jobs, managed by this object.
 o generateJob(int, float, int, int, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, ProbabilityDistribution, float, float, String)
Generates a job and adds it to this object.
 o getJob(int)
Returns the sought job.
 o getJobExecutionTime(int)
Returns the execution time for the given job.
 o getPEId(long)
Returns the identifier for the processing element which the given task is located on.
 o getSimulator()
Returns the simulator.
 o getTask(long)
Returns the sought task.
 o getTaskStatistics(int)
Returns statistics for the given task.
 o getThroughput(int, int)
Returns the throughput.
 o handleEvent(SimEvent)
Handles incoming events.
 o jobClass(int)
Returns the job class defined by the user.
 o jobEnded(int)
Called by an ended job.
 o jobs()
Returns an array with global job identifiers for all jobs managed by this object.
 o jobsWithLeastTasks()
Returns an array with global job identifiers for jobs, managed by this object, with least number of tasks.
 o jobsWithLeastTasks(int)
Returns an array with global job identifiers for jobs, managed by this object, with least number of tasks in the given state.
 o jobsWithMostTasks()
Returns an array with global job identifiers for jobs, managed by this object, with most number of tasks.
 o jobsWithMostTasks(int)
Returns an array with global job identifiers for jobs, managed by this object, with most number of tasks in the given state.
 o numberOfJobs()
Returns the number of jobs managed by this object.
 o numberOfLivingTasks()
Returns the total number of living tasks, contained by jobs managed by this object.
 o numberOfTasks()
Returns the total number of tasks, contained by jobs managed by this object.
 o numberOfTasks(int)
Returns the number of tasks in the given state, contained by jobs managed by this object.
 o numberOfTasksInJob(int)
Returns the number of tasks contained by the given job.
 o numberOfTasksInJob(int, int)
Returns the number of tasks in the given state, contained by the given job.
 o numberOfTasksInJobOnPE(int, int)
Returns the number of tasks on the given processing element, contained by the given job.
 o numberOfTasksInJobOnPE(int, int, int)
Returns the number of tasks on the given processing element in the given state, contained by the given job.
 o numberOfTasksOnPE(int)
Returns the number of task on the given processing element.
 o numberOfTasksOnPE(int, int)
Returns the number of task on the given processing element in the given state.
 o tasks()
Returns an array with global task identifiers for tasks, contained by jobs managed by this object.
 o tasks(int)
Returns an array with global task identifiers for tasks in the given state, contained by jobs managed by this object.
 o tasksInJob(int)
Returns an array with global task identifiers for tasks contained by the given job.
 o tasksInJob(int, int)
Returns an array with global task identifiers for tasks in the given state, contained by the given job.
 o tasksInJobOnPE(int, int)
Returns an array with global task identifiers for all tasks on the given processing element, contained by the given job.
 o tasksInJobOnPE(int, int, int)
Returns an array with global task identifiers for all tasks on the given processing element in the given state, contained by the given job.
 o tasksOnPE(int)
Returns an array with global task identifiers for all tasks on the given processing element, contained by jobs managed 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 jobs managed by this object.

Constructors

 o JobManager
 public JobManager(TheSimulator simulator)
Constructs a job manager.

Parameters:
simulator - a simulator.

Methods

 o getSimulator
 public TheSimulator getSimulator()
Returns the simulator.

Returns:
the simulator.
 o generateJob
 public void generateJob(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)
Generates a job and adds it to this object.

Parameters:
numberOfTasks - initial number of tasks.
startTime - start time of job.
peId - processing element identifier.
endDist - end task distribution.
spawnDist - task spawning distribution.
spawnSizeDist - task spawning size distribution.
ioDist - task I/O distribution.
ioDurationDist - task I/O duration distribution.
commDist - task communication distribution.
laxityDist - tasx laxity distribution
syncProb - probability for communication being synchronization.
globalSyncProb - probability for synchronization being global.
See Also:
Job
 o numberOfJobs
 public int numberOfJobs()
Returns the number of jobs managed by this object.

Returns:
the number of jobs managed by this object.
 o jobs
 public int[] jobs()
Returns an array with global job identifiers for all jobs managed by this object.

Returns:
an array with global job identifiers for all jobs managed by this object.
See Also:
Job
 o endedJobs
 public int[] endedJobs()
Returns an array with global job identifier for ended jobs, managed by this object.

Returns:
an array with global job identifier for ended jobs, managed by this object.
 o jobsWithLeastTasks
 public int[] jobsWithLeastTasks()
Returns an array with global job identifiers for jobs, managed by this object, with least number of tasks.

Returns:
an array with global job identifiers for jobs, managed by this object, with least number of tasks.
See Also:
Job, Task
 o jobsWithMostTasks
 public int[] jobsWithMostTasks()
Returns an array with global job identifiers for jobs, managed by this object, with most number of tasks.

Returns:
an array with global job identifiers for jobs, managed by this object, with most number of tasks.
See Also:
Job, Task
 o jobsWithLeastTasks
 public int[] jobsWithLeastTasks(int taskState)
Returns an array with global job identifiers for jobs, managed by this object, with least number of tasks in the given state.

Parameters:
taskState - a task state.
Returns:
an array with global job identifiers for jobs, managed by this object, with least number of tasks in the given state.
See Also:
Job, Task
 o jobsWithMostTasks
 public int[] jobsWithMostTasks(int taskState)
Returns an array with global job identifiers for jobs, managed by this object, with most number of tasks in the given state.

Parameters:
taskState - a task state.
Returns:
an array with global job identifiers for jobs, managed by this object, with most number of tasks in the given state.
See Also:
Job, Task
 o numberOfTasks
 public int numberOfTasks()
Returns the total number of tasks, contained by jobs managed by this object.

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

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

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

Parameters:
peId - a processing element identifier.
Returns:
the number of task on the given processing element.
 o numberOfTasksOnPE
 public int numberOfTasksOnPE(int peId,
                              int taskState)
Returns the number of task on the given processing element in the given state.

Parameters:
peId - a processing element identifier.
taskState - a task state.
Returns:
the number of task on the given processing element.
 o numberOfTasksInJob
 public int numberOfTasksInJob(int jobId)
Returns the number of tasks contained by the given job.

Parameters:
jobId - a global job identifier.
Returns:
the number of tasks contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o jobClass
 public String jobClass(int jobId)
Returns the job class defined by the user.

Parameters:
jobId - a global job identifier.
Returns:
a string provided by the user describing the job classification.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o numberOfTasksInJob
 public int numberOfTasksInJob(int jobId,
                               int taskState)
Returns the number of tasks in the given state, contained by the given job.

Parameters:
jobId - a global job identifier.
taskState - a task state.
Returns:
the number of tasks in the given state, contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o numberOfTasksInJobOnPE
 public int numberOfTasksInJobOnPE(int jobId,
                                   int peId)
Returns the number of tasks on the given processing element, contained by the given job.

Parameters:
jobId - a global job identifier.
peId - a processing element identifier.
Returns:
the number of tasks on the given processing element, contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o numberOfTasksInJobOnPE
 public int numberOfTasksInJobOnPE(int jobId,
                                   int peId,
                                   int taskState)
Returns the number of tasks on the given processing element in the given state, contained by the given job.

Parameters:
jobId - a global job identifier.
peId - a processing element identifier.
taskState - a task state.
Returns:
the number of tasks on the given processing element in the given state, contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o tasks
 public long[] tasks()
Returns an array with global task identifiers for tasks, contained by jobs managed by this object.

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

Parameters:
taskState - a task state.
Returns:
an array with global task identifiers for tasks in the given state, contained by jobs managed by this object.
See Also:
Job, 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 jobs managed 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 jobs managed 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 jobs managed by this object.

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

Parameters:
jobId - a global job identifier.
Returns:
an array with global task identifiers for tasks contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o tasksInJob
 public long[] tasksInJob(int jobId,
                          int taskState)
Returns an array with global task identifiers for tasks in the given state, contained by the given job.

Parameters:
jobId - a global job identifier.
taskState - a task state.
Returns:
an array with global task identifiers for tasks in the given state, contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Job, Task
 o tasksInJobOnPE
 public long[] tasksInJobOnPE(int jobId,
                              int peId)
Returns an array with global task identifiers for all tasks on the given processing element, contained by the given job.

Parameters:
jobId - a global job identifier.
peId - a processing element identifier.
Returns:
an array with global task identifiers for all tasks on the given processing element, contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Task
 o tasksInJobOnPE
 public long[] tasksInJobOnPE(int jobId,
                              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 the given job.

Parameters:
jobId - a global job identifier.
peId - a processing element identifier.
taskState - a task state.
Returns:
an array with global task identifiers for all tasks on the given processing element in the given state, contained by the given job.
Throws: IllegalArgumentException
if the given job is not managed by this object.
See Also:
Task
 o getPEId
 public int getPEId(long taskId)
Returns the identifier for the processing element which the given task is located on.

Parameters:
taskId - global task identifier.
Returns:
the identifier for the processing element which the given task is located on.
 o getJobExecutionTime
 public float getJobExecutionTime(int jobId)
Returns the execution time for the given job.

Parameters:
jobId - global job identifier.
Returns:
the execution time for the given job.
 o getThroughput
 public int getThroughput(int start,
                          int end)
Returns the throughput.

Parameters:
start - start of time interval.
end - end of time interval.
Returns:
the throughput.
 o getTaskStatistics
 public TaskStatistics getTaskStatistics(int taskId)
Returns statistics for the given task.

Parameters:
taskId - global task identifier.
Returns:
statistics for the given task.
 o handleEvent
 public void handleEvent(SimEvent event)
Handles incoming events.

Parameters:
event - incoming event.
 o jobEnded
 protected void jobEnded(int jobId)
Called by an ended job.

Parameters:
jobId - global job indetifier of ended job.
 o getJob
 protected Job getJob(int jobId)
Returns the sought job.

Parameters:
jobId - global job identifier for sought job.
Returns:
the sought job.
 o getTask
 public Task getTask(long taskId)
Returns the sought task.

Parameters:
taskId - global task identifier for sought task.
Returns:
the sought task.