Controller Resource Manager

This module implements component management for the MCCS controller.

class ControllerResourceManager(subarrays: Iterable[str], subarray_beams: Iterable[str], station_beams: Iterable[str], channel_blocks: Iterable[int])[source]

A resource manager for the controller component manager.

__init__(subarrays: Iterable[str], subarray_beams: Iterable[str], station_beams: Iterable[str], channel_blocks: Iterable[int]) None[source]

Initialise a new instance.

Parameters:
  • subarrays – all subarrays to be managed by this resource manager

  • subarray_beams – all subarray beams to be managed by this resource manager

  • station_beams – all station beams to be managed by this resource manager (as a resource pool)

  • channel_blocks – all channel blocks to be managed by this resource manager

allocate(subarray: str, **resources: Iterable[Hashable]) None[source]

Allocate resources to a subarray.

Parameters:
  • subarray – the subarray to which resources are to be allocated

  • resources

    the resources to allocate. Each keyword specifies a resource type, with the value a list of the resources of that type to be allocated. For example:

    controller_resource_manager.allocate(
        "low-mccs/subarray/01",
        stations=[
            ["low-mccs/station/001", "low-mccs/station/002"]
        ],
        station_beams=[["low-mccs/beam/01", "low-mccs/beam/02"]]
        channel_blocks=[2, 3],
    )
    

deallocate(**resources: Iterable[Hashable]) None[source]

Deallocate resources (regardless of what subarray they are allocated to.

Parameters:

resources

the resources to deallocate. Each keyword specifies a resource type, with the value a list of the resources of that type to be deallocated. For example:

controller_resource_manager.deallocate(
    stations=[
        "low-mccs/station/001", "low-mccs/station/002"
    ],
    channel_blocks=[2, 3],
)

deallocate_from(subarray: str) None[source]

Deallocate all resources from a subarray.

Parameters:

subarray – the subarray to which resources are to be allocated

get_allocated(subarray: str) Mapping[str, Iterable[str]][source]

Return the resources allocated to a given subarray.

Parameters:

subarray – TRL of the subarray for which the allocated resources are to be returned

Returns:

the resources allocated to the subarray.

set_ready(subarray: str, is_ready: bool) None[source]

Set the health of a resource.

Parameters:
  • subarray – the subarray to be set as ready

  • is_ready – whether the subarray is ready or not