GridSim 5.0 beta

gridsim.parallel.scheduler
Class ARConservativeBackfill

Object
  extended by Thread
      extended by Sim_entity
          extended by AllocPolicy
              extended by ConservativeBackfill
                  extended by ARConservativeBackfill
All Implemented Interfaces:
ReservationPolicy, Cloneable, Runnable

public class ARConservativeBackfill
extends ConservativeBackfill
implements ReservationPolicy

ARConservativeBackfill class is an allocation policy for ParallelResource that implements conservative backfilling and supports advance reservations. The policy is based on the conservative backfilling algorithm described in the following papers:

Similarly to ConservativeBackfill this scheduler maintains an availability profile. But the difference is that in many cases an advance reservation will require two entries in the profile, one to mark its start time and another to delimit its finish time. In addition, when a job is cancelled, the advance reservations are not removed from the availability profile and therefore are not moved forwards in the scheduling queue. In other words, there is no compression of the scheduling queue.
This scheduler supports parallel jobs and some reservation functionalities, such as:

NOTE THAT:

Since:
5.0
Author:
Marcos Dias de Assuncao
See Also:
ResourceCharacteristics, ReservationPolicy, SingleProfile, ConservativeBackfill

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class ConservativeBackfill
dynamics, jobOrder, profile, ratingPE, runningJobs, UPT_SCHEDULE, 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
ARConservativeBackfill(String resourceName, String entityName)
          Allocates a new ARConservativeBackfill object.
ARConservativeBackfill(String resourceName, String entityName, int commitPeriod)
          Allocates a new ARConservativeBackfill object.
 
Method Summary
 void body()
          Handles internal events that come to this entity.
 boolean cancelReservation(ReservationMessage message)
          This method handles a cancel reservation request.
 boolean commitReservation(ReservationMessage message)
          Handles a commit reservation request.
 ReservationMessage createReservation(ReservationMessage message)
          Handles an advance reservation request.
 void gridletSubmit(Gridlet gridlet, boolean ack)
          Schedules a new job received by the Grid resource entity.
 boolean modifyReservation(ReservationMessage message)
          A method that handles a request to modify a reservation.
 void processOtherEvent(Sim_event ev)
          Process and event sent to this entity
 ReservationMessage queryAvailability(ReservationMessage message)
          Handles a query free time request.
 ReservationMessage queryReservation(ReservationMessage message)
          Handles a query reservation request.
protected  void updateSchedule()
          This method is called to update the schedule.
 
Methods inherited from class ConservativeBackfill
compressSchedule, enqueueGridlet, finishRunningGridlets, forecastExecutionTime, gridletCancel, gridletFinish, gridletMove, gridletPause, gridletResume, gridletStatus, setJobOrderingHeuristic, startGridlet, startQueuedGridlets
 
Methods inherited from class AllocPolicy
addTotalLoad, calculateTotalLoad, findGridlet, getTotalLoad, gridletMigrate, init, isEndSimulation, sendAck, sendCancelGridlet, sendFinishGridlet, sendInternalEvent, sendInternalEvent, setEndSimulation
 
Methods inherited from class Sim_entity
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
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

ARConservativeBackfill

public ARConservativeBackfill(String resourceName,
                              String entityName)
                       throws Exception
Allocates a new ARConservativeBackfill object.

Parameters:
resourceName - the grid resource entity name that will contain this allocation policy
entityName - this object entity name
Throws:
Exception - This happens when one of the following scenarios occur:
  • Creating this entity before initialising GridSim package
  • The entity name is null or empty

ARConservativeBackfill

public ARConservativeBackfill(String resourceName,
                              String entityName,
                              int commitPeriod)
                       throws Exception
Allocates a new ARConservativeBackfill object.

Parameters:
resourceName - the grid resource entity name that will contain this allocation policy
entityName - this object entity name
commitPeriod - a default commit period time for a user to commit a reservation (unit is in second). NOTE: once it is set, you cannot change the time again.
Throws:
Exception - This happens when one of the following scenarios occur:
  • Creating this entity before initialising GridSim package
  • The entity name is null or empty
Method Detail

body

public void body()
Description copied from class: ConservativeBackfill
Handles internal events that come to this entity.

Overrides:
body in class ConservativeBackfill

processOtherEvent

public void processOtherEvent(Sim_event ev)
Process and event sent to this entity

Overrides:
processOtherEvent in class AllocPolicy
Parameters:
ev - the event to be handled

createReservation

public ReservationMessage createReservation(ReservationMessage message)
Handles an advance reservation request.

Specified by:
createReservation in interface ReservationPolicy
Parameters:
message - the advance reservation message received
Returns:
true if the reservation was accepted; false otherwise.

cancelReservation

public boolean cancelReservation(ReservationMessage message)
This method handles a cancel reservation request.

Specified by:
cancelReservation in interface ReservationPolicy
Parameters:
message - the advance reservation message received requesting the cancellation
Returns:
true if the reservation was cancelled; false otherwise.

queryAvailability

public ReservationMessage queryAvailability(ReservationMessage message)
Handles a query free time request.

Specified by:
queryAvailability in interface ReservationPolicy
Parameters:
message - the advance reservation message received.
Returns:
the response message with the availability information

queryReservation

public ReservationMessage queryReservation(ReservationMessage message)
Handles a query reservation request.

Specified by:
queryReservation in interface ReservationPolicy
Parameters:
message - the advance reservation message received.
Returns:
the response message.

commitReservation

public boolean commitReservation(ReservationMessage message)
Handles a commit reservation request.

Specified by:
commitReservation in interface ReservationPolicy
Parameters:
message - the advance reservation message received
Returns:
true if the reservation was committed; false otherwise.

modifyReservation

public boolean modifyReservation(ReservationMessage message)
A method that handles a request to modify a reservation.

Specified by:
modifyReservation in interface ReservationPolicy
Parameters:
message - the advance reservation message received
Returns:
true if the reservation was modified; false otherwise.

gridletSubmit

public void gridletSubmit(Gridlet gridlet,
                          boolean ack)
Schedules a new job received by the Grid resource entity.

Overrides:
gridletSubmit in class ConservativeBackfill
Parameters:
gridlet - a job object to be executed
ack - user wants to know whether this operation is successful or not, false otherwise.
See Also:
ResGridlet, ResGridletList

updateSchedule

protected void updateSchedule()
This method is called to update the schedule. It removes completed jobs and return them to the users and verifies whether there are jobs in the waiting list that should start execution. It also removes old entries from the availability profile.

Overrides:
updateSchedule in class ConservativeBackfill

GridSim 5.0 beta

The University of Melbourne, Australia, 2009