|
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 SelectiveBackfill
public class SelectiveBackfill
This scheduling strategy is the implementation of the backfilling based scheduler describe in the following paper:
XFactor = (Wait time + Estimated run time) / Estimated run timeThe XFactor threshold is initially set to
1.0
and as jobs
complete, it is updated to the average slowdown of the completed jobs.
Alternatively, you can create job categories, each category will have its
own starvation threshold. See addJobCategory(PartitionPredicate)
This policy maintains an availability profile. The availability profile contains information about the ranges of processing elements (PEs) that will be released when the running jobs complete.
NOTE THAT:
WorkloadLublin99
.
GridSim
,
ResourceCharacteristics
,
AllocPolicy
,
PERange
,
PERangeList
Nested Class Summary | |
---|---|
(package private) class |
SelectiveBackfill.JobCategory
|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected ArrayList<SelectiveBackfill.JobCategory> |
categories
|
protected ResourceDynamics |
dynamics
|
protected Comparator<SSGridlet> |
jobOrder
|
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 | |
---|---|
SelectiveBackfill(String resName,
String entityName)
Allocates a new SelectiveBackfill object |
Method Summary | |
---|---|
void |
addJobCategory(PartitionPredicate predicate)
Adds a job category to use to calculate the starvation threshold. |
protected int |
backfillGridlets()
This method backfills/starts jobs 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. |
protected double |
getXFactor(SSGridlet sgl)
Calculates the eXpansion Factor (XFactor) of a job. |
protected double |
getXFactorThreshold(SSGridlet sgl)
Gets the eXpansion Factor (XFactor) threshold applicable for a particular job |
void |
gridletCancel(int gridletId,
int userId)
An abstract method that cancels a Gridlet in an execution list. |
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. |
protected void |
scheduleGridlet(SSGridlet sgl)
Enqueues a job. |
boolean |
setJobOrderingHeuristic(Comparator<SSGridlet> comparator)
Sets the heuristic used to order the jobs considered for backfilling or when a cancellation takes place |
protected boolean |
startGridlet(SSGridlet sgl)
Starts a job using free PEs, sets the job status to INEXEC and updates the availability profile |
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 ArrayList<SelectiveBackfill.JobCategory> categories
protected static final int UPT_SCHEDULE
Constructor Detail |
---|
public SelectiveBackfill(String resName, String entityName) throws Exception
SelectiveBackfill
object
resName
- the name of the Grid resource that will contain this scheduler.entityName
- 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 addJobCategory(PartitionPredicate predicate)
predicate
- the job category. If jobs match this predicate, then
they fall into this category.public boolean setJobOrderingHeuristic(Comparator<SSGridlet> comparator)
comparator
- a comparator implementation.
true
if the heuristic was set correctly.public void body()
body
in class Sim_entity
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)
AllocPolicy
This method is always required to send back the Gridlet to sender.
If the Gridlet is not found, then send back a null Gridlet.
Therefore, at the end of this method, should include the following
code:
... // other code
// A ResGridlet object stored in a container or other data structure
// before exit, finalize all the Gridlet's relevant time information
resGridlet.finalizeGridlet();
// sends the Gridlet back to sender
// Here, gridlet can be null if not found
Gridlet gridlet = resGridlet.getGridlet();
sendCancelGridlet(GridSimTags.GRIDLET_CANCEL, gridlet,
gridletId, userId);
gridletCancel
in class AllocPolicy
gridletId
- a Gridlet IDuserId
- the user or owner's ID of this Gridletpublic 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)public 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
protected int backfillGridlets()
protected boolean startGridlet(SSGridlet sgl)
sgl
- a SSGridlet object
true
if there if the job has started;
false
otherwiseprotected void scheduleGridlet(SSGridlet sgl)
sgl
- the job to be scheduledprotected double getXFactor(SSGridlet sgl)
sgl
- the job to be examined.
protected double getXFactorThreshold(SSGridlet sgl)
sgl
- the job to be examined
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 |