Controller Resource Manager

This module implements component management for the MCCS controller.

class ControllerResourceManager(subarrays, subarray_beams, station_beams, channel_blocks)

A resource manager for the controller component manager.

__init__(subarrays, subarray_beams, station_beams, channel_blocks)

Initialise a new instance.

Parameters:
  • subarrays (Iterable[str]) – all subarrays to be managed by this resource manager

  • subarray_beams (Iterable[str]) – all subarray beams to be managed by this resource manager

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

  • channel_blocks (Iterable[int]) – all channel blocks to be managed by this resource manager

allocate(subarray, **resources)

Allocate resources to a subarray.

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

  • resources (Iterable[Hashable]) –

    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],
    )
    

Return type:

None

deallocate(**resources)

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

Parameters:

resources (Iterable[Hashable]) –

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],
)

Return type:

None

deallocate_from(subarray)

Deallocate all resources from a subarray.

Parameters:

subarray (str) – the subarray to which resources are to be allocated

Return type:

None

get_allocated(subarray)

Return the resources allocated to a given subarray.

Parameters:

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

Return type:

Mapping[str, Iterable[str]]

Returns:

the resources allocated to the subarray.

set_health(resource_type, resource, is_healthy)

Set the health of a resource.

Parameters:
  • resource_type (str) – the type of resource whose health is to be set

  • resource (Hashable) – the resource whose health is to be set

  • is_healthy (bool) – whether the resource is healthy or not

Return type:

None

set_ready(subarray, is_ready)

Set the health of a resource.

Parameters:
  • subarray (str) – the subarray to be set as ready

  • is_ready (bool) – whether the subarray is ready or not

Return type:

None