|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Gridlet
public class Gridlet
A Gridlet is a package that contains all the information related to the job and its execution management details such as job length expressed in MI (Millions Instruction), the size of input and output files, and the job owner id. Individual users model their application by creating Gridlets for processing them on Grid resources.
These basic parameters help in determining execution time, the time required to transport input and output files between users and remote resources, and returning the processed Gridlets back to the originator along with the results.
For a Gridlet that requires many Processing Elements (PEs) or CPUs,
the gridlet length is calculated only for 1 PE for simplicity.
For example, this Gridlet has a length of 500 MI and requires 2 PEs.
This means each PE will execute 500 MI of this Gridlet.
From GridSim 3.1, we have also added a classType attribute which can be used to provide differentiated service to scheduling gridlets on a resource. The higher the classType means the higher the priority of scheduling this Gridlet on the resource. However, it is up to the resource's allocation policy to schedule gridlets based on their priority or not.
By default, this object records a history of every activity, such as
when this Gridlet is being put into a queue, and
when it is being executed by a resource.
You can find the history by using getGridletHistory()
.
However, this approach requires a significant amount of memory if you have
many Gridlet objects. To disable this functionality, use
Gridlet(int, double, long, long, boolean)
constructor instead.
Field Summary | |
---|---|
static int |
CANCELED
The Gridlet has been canceled. |
static int |
CREATED
The Gridlet has been created and added to the GridletList object |
static int |
FAILED
The Gridlet is failed |
static int |
FAILED_RESOURCE_UNAVAILABLE
The gridlet has failed due to a resource failure |
static int |
INEXEC
The Gridlet is in execution in a Grid node |
static int |
PAUSED
The Gridlet has been paused. |
static int |
QUEUED
The Gridlet has moved to a Grid node |
static int |
READY
The Gridlet has been assigned to a GridResource object as planned |
static int |
RESUMED
The Gridlet has been resumed from PAUSED state. |
static int |
SUCCESS
The Gridlet has been executed successfully |
Constructor Summary | |
---|---|
Gridlet(int gridletID,
double gridletLength,
long gridletFileSize,
long gridletOutputSize)
Allocates a new Gridlet object. |
|
Gridlet(int gridletID,
double gridletLength,
long gridletFileSize,
long gridletOutputSize,
boolean record)
Allocates a new Gridlet object. |
|
Gridlet(int gridletID,
double gridletLength,
long gridletFileSize,
long gridletOutputSize,
int classType)
Allocates a new Gridlet object. |
Method Summary | |
---|---|
double |
getActualCPUTime()
Gets the total execution time of this Gridlet from the latest GridResource |
double |
getActualCPUTime(int resId)
Gets the total execution time of this Gridlet in a given GridResource ID |
int[] |
getAllResourceID()
Gets all the GridResource IDs that executed this Gridlet |
String[] |
getAllResourceName()
Gets all the GridResource names that executed this Gridlet |
int |
getClassType()
Gets the classtype or priority of this Gridlet for scheduling on a resource. |
double |
getCostPerSec()
Gets the cost running this Gridlet in the latest GridResource |
double |
getCostPerSec(int resId)
Gets the cost running this Gridlet in a given GridResource ID |
double |
getExecStartTime()
Gets the latest execution start time |
double |
getFinishTime()
Gets the finish time of this Gridlet in a GridResource |
long |
getGridletFileSize()
Gets the input file size of this Gridlet BEFORE submitting to a GridResource |
double |
getGridletFinishedSoFar()
Gets the length of this Gridlet that has been executed so far from the latest GridResource. |
double |
getGridletFinishedSoFar(int resId)
Gets the length of this Gridlet that has been executed so far in a given GridResource ID. |
String |
getGridletHistory()
Gets the history of this Gridlet. |
int |
getGridletID()
Gets the Gridlet ID |
double |
getGridletLength()
Gets the length of this Gridlet |
long |
getGridletOutputSize()
Gets the output size of this Gridlet AFTER submitting and executing to a GridResource |
int |
getGridletStatus()
Gets the status code of this Gridlet |
String |
getGridletStatusString()
Gets the string representation of the current Gridlet status code |
int |
getNetServiceLevel()
Gets the network service level for sending this gridlet over a network |
int |
getNumPE()
Gets the number of PEs required to run this Gridlet |
double |
getProcessingCost()
Gets the total cost of processing or executing this Gridlet Processing Cost = actual CPU Time * cost per sec |
int |
getReservationID()
Gets the reservation ID that owns this Gridlet |
int |
getResourceID()
Gets the latest resource ID that processes this Gridlet |
String |
getResourceName(int resId)
Gets the GridResource name based on its ID |
static String |
getStatusString(int status)
Gets the string representation of the given Gridlet status code |
double |
getSubmissionTime()
Gets the submission or arrival time of this Gridlet from the latest GridResource |
double |
getSubmissionTime(int resId)
Gets the submission or arrival time of this Gridlet in the given GridResource ID |
int |
getUserID()
Gets the user or owner ID of this Gridlet |
double |
getWaitingTime()
Gets the waiting time of this gridlet executed on a resource |
double |
getWallClockTime()
Gets the time of this Gridlet resides in the latest GridResource (from arrival time until departure time). |
double |
getWallClockTime(int resId)
Gets the time of this Gridlet resides in a given GridResource ID (from arrival time until departure time). |
boolean |
hasReserved()
Checks whether this Gridlet is submitted by reserving or not. |
boolean |
isFinished()
Checks whether this Gridlet has finished execution or not |
boolean |
setClassType(int classType)
Sets the classType or priority of this Gridlet for scheduling on a resource. |
void |
setExecParam(double wallTime,
double actualTime)
Sets this Gridlet's execution parameters. |
void |
setExecStartTime(double clockTime)
Sets the execution start time of this Gridlet inside a GridResource. |
void |
setGridletFinishedSoFar(double length)
Sets the length of this Gridlet that has been executed so far. |
boolean |
setGridletLength(double gridletLength)
Sets the length or size (in MI) of this Gridlet to be executed in a GridResource. |
void |
setGridletStatus(int newStatus)
Sets the status code of this Gridlet |
boolean |
setNetServiceLevel(int netServiceLevel)
Sets the network service level for sending this gridlet over a network |
boolean |
setNumPE(int numPE)
Sets the number of PEs required to run this Gridlet. |
boolean |
setReservationID(int resId)
Sets the id of the reservation made for this gridlet |
void |
setResourceParameter(int resourceID,
double cost)
Sets the resource parameters for which this Gridlet is going to be executed. |
void |
setSubmissionTime(double clockTime)
Sets the submission or arrival time of this Gridlet into a GridResource |
void |
setUserID(int id)
Sets the user or owner ID of this Gridlet. |
protected void |
write(String str)
Writes this particular history transaction of this Gridlet into a log |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CREATED
public static final int READY
public static final int QUEUED
public static final int INEXEC
public static final int SUCCESS
public static final int FAILED
public static final int CANCELED
public static final int PAUSED
public static final int RESUMED
public static final int FAILED_RESOURCE_UNAVAILABLE
Constructor Detail |
---|
public Gridlet(int gridletID, double gridletLength, long gridletFileSize, long gridletOutputSize, int classType)
gridletID
- the unique ID of this GridletgridletLength
- the length or size (in MI) of this Gridlet
to be executed in a GridResourcegridletFileSize
- the file size (in byte) of this Gridlet
BEFORE submitting to a GridResourcegridletOutputSize
- the file size (in byte) of this Gridlet
AFTER finish executing by
a GridResourceclassType
- Sets the class type or priority of this
gridlet for scheduling on a resource.public Gridlet(int gridletID, double gridletLength, long gridletFileSize, long gridletOutputSize, boolean record)
gridletID
- the unique ID of this GridletgridletLength
- the length or size (in MI) of this Gridlet
to be executed in a GridResourcegridletFileSize
- the file size (in byte) of this Gridlet
BEFORE submitting to a GridResourcegridletOutputSize
- the file size (in byte) of this Gridlet
AFTER finish executing by
a GridResourcerecord
- record the history of this object or notpublic Gridlet(int gridletID, double gridletLength, long gridletFileSize, long gridletOutputSize)
gridletID
- the unique ID of this GridletgridletLength
- the length or size (in MI) of this Gridlet
to be executed in a GridResourcegridletFileSize
- the file size (in byte) of this Gridlet
BEFORE submitting to a GridResourcegridletOutputSize
- the file size (in byte) of this Gridlet
AFTER finish executing by
a GridResourceMethod Detail |
---|
public boolean setReservationID(int resId)
resId
- the reservation ID
public int getReservationID()
public boolean hasReserved()
public boolean setGridletLength(double gridletLength)
gridletLength
- the length or size (in MI) of this Gridlet
to be executed in a GridResource
public boolean setNetServiceLevel(int netServiceLevel)
netServiceLevel
- determines the kind of service this gridlet
receives in the network (applicable to
selected PacketScheduler class only)
true
if successful.public int getNetServiceLevel()
public double getWaitingTime()
public boolean setClassType(int classType)
classType
- classType of this Gridlet
public int getClassType()
public boolean setNumPE(int numPE)
numPE
- number of PE
public int getNumPE()
public String getGridletHistory()
public double getGridletFinishedSoFar()
public boolean isFinished()
public void setGridletFinishedSoFar(double length)
length
- length of this GridletAllocPolicy
,
ResGridlet
public int getGridletID()
public void setUserID(int id)
id
- the user IDpublic int getUserID()
public int getResourceID()
public long getGridletFileSize()
public long getGridletOutputSize()
public void setResourceParameter(int resourceID, double cost)
resourceID
- the GridResource IDcost
- the cost running this GridResource per secondpublic void setSubmissionTime(double clockTime)
clockTime
- the submission timepublic double getSubmissionTime()
public void setExecStartTime(double clockTime)
clockTime
- the latest execution start timepublic double getExecStartTime()
public void setExecParam(double wallTime, double actualTime)
wallTime
- the time of this Gridlet resides in
a GridResource (from arrival time until
departure time).actualTime
- the total execution time of this Gridlet in a
GridResource.public void setGridletStatus(int newStatus) throws Exception
newStatus
- the status code of this Gridlet
Exception
- Invalid range of Gridlet statuspublic int getGridletStatus()
public String getGridletStatusString()
public static String getStatusString(int status)
status
- the Gridlet status code
public double getGridletLength()
public double getActualCPUTime()
public double getCostPerSec()
public double getProcessingCost()
getActualCPUTime()
,
getCostPerSec()
public double getWallClockTime()
public String[] getAllResourceName()
public int[] getAllResourceID()
public double getActualCPUTime(int resId)
resId
- a GridResource entity ID
public double getCostPerSec(int resId)
resId
- a GridResource entity ID
public double getGridletFinishedSoFar(int resId)
resId
- a GridResource entity ID
public double getSubmissionTime(int resId)
resId
- a GridResource entity ID
public double getWallClockTime(int resId)
resId
- a GridResource entity ID
public String getResourceName(int resId)
resId
- a GridResource entity ID
public double getFinishTime()
protected void write(String str)
str
- a history transaction of this Gridlet
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |