|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity AllocPolicy TimeSharedWithFailure
class TimeSharedWithFailure
TimeSharedWithFailure class is based on TimeShared
, but with
added failure functionalities.
TimeSharedWithFailure class is an allocation policy for GridResource that
behaves similar to a round robin algorithm, except that all Gridlets are
executed at the same time. This is a basic and simple
scheduler that runs each Gridlet to one Processing Element (PE).
If a Gridlet requires more than one PE, then this scheduler only assign
this Gridlet to one PE.
TimeShared
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class AllocPolicy |
---|
initTime_, myId_, outputPort_, resCalendar_, resId_, resName_, resource_, totalPE_ |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
TimeSharedWithFailure(String resourceName,
String entityName)
Allocates a new TimeSharedWithFailure object |
Method Summary | |
---|---|
void |
body()
Handles internal events that are coming to this entity. |
void |
gridletCancel(int gridletId,
int userId)
Cancels a Gridlet running in this entity. |
void |
gridletMove(int gridletId,
int userId,
int destId,
boolean ack)
Moves a Gridlet from this GridResource entity to a different one. |
void |
gridletPause(int gridletId,
int userId,
boolean ack)
Pauses a Gridlet only if it is currently executing. |
void |
gridletResume(int gridletId,
int userId,
boolean ack)
Resumes a Gridlet only in the paused list. |
int |
gridletStatus(int gridletId,
int userId)
Finds the status of a specified Gridlet ID. |
void |
gridletSubmit(Gridlet gl,
boolean ack)
Schedules a new Gridlet that has been received by the GridResource entity. |
void |
setGridletsFailed()
Sets the status of all Gridlets in this resource to FAILED. |
void |
setGridletsFailed(int failedMachID)
This method is empty because it is not required by this policy. |
Methods inherited from class AllocPolicy |
---|
addTotalLoad, calculateTotalLoad, findGridlet, getTotalLoad, gridletMigrate, init, isEndSimulation, processOtherEvent, sendAck, sendCancelGridlet, sendFinishGridlet, sendInternalEvent, sendInternalEvent, setEndSimulation |
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 |
---|
TimeSharedWithFailure(String resourceName, String entityName) throws Exception
resourceName
- the GridResource entity name that will contain
this allocation policyentityName
- this object entity name
Exception
- This happens when one of the following scenarios occur:
GridSim.init(int, Calendar, boolean, String[], String[],
String)
Method Detail |
---|
public void body()
body
in class Sim_entity
public void gridletSubmit(Gridlet gl, boolean ack)
gridletSubmit
in class AllocPolicy
gl
- a Gridlet object that is going to be executedack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)ResGridlet
,
ResGridletList
public int gridletStatus(int gridletId, int userId)
gridletStatus
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridlet
Gridlet
public void gridletCancel(int gridletId, int userId)
gridletCancel
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletpublic void gridletPause(int gridletId, int userId, boolean ack)
gridletPause
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void gridletMove(int gridletId, int userId, int destId, boolean ack)
If a Gridlet has finished beforehand, then this method will send back the Gridlet to sender, i.e. the userId and sets the acknowledgment to false (if required).
gridletMove
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this GridletdestId
- a new destination GridResource ID for this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void gridletResume(int gridletId, int userId, boolean ack)
gridletResume
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletack
- an acknowledgement, i.e. true if wanted to know
whether this operation is success or not, false
otherwise (don't care)public void setGridletsFailed()
setGridletsFailed
in interface AllocPolicyWithFailure
public void setGridletsFailed(int failedMachID)
setGridletsFailed
in interface AllocPolicyWithFailure
failedMachID
- the id of the failed machine
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |