|
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 AggressiveBackfill
public class AggressiveBackfill
This class is an allocation strategy for ParallelResource
that implements aggressive backfilling (EASY). The policy is based on the
aggressive backfilling algorithm described in the following paper:
NOTE THAT:
WorkloadLublin99
.
GridSim
,
ResourceCharacteristics
,
AllocPolicy
,
PERange
,
PERangeList
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected ResourceDynamics |
dynamics
|
protected Comparator<SSGridlet> |
jobOrder
|
protected SSGridlet |
pivot
|
protected SingleProfile |
profile
|
protected int |
ratingPE
|
protected SSGridletList |
runningJobs
|
protected static int |
UPT_SCHEDULE
|
protected SSGridletList |
waitingJobs
|
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 | |
---|---|
AggressiveBackfill(String resourceName,
String entityName)
Allocates a new AggressiveBackfill object |
Method Summary | |
---|---|
protected int |
backfillGridlets()
This method backfills/starts gridlets that are in the queue |
void |
body()
Handles internal events that come to this entity. |
protected long |
forecastExecutionTime(double availableRating,
double length)
Forecast finish time of a Gridlet. Finish time = length / available rating |
void |
gridletCancel(int gridletId,
int userId)
Cancels a job running or in the waiting queue. |
protected void |
gridletFinish(SSGridlet sgl,
int status)
Updates the Gridlet's properties, such as status once a Gridlet is considered finished. |
void |
gridletMove(int gridletId,
int userId,
int destId,
boolean ack)
An abstract method that moves a Gridlet to another GridResource entity. |
void |
gridletPause(int gridletId,
int userId,
boolean ack)
An abstract method that pauses a Gridlet during an execution. |
void |
gridletResume(int gridletId,
int userId,
boolean ack)
An abstract method that resumes a previously paused Gridlet. |
int |
gridletStatus(int gridletId,
int userId)
Finds the status of a specified job. |
void |
gridletSubmit(Gridlet gridlet,
boolean ack)
Schedules/adds to the queue a new job received by the resource entity. |
boolean |
setJobOrderingHeuristic(Comparator<SSGridlet> comparator)
Sets the heuristic used to order the jobs considered for backfilling or when a cancellation takes place |
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 |
Field Detail |
---|
protected SSGridletList waitingJobs
protected SSGridletList runningJobs
protected SingleProfile profile
protected int ratingPE
protected Comparator<SSGridlet> jobOrder
protected ResourceDynamics dynamics
protected SSGridlet pivot
protected static final int UPT_SCHEDULE
Constructor Detail |
---|
public AggressiveBackfill(String resourceName, String entityName) throws Exception
AggressiveBackfill
object
resourceName
- the resource entity name that will
contain this allocation policyentityName
- this object entity name
Exception
- This happens when one of the following scenarios occur:
null
or empty
zero
number of PEs (Processing
Elements). Method Detail |
---|
public void body()
body
in class Sim_entity
public boolean setJobOrderingHeuristic(Comparator<SSGridlet> comparator)
comparator
- a comparator implementation.
true
if the heuristic was set correctly.public void gridletSubmit(Gridlet gridlet, boolean ack)
gridletSubmit
in class AllocPolicy
gridlet
- a Gridlet object to be executedack
- an acknowledgement, i.e. true
if wanted to know
whether this operation is successful or not;
false
otherwise (don't care)ResGridlet
,
ResGridletList
public void gridletCancel(int gridletId, int userId)
null
job will be send back to sender.
gridletCancel
in class AllocPolicy
gridletId
- a job IDuserId
- the user or owner's ID of this jobpublic int gridletStatus(int gridletId, int userId)
gridletStatus
in class AllocPolicy
gridletId
- a job IDuserId
- the user or owner's ID of this job
-1
if not foundGridlet
public void gridletMove(int gridletId, int userId, int destId, boolean ack)
AllocPolicy
AllocPolicy.sendAck(int, boolean, int, int)
.AllocPolicy.sendAck(int, boolean, int, int)
. AllocPolicy.sendFinishGridlet(Gridlet)
.AllocPolicy.gridletMigrate(Gridlet, int, boolean)
.
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 gridletPause(int gridletId, int userId, boolean ack)
AllocPolicy
If an acknowledgement is required, then at the end of this method,
should include the following code:
... // other code
// sends back an ack if required
boolean success = true; // If this method success, false otherwise
if (ack == true) {
sendAck(GridSimTags.GRIDLET_PAUSE_ACK,
success, gl.getGridletID(), gl.getUserID() );
}
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 gridletResume(int gridletId, int userId, boolean ack)
AllocPolicy
If an acknowledgement is required, then at the end of this method,
should include the following code:
... // other code
// sends back an ack if required
boolean success = true; // If this method success, false otherwise
if (ack == true) {
sendAck(GridSimTags.GRIDLET_RESUME_ACK,
success, gl.getGridletID(), gl.getUserID() );
}
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)protected int backfillGridlets()
protected long forecastExecutionTime(double availableRating, double length)
availableRating
- the shared MIPS rating for all Gridletslength
- remaining Gridlet length
protected void gridletFinish(SSGridlet sgl, int status)
sgl
- a SSGridlet objectstatus
- the Gridlet status
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |