Package haizea :: Package core :: Package scheduler :: Module mapper :: Class Mapper
[hide private]
[frames] | no frames]

Class Mapper

source code


Base class for mappers

Instance Methods [hide private]
 
__init__(self, slottable, policy)
Constructor
source code
 
map(self, requested_resources, start, end, strictend, onlynodes=None)
The mapping function
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, slottable, policy)
(Constructor)

source code 

Constructor

Arguments slottable -- A fully constructed SlotTable policy -- A fully constructed PolicyManager

Overrides: object.__init__

map(self, requested_resources, start, end, strictend, onlynodes=None)

source code 

The mapping function

The mapping function takes a set of requested resources and maps them to physical resources (based on the availability in the slot table) in a specified time interval. The mapper may return a mapping that only satisfies part of the specified time interval.

Arguments: requested_resources -- A dictionary mapping lease nodes (integers) to ResourceTuples (representing the desired amount of resources for that lease node) start -- Starting time of the interval during which the resources are required end -- Ending time of the interval strictend -- If True, the only valid mappings are those that span the entire requested interval. If False, the mapper is allowed to return mappings that only span part of the interval (this reduced interval must always start at "start"; the earlier end time is returned as a return value) onlynodes -- List of physical nodes. Only look for a mapping in these nodes.

Returns: mapping -- A dictionary mapping lease nodes to physical nodes maxend -- The end of the interval for which a mapping was found. As noted in argument "strictend", this return value might not be the same as "end" preempting -- Leases that would have to be preempted for the mapping to be valid.

If no mapping is found, the three return values are set to None