gridsim
Class GridResource

Object
  |
  +--Thread
        |
        +--eduni.simjava.Sim_entity
              |
              +--gridsim.GridSim
                    |
                    +--gridsim.GridResource
All Implemented Interfaces:
Runnable

public class GridResource
extends GridSim

GridSim GridResource extends the gridsim.GridSim class and gains communication and concurrent entity capability. An instance of this class stimulates a resource with properties defined in an object of gridsim.ResourceCharacteristics class.

The process of creating a Grid resource is as follows:

  1. create PE (Processing Element) objects with a suitable MIPS (Million Instructions Per Second) or SPEC (Standard Performance Evaluation Corporation) rating;
  2. assemble them together to create a machine;
  3. group one or more objects of the machine to form a resource

A resource having a single machine with one or more PEs (Processing Elements) is managed as a time-shared system using a round-robin scheduling algorithm. A resource with multiple machines is treated as a distributed memory cluster and is managed as a space-shared system using FCFS (First Come Firt Serve) scheduling policy or its variants.

Version:
2.1, June 2003
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
GridSim, ResourceCharacteristics
Invariant:
$none

Field Summary
 
Fields inherited from class gridsim.GridSim
input, output, rand, SimulationStartDate
 
Fields inherited from class eduni.simjava.Sim_entity
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GridResource(String name, double baud_rate, long seed, ResourceCharacteristics resource, double peakLoad, double offpeakLoad, double relativeHolidayLoad, LinkedList weekends, LinkedList holidays)
          Allocates a new GridResource object
 
Method Summary
 void body()
          A method that registers a resource to be scheduled, then processes internal and external events.
 void SpaceShare_AllocatePEtoGridlet(Gridlet gl)
          Deprecated. As of GridSim 2.1, replaced by spaceShared_AllocatePEtoGridlet(Gridlet)
 void spaceShared_AllocatePEtoGridlet(Gridlet gl)
          Allocates one of the PEs to Gridlet for execution and schedules an internal event to be delivered at completion time.
 
Methods inherited from class gridsim.GridSim
clock, Clock, finalize, finalizeGridSimulation, getEntityId, GetEntityId, getEntityName, GetEntityName, getEntityName, GetEntityName, getGridInfoServiceEntityId, getGridResourceList, GetGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getResourceCharacteristics, GetResourceCharacteristics, getResourceDynamicInfo, GetResourceDynamicInformation, getSimulationStartDate, GetSimulationStartDate, GridInformationServiceEntityId, GridletCancel, gridletReceive, GridletReceive, gridletSubmit, GridletSubmit, gridSimHold, GridSimHold, GridSimShutdownEntityId, GridStatisticsEntityId, init, Init, isNetworked, IsNetworked, receiveEventObject, ReceiveEventObject, receiveEventObject, ReceiveEventObject, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, send, Send, send, Send, send, Send, send, Send, send, Send, send, Send, shutdownGridStatisticsEntity, ShutdownGridStatisticsEntity, shutdownUserEntity, ShutdownUserEntity, Start, startGridSimulation, Stop, stopGridSimulation, TerminateInputOutputEntities, terminateIOEntities
 
Methods inherited from class eduni.simjava.Sim_entity
add_param, add_port, get_id, get_name, get_port, get_port, run, send_on, set_invisible, sim_cancel, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridResource

public GridResource(String name,
                    double baud_rate,
                    long seed,
                    ResourceCharacteristics resource,
                    double peakLoad,
                    double offpeakLoad,
                    double relativeHolidayLoad,
                    LinkedList weekends,
                    LinkedList holidays)
             throws Exception
Allocates a new GridResource object

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
baud_rate - communication speed
seed - the initial seed
resource - an object of ResourceCharacteristics
peakLoad - the load during peak times
offpeakLoad - the load during off peak times
relativeHolidayLoad - the load during holiday times
weekends - a linked-list contains the weekend days
holidays - a linked-list contains the public holidays
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
GridSim.Init(int, Calendar, boolean, String[], String[], String)
Pre Condition:
$none
Post Condition:
$none
Method Detail

body

public void body()
A method that registers a resource to be scheduled, then processes internal and external events.

The services available to other GridSim entities are:

Overrides:
body in class eduni.simjava.Sim_entity
Pre Condition:
$none
Post Condition:
$none

SpaceShare_AllocatePEtoGridlet

public void SpaceShare_AllocatePEtoGridlet(Gridlet gl)
Deprecated. As of GridSim 2.1, replaced by spaceShared_AllocatePEtoGridlet(Gridlet)

Allocates one of the PEs to Gridlet for execution and schedules an internal event to be delivered at completion time. This is done by:
  1. Identifing Unallocated PEs;
  2. If some free PEs are available, map gridlet to available PE by:
    • Total Execution Time = [GridletMI / (PE's MPIS Rating)] + IO Time
    • Set an Event to be se sent after Total_Execution_Time indicating completion of Gridlet.
      Else, place Gridlet into "Job Queue".

Parameters:
gl - a Gridlet to be processed
Pre Condition:
gl != null
Post Condition:
$none

spaceShared_AllocatePEtoGridlet

public void spaceShared_AllocatePEtoGridlet(Gridlet gl)
Allocates one of the PEs to Gridlet for execution and schedules an internal event to be delivered at completion time. This is done by:
  1. Identifing Unallocated PEs;
  2. If some free PEs are available, map gridlet to available PE by:
    • Total Execution Time = [GridletMI / (PE's MPIS Rating)] + IO Time
    • Set an Event to be se sent after Total_Execution_Time indicating completion of Gridlet.
      Else, place Gridlet into "Job Queue".

Parameters:
gl - a Gridlet to be processed
Pre Condition:
gl != null
Post Condition:
$none