|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity GridSimCore GridSim Workload
public class Workload
The main purpose of this class is to create a realistic simulation environment where your jobs or Gridlets 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 is responsible for reading resource traces from a file and
sends Gridlets to only one destinated resource.
NOTE:
GridSim.init(int, Calendar, boolean)
Workload(String, double, double, int, String, String, int)
instead.
Link.DEFAULT_MTU
.
However, you can specify
the file size by using setGridletFileSize(int)
.
By default, this class follows the standard workload format as specified
in
http://www.cs.huji.ac.il/labs/parallel/workload/
However, you can use other format by calling the below methods before
running the simulation:
GridSim.init(int, Calendar, boolean)
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 fileName,
String resourceName,
int rating)
Create a new Workload object with the network extension. |
|
Workload(String name,
Link link,
String fileName,
String resourceName,
int rating)
Create a new Workload object with the network extension. |
|
Workload(String name,
String fileName,
String resourceName,
int rating)
Create a new Workload object without using the network extension. |
Method Summary | |
---|---|
void |
body()
Reads from a given file when the simulation starts running. |
ArrayList<Gridlet> |
getGridletList()
Gets a list of completed Gridlets |
void |
printGridletList(boolean history)
Prints the Gridlet objects |
boolean |
setComment(String comment)
Identifies the start of a comment line. |
boolean |
setField(int maxField,
int jobNum,
int submitTime,
int runTime,
int numProc)
Tells this class what to look in the trace file. |
boolean |
setGridletFileSize(int size)
Sets a Gridlet file size (in byte) for sending to/from a resource. |
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 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 |
---|
public Workload(String name, String fileName, String resourceName, int rating) throws ParameterException, Exception
name
- this entity namefileName
- the workload trace filename in one of the following
format: ASCII text, zip, gz.resourceName
- the resource namerating
- the resource's PE rating
Exception
- This happens when creating this entity before
initializing GridSim package or this entity name is
null or empty
ParameterException
- This happens for the following conditions:
public Workload(String name, double baudRate, double propDelay, int MTU, String fileName, String resourceName, int rating) throws ParameterException, Exception
name
- this entity namebaudRate
- baud rate of this link (bits/s)propDelay
- Propagation delay of the Link in milli secondsMTU
- 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.fileName
- the workload trace filename in one of the following
format: ASCII text, zip, gz.resourceName
- the resource namerating
- the resource's PE rating
Exception
- This happens when creating this entity before
initializing GridSim package or this entity name is
null or empty
ParameterException
- This happens for the following conditions:
public Workload(String name, Link link, String fileName, String resourceName, int rating) throws ParameterException, Exception
name
- this entity namelink
- the link that will be used to connect this Workload
to another entity or a Router.fileName
- the workload trace filename in one of the following
format: ASCII text, zip, gz.resourceName
- the resource namerating
- the resource's PE rating
Exception
- This happens when creating this entity before
initializing GridSim package or this entity name is
null or empty
ParameterException
- This happens for the following conditions:
Method Detail |
---|
public boolean setGridletFileSize(int size)
size
- a Gridlet file size (in byte)
public boolean setComment(String comment)
comment
- a character that denotes the start of a comment,
e.g. ";" or "#"
public boolean setField(int maxField, int jobNum, int submitTime, int runTime, int numProc)
By default, this class follows the standard workload format as specified
in
http://www.cs.huji.ac.il/labs/parallel/workload/
However, you can use other format by calling this method.
The parameters must be a positive integer number starting from 1. A special case is where jobNum == -1, meaning the job or gridlet ID starts at 1.
maxField
- max. number of field/column in one rowjobNum
- field/column number for locating the job IDsubmitTime
- field/column number for locating the job submit timerunTime
- field/column number for locating the job run timenumProc
- field/column number for locating the number of PEs
required to run a job
public ArrayList<Gridlet> getGridletList()
public void printGridletList(boolean history)
history
- true means printing each Gridlet's history,
false otherwisepublic void body()
getGridletList()
body
in class Sim_entity
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |