spinn_machine.spalloc_server package

Submodules

spinn_machine.spalloc_server.configuration module

class spinn_machine.spalloc_server.configuration.Configuration(machines: List[MachineConfig] | None = None, port: int = 22244, ip_address: str = '', timeout_check_interval: float = 5.0, max_retired_jobs: int = 1200, seconds_before_free: int = 30)[source]

Bases: Configuration

A configuration for the spalloc server, containing a list of machines and various parameters for the server.

Parameters:
  • machines – A list of Machine objects describing the machines

  • port – The port on which the server will listen

  • ip_address – The IP address on which the server will listen

  • timeout_check_interval – How often to check for timeouts

  • max_retired_jobs – The maximum number of retired jobs to keep

  • seconds_before_free – How long to wait before freeing an idle job

class spinn_machine.spalloc_server.configuration.MachineConfig(name: str, tags: FrozenSet[str] = frozenset({'default'}), width: int | None = None, height: int | None = None, dead_boards: FrozenSet[Tuple[int, int, int]] = frozenset({}), dead_links: FrozenSet[Tuple[int, int, int, Links]] = frozenset({}), board_locations: Dict[Tuple[int, int, int], Tuple[int, int, int]] | None = None, bmp_ips: Dict[Tuple[int, int], str] | None = None, spinnaker_ips: Dict[Tuple[int, int, int], str] | None = None)[source]

Bases: MachineConfig

A description of a machine, including its dimensions, dead boards and links, board locations, and IP addresses for the BMPs and SpiNNaker boards.

Parameters:
  • name – The name of the machine

  • tags – A set of tags for the machine, used for filtering

  • width – The width of the machine in triads

  • height – The height of the machine in triads

  • dead_boards – A set of dead boards in the machine, given as tuples of (x, y, z) coordinates.

  • dead_links – A set of dead links in the machine, given as tuples of (x, y, z, link_type)

  • board_locations – A dictionary mapping board coordinates (x, y, z) to their locations (cabinet, frame, board).

  • bmp_ips – A dictionary mapping (cabinet, frame) to the BMP IP address for that cabinet and frame.

  • spinnaker_ips – A dictionary mapping (x, y, z) coordinates to the SpiNNaker IP address for that board.

classmethod single_board(name: str, tags: FrozenSet[str] = frozenset({'default'}), bmp_ip: str | None = None, spinnaker_ip: str | None = None) MachineConfig[source]

Create a machine with a single board, with the given BMP and SpiNNaker IP addresses.

Parameters:
  • name – The name of the machine

  • tags – A set of tags for the machine, used for filtering

  • bmp_ip – The IP address of the BMP for this machine

  • spinnaker_ip – The IP address of the SpiNNaker board for this machine

Returns:

A Machine object representing a single board machine

classmethod with_standard_ips(name: str, tags: FrozenSet[str] = frozenset({'default'}), width: int | None = None, height: int | None = None, dead_boards: FrozenSet[Tuple[int, int, int]] = frozenset({}), dead_links: FrozenSet[Tuple[int, int, int, Links]] = frozenset({}), board_locations: Dict[Tuple[int, int, int], Tuple[int, int, int]] | None = None, base_ip: str = '192.168.0.0', cabinet_stride: str = '0.0.5.0', frame_stride: str = '0.0.1.0', board_stride: str = '0.0.0.8', bmp_offset: str = '0.0.0.0', spinnaker_offset: str = '0.0.0.1') MachineConfig[source]

Create a machine with standard IP addresses based on the given parameters. The base IP is the starting point for the IP addresses, and the other parameters define how the IPs for cabinets, frames, boards, BMPs, and SpiNNaker boards are calculated.

Parameters:
  • name – The name of the machine

  • tags – A set of tags for the machine, used for filtering

  • width – The width of the machine in triads

  • height – The height of the machine in triads

  • dead_boards – A set of dead boards in the machine, given as tuples of (x, y, z) coordinates.

  • dead_links – A set of dead links in the machine, given as tuples of (x, y, z, link_type)

  • board_locations – A dictionary mapping board coordinates (x, y, z) to their locations (cabinet, frame, board).

  • base_ip – The base IP address for the machine, in dotted decimal

  • cabinet_stride – The stride for cabinets, in dotted decimal

  • frame_stride – The stride for frames, in dotted decimal

  • board_stride – The stride for boards, in dotted decimal

  • bmp_offset – The offset for BMPs, in dotted decimal

  • spinnaker_offset – The offset for SpiNNaker boards, in dotted decimal

Returns:

A Machine object with the specified parameters

spinn_machine.spalloc_server.configuration.board_locations_from_spinner(filename: str) Dict[Tuple[int, int, int], Tuple[int, int, int]][source]

Extract board locations from a CSV file containing Ethernet connected chips and their locations.

Parameters:

filename – The path to the CSV file containing the chip locations

Returns:

A dictionary mapping board coordinates (x, y, z) to their locations (cabinet, frame, board).

spinn_machine.spalloc_server.coordinates module

spinn_machine.spalloc_server.coordinates.chip_to_board(x: int, y: int, w: int, h: int) Tuple[int, int, int][source]

Get the board coordinates from the chip coordinates.

Parameters:
  • x – The X coordinate of the chip.

  • y – The Y coordinate of the chip.

  • w – The width of the machine in chips.

  • h – The height of the machine in chips.

Returns:

The board coordinates (x, y, z) of the chip.

spinn_machine.spalloc_server.py2json module

spinn_machine.spalloc_server.py2json.convert_config_to_json(config_file: str, output_file: str) None[source]

Convert the configuration to JSON.

Parameters:
  • config_file – The configuration file to convert

  • output_file – The file to write the JSON to

Gather the links for a machine.

Parameters:

machine – The machine to gather links for

Returns:

A dictionary of links keyed by their string representation

spinn_machine.spalloc_server.py2json.read_config_file(config_filename: str) Configuration[source]

Read the server configuration.

Returns:

The read configuration

Module contents