GridSim 5.0 beta

gridsim.parallel.util
Class Workload

Object
  extended by Thread
      extended by Sim_entity
          extended by GridSimCore
              extended by GridSim
                  extended by Workload
All Implemented Interfaces:
Cloneable, Runnable

public class Workload
extends GridSim

The main purpose of this class is to create a realistic simulation environment where your jobs are competing with others. In other words, the grid resource might not be available at certain times. In addition, the arrival time of jobs are also captured in the trace file.

This class dispatches jobs to a grid resource according to the workload model provided. That is, the workload model can generate jobs according to various distributions, or read the job information from a log file.

NOTE THAT:

Since:
5.0
Author:
Marcos Dias de Assuncao

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class GridSim
GRIDSIM_VERSION_STRING, PAUSE
 
Fields inherited from class GridSimCore
input, NETWORK_TYPE, output
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Workload(String name, double baudRate, double propDelay, int MTU, String resourceName, WorkloadModel model)
          Create a new Workload object with the network extension.
Workload(String name, Link link, String resourceName, WorkloadModel model)
          Create a new Workload object with the network extension.
Workload(String name, String resourceName, WorkloadModel model)
          Create a new Workload object without using the network extension.
 
Method Summary
 void body()
          Generates jobs according to provided model when the simulation starts.
 ArrayList<Gridlet> getGridletList()
          Gets a list of completed jobs
 
Methods inherited from class GridSim
clock, disableDebugMode, enableDebugMode, getAdvancedReservationList, getEntityId, getEntityName, getEntityName, getEntityName, getGISId, getGridInfoServiceEntityId, getGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getNetworkType, getNumFreePE, getNumFreePE, getNumPE, getNumPE, getResourceCharacteristics, getResourceDynamicInfo, getSimulationCalendar, getSimulationStartDate, getVisualizer, gridletCancel, gridletCancel, gridletMove, gridletMove, gridletPause, gridletPause, gridletReceive, gridletReceive, gridletReceive, gridletResume, gridletResume, gridletStatus, gridletStatus, gridletSubmit, gridletSubmit, gridletSubmit, gridSimHold, init, init, init, initNetworkType, isDebugModeEnabled, isResourceExist, isResourceExist, isTraceEnabled, pauseSimulation, pauseSimulation, receiveEventObject, receiveEventObject, recordStatistics, recordStatistics, recordStatistics, recordStatistics, resourceSupportAR, resourceSupportAR, resumeSimulation, setGIS, shutdownGridStatisticsEntity, shutdownUserEntity, startGridSimulation, startGridSimulation, stopGridSimulation
 
Methods inherited from class GridSimCore
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities
 
Methods inherited from class Sim_entity
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Workload

public Workload(String name,
                String resourceName,
                WorkloadModel model)
         throws Exception
Create a new Workload object without using the network extension. This means this entity directly sends jobs to a destination resource without going through a wired network.
NOTE: You can not use this constructor in an experiment that uses a wired network topology.

Parameters:
name - this entity name
resourceName - the resource name
model - the workload model to be used for generating the jobs
Throws:
Exception - this happens when creating this entity before initialising GridSim package or this entity name is null or empty
IllegalArgumentException - this happens for the following conditions:
  • the entity name is null or empty
  • the resource entity name is null or empty
Pre Condition:
name != null, resourceName != null, model != null
Post Condition:
$none

Workload

public Workload(String name,
                double baudRate,
                double propDelay,
                int MTU,
                String resourceName,
                WorkloadModel model)
         throws Exception
Create a new Workload object with the network extension. This means this entity directly sends jobs to a destination resource through a link. The link is automatically created by this constructor.

Parameters:
name - this entity name
baudRate - baud rate of this link (bits/s)
propDelay - Propagation delay of the Link in milli seconds
MTU - Maximum Transmission Unit of the Link in bytes. Packets which are larger than the MTU should be split up into MTU size units. For example, a 1024 byte packet trying to cross a 576 byte MTU link should get split into 2 packets of 576 bytes and 448 bytes.
resourceName - the resource name
model - the workload model to be used for generating the jobs
Throws:
Exception - this happens when creating this entity before initialising GridSim package or this entity name is null or empty
IllegalArgumentException - this happens for the following conditions:
  • the entity name is null or empty
  • baudRate <= 0
  • propDelay <= 0
  • MTU <= 0
  • the resource entity name is null or empty
Pre Condition:
name != null, baudRate > 0, propDelay > 0, MTU > 0, resourceName != null, model != null
Post Condition:
$none

Workload

public Workload(String name,
                Link link,
                String resourceName,
                WorkloadModel model)
         throws Exception
Create a new Workload object with the network extension. This means this entity directly sends jobs to a destination resource through a link. The link is automatically created by this constructor.

Parameters:
name - this entity name
link - the link that will be used to connect this Workload to another entity or a Router.
resourceName - the resource name
model - the workload model to be used for generating the jobs
Throws:
Exception - this happens when creating this entity before initialising GridSim package or this entity name is null or empty
IllegalArgumentException - this happens for the following conditions:
  • the entity name is null or empty
  • the link is empty
  • the resource entity name is null or empty
Pre Condition:
name != null, link != null, resourceName != null, model != null
Post Condition:
$none
Method Detail

body

public void body()
Generates jobs according to provided model when the simulation starts. Then submits jobs to a resource and collects them before exiting. To collect the completed Gridlets, use getGridletList()

Overrides:
body in class Sim_entity

getGridletList

public ArrayList<Gridlet> getGridletList()
Gets a list of completed jobs

Returns:
a list of jobs
Throws:
IllegalStateException - if this method is invoked before the simulation completes

GridSim 5.0 beta

The University of Melbourne, Australia, 2009