spinn_front_end_common.utility_models package¶
Submodules¶
spinn_front_end_common.utility_models.chip_power_monitor_application_vertex module¶
-
class
spinn_front_end_common.utility_models.chip_power_monitor_application_vertex.
ChipPowerMonitorApplicationVertex
(label, constraints, n_samples_per_recording, sampling_frequency)[source]¶ Bases:
pacman.model.graphs.application.application_vertex.ApplicationVertex
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
class for representing idle time recording code in a application graph.
chip power monitor application vertex constructor
Parameters: - label – vertex label
- constraints – constraints for the vertex
- n_samples_per_recording – how many samples to take before / recording to sdram the total
- sampling_frequency – how many microseconds between sampling
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
spinn_front_end_common.utility_models.chip_power_monitor_machine_vertex module¶
-
class
spinn_front_end_common.utility_models.chip_power_monitor_machine_vertex.
ChipPowerMonitorMachineVertex
(*args, **kwargs)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost
machine vertex for c code representing functionality to record / idle times in a machine graph
-
CONFIG_SIZE_IN_BYTES
= 8¶
-
DEFAULT_MALLOCS_USED
= 3¶
-
MAX_BUFFER_SIZE
= 1048576¶
-
MAX_CORES_PER_CHIP
= 18¶
-
RECORDING_SIZE_PER_ENTRY
= 72¶
-
SAMPLE_RECORDING_REGION
= 0¶
-
static
binary_start_type
()[source]¶ static method to allow app verts to use this
Returns: starttype enum
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_minimum_buffer_sdram_usage
(*args, **kwargs)[source]¶ Get the minimum amount of SDRAM to reserve for buffers
-
get_n_timesteps_in_buffer_space
(*args, **kwargs)[source]¶ Get the number of timesteps that can be stored fully in the given buffer space in bytes
Parameters: - buffer_space – The buffer space in bytes
- machine_time_step – The size of each time step
Returns: The number of time steps that can be stored in the buffer
Return type: int
-
get_recorded_data
(placement, buffer_manager)[source]¶ get data from sdram given placement and buffer manager
Parameters: - placement – the location on machien to get data from
- buffer_manager – the buffer manager that might have data
Returns: results
Return type: numpy array with 1 dimension
-
get_recorded_region_ids
()[source]¶ Get the recording region ids that have been recorded using buffering
Returns: The region numbers that have active recording Return type: iterable of int
-
get_recording_region_base_address
(txrx, placement)[source]¶ Get the recording region base address
Parameters: - txrx – the SpiNNMan instance
- placement – the placement object of the core to find the address of
Returns: the base address of the recording region
-
static
get_resources
(n_machine_time_steps, time_step, time_scale_factor, n_samples_per_recording, sampling_frequency)[source]¶ get resources used by this vertex
:return:Resource container
-
n_samples_per_recording
¶
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
sampling_frequency
¶
-
spinn_front_end_common.utility_models.command_sender module¶
-
class
spinn_front_end_common.utility_models.command_sender.
CommandSender
(label, constraints)[source]¶ Bases:
pacman.model.graphs.application.application_vertex.ApplicationVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
A utility for sending commands to a vertex (possibly an external device) at fixed times in the simulation
-
add_commands
(start_resume_commands, pause_stop_commands, timed_commands, vertex_to_send_to)[source]¶ Add commands to be sent down a given edge
Parameters: - start_resume_commands (iterable of
spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand
) – The commands to send when the simulation starts or resumes from pause - pause_stop_commands (iterable of
spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand
) – the commands to send when the simulation stops or pauses after running - timed_commands (iterable of
spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand
) – The commands to send at specific times - vertex_to_send_to – The vertex these commands are to be sent to
- start_resume_commands (iterable of
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_file_name
()[source]¶ Get the binary name to be run for this vertex
Return type: str Return a string representation of the models binary
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex
Parameters: partition – An edge that comes out of this vertex Returns: A list of constraints Return type: list of pacman.model.constraints.abstract_constraint.AbstractConstraint
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
-
spinn_front_end_common.utility_models.command_sender_machine_vertex module¶
-
class
spinn_front_end_common.utility_models.command_sender_machine_vertex.
CommandSenderMachineVertex
(constraints, resources_required, label, commands_at_start_resume, commands_at_pause_stop, timed_commands)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
-
BINARY_FILE_NAME
= 'command_sender_multicast_source.aplx'¶
-
class
DATA_REGIONS
¶ Bases:
enum.Enum
-
COMMANDS_AT_START_RESUME
= 3¶
-
COMMANDS_AT_STOP_PAUSE
= 4¶
-
COMMANDS_WITH_ARBITRARY_TIMES
= 2¶
-
PROVENANCE_REGION
= 5¶
-
SETUP
= 1¶
-
SYSTEM_REGION
= 0¶
-
-
TOTAL_REQUIRED_MALLOCS
= 5¶
-
generate_data_specification
(spec, placement, machine_time_step, time_scale_factor, n_machine_time_steps)[source]¶
-
get_binary_file_name
()[source]¶ Get the binary name to be run for this vertex
Return type: str Return a string representation of the models binary
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
spinn_front_end_common.utility_models.live_packet_gather module¶
-
class
spinn_front_end_common.utility_models.live_packet_gather.
LivePacketGather
(hostname, port, board_address=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, constraints=None, label=None)[source]¶ Bases:
spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,pacman.model.graphs.application.application_vertex.ApplicationVertex
A model which stores all the events it receives during a timer tick and then compresses them into Ethernet packets and sends them out of a spinnaker machine.
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
generate_data_specification
(spec, placement)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
-
spinn_front_end_common.utility_models.live_packet_gather_machine_vertex module¶
-
class
spinn_front_end_common.utility_models.live_packet_gather_machine_vertex.
LivePacketGatherMachineVertex
(label, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, hostname=None, port=None, strip_sdp=None, board_address=None, tag=None, constraints=None)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection
-
N_ADDITIONAL_PROVENANCE_ITEMS
= 2¶
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_provenance_data_from_machine
(transceiver, placement)[source]¶ Get provenance from the machine
Parameters: - transceiver – spinnman interface to the machine
- placement – the location of this vertex on the machine
-
is_in_injection_mode
¶ Whether this vertex is actually in injection mode.
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
spinn_front_end_common.utility_models.multi_cast_command module¶
-
class
spinn_front_end_common.utility_models.multi_cast_command.
MultiCastCommand
(key, payload=None, time=None, repeat=0, delay_between_repeats=0)[source]¶ Bases:
object
A command to be sent to a vertex
Parameters: - key (int) – The key of the command
- payload (int) – The payload of the command
- time (int) – The time within the simulation at which to send the command, or None if this is not a timed command
- repeat (int) – The number of times that the command should be repeated after sending it once. This could be used to ensure that the command is sent despite lost packets. Must be between 0 and 65535
- delay_between_repeats (int) – The amount of time in micro seconds to wait between sending repeats of the same command. Must be between 0 and 65535, and must be 0 if repeat is 0
Raises: SpynnakerException – If the repeat or delay are out of range
-
delay_between_repeats
¶
-
is_payload
¶ Determine if this command has a payload. By default, this returns True if the payload passed in to the constructor is not None, but this can be overridden to indicate that a payload will be generated, despite None being passed to the constructor
Returns: True if there is a payload, False otherwise Return type: bool
-
is_timed
¶
-
key
¶
-
payload
¶ Get the payload of the command.
Returns: The payload of the command, or None if there is no payload Return type: int
-
repeat
¶
-
time
¶
spinn_front_end_common.utility_models.reverse_ip_tag_multi_cast_source module¶
-
class
spinn_front_end_common.utility_models.reverse_ip_tag_multi_cast_source.
ReverseIpTagMultiCastSource
(n_keys, label=None, constraints=None, max_atoms_per_core=9223372036854775807, board_address=None, receive_port=None, receive_sdp_port=1, receive_tag=None, receive_rate=10, virtual_key=None, prefix=None, prefix_type=None, check_keys=False, send_buffer_times=None, send_buffer_partition_id=None, send_buffer_max_space=1048576, send_buffer_space_before_notify=640, buffer_notification_ip_address=None, buffer_notification_port=None, buffer_notification_tag=None, reserve_reverse_ip_tag=False)[source]¶ Bases:
pacman.model.graphs.application.application_vertex.ApplicationVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
,spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl
A model which will allow events to be injected into a spinnaker machine and converted into multicast packets.
Parameters: - n_keys – The number of keys to be sent via this multicast source
- label – The label of this vertex
- constraints – Any initial constraints to this vertex
- board_address – The IP address of the board on which to place this vertex if receiving data, either buffered or live (by default, any board is chosen)
- receive_port – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it)
- receive_sdp_port – The SDP port to listen on for incoming event packets (defaults to 1)
- receive_tag – The IP tag to use for receiving live events (uses any by default)
- receive_rate – The estimated rate of packets that will be sent by this source
- virtual_key – The base multicast key to send received events with (assigned automatically by default)
- prefix – The prefix to “or” with generated multicast keys (default is no prefix)
- prefix_type – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
- check_keys – True if the keys of received events should be verified before sending (default False)
- send_buffer_times – An array of arrays of times at which keys should be sent (one array for each key, default disabled)
- send_buffer_partition_id – The id of the partition containing the edges down which the events are to be sent
- send_buffer_max_space – The maximum amount of space to use of the SDRAM on the machine (default is 1MB)
- send_buffer_space_before_notify – The amount of space free in the sending buffer before the machine will ask the host for more data (default setting is optimised for most cases)
- buffer_notification_ip_address – The IP address of the host that will send new buffers (must be specified if a send buffer is specified or if recording will be used)
- buffer_notification_port – The port that the host that will send new buffers is listening on (must be specified if a send buffer is specified, or if recording will be used)
- buffer_notification_tag – The IP tag to use to notify the host about space in the buffer (default is to use any tag)
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
enable_recording
(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_requests=0)[source]¶
-
generate_data_specification
(spec, placement)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex
Parameters: partition – An edge that comes out of this vertex Returns: A list of constraints Return type: list of pacman.model.constraints.abstract_constraint.AbstractConstraint
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
-
send_buffer_times
¶
spinn_front_end_common.utility_models.reverse_ip_tag_multicast_source_machine_vertex module¶
-
class
spinn_front_end_common.utility_models.reverse_ip_tag_multicast_source_machine_vertex.
ReverseIPTagMulticastSourceMachineVertex
(*args, **kwargs)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
,spinn_front_end_common.interface.buffer_management.buffer_models.sends_buffers_from_host_pre_buffered_impl.SendsBuffersFromHostPreBufferedImpl
,spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost
,spinn_front_end_common.abstract_models.abstract_recordable.AbstractRecordable
A model which allows events to be injected into spinnaker and converted in to multicast packets
-
enable_recording
(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_triggers=0)[source]¶ Enable recording of the keys sent
Parameters: - record_buffer_size (int) – The size of the recording buffer in bytes. Note that when using automatic pause and resume, this will be used as the minimum size of the buffer
- buffer_size_before_receive (int) – The size that the buffer can grow to before a read request is issued to the host (in bytes)
- time_between_triggers (int) – The minimum time between the sending of read requests
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_n_timesteps_in_buffer_space
(buffer_space, machine_time_step)[source]¶ Get the number of timesteps that can be stored fully in the given buffer space in bytes
Parameters: - buffer_space – The buffer space in bytes
- machine_time_step – The size of each time step
Returns: The number of time steps that can be stored in the buffer
Return type: int
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex
Parameters: partition – An edge that comes out of this vertex Returns: A list of constraints Return type: list of pacman.model.constraints.abstract_constraint.AbstractConstraint
-
get_provenance_data_from_machine
(transceiver, placement)[source]¶ Get an iterable of provenance data items
Parameters: - transceiver – the SpinnMan interface object
- placement – the placement of the object
Returns: iterable of ProvenanceDataItem
-
get_recorded_region_ids
()[source]¶ Get the recording region ids that have been recorded using buffering
Returns: The region numbers that have active recording Return type: iterable of int
-
get_recording_region_base_address
(txrx, placement)[source]¶ Get the recording region base address
Parameters: - txrx – the SpiNNMan instance
- placement – the placement object of the core to find the address of
Returns: the base address of the recording region
-
is_in_injection_mode
¶ Whether this vertex is actually in injection mode.
-
mask
¶
-
static
n_regions_to_allocate
(send_buffering, recording)[source]¶ Get the number of regions that will be allocated
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
send_buffer_times
¶
-
send_buffers
¶
-
virtual_key
¶
-
Module contents¶
-
class
spinn_front_end_common.utility_models.
CommandSender
(label, constraints)[source]¶ Bases:
pacman.model.graphs.application.application_vertex.ApplicationVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
A utility for sending commands to a vertex (possibly an external device) at fixed times in the simulation
-
add_commands
(start_resume_commands, pause_stop_commands, timed_commands, vertex_to_send_to)[source]¶ Add commands to be sent down a given edge
Parameters: - start_resume_commands (iterable of
spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand
) – The commands to send when the simulation starts or resumes from pause - pause_stop_commands (iterable of
spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand
) – the commands to send when the simulation stops or pauses after running - timed_commands (iterable of
spinn_front_end_common.utility_models.multi_cast_command.MultiCastCommand
) – The commands to send at specific times - vertex_to_send_to – The vertex these commands are to be sent to
- start_resume_commands (iterable of
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_file_name
()[source]¶ Get the binary name to be run for this vertex
Return type: str Return a string representation of the models binary
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex
Parameters: partition – An edge that comes out of this vertex Returns: A list of constraints Return type: list of pacman.model.constraints.abstract_constraint.AbstractConstraint
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
-
-
class
spinn_front_end_common.utility_models.
CommandSenderMachineVertex
(constraints, resources_required, label, commands_at_start_resume, commands_at_pause_stop, timed_commands)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
-
BINARY_FILE_NAME
= 'command_sender_multicast_source.aplx'¶
-
class
DATA_REGIONS
¶ Bases:
enum.Enum
-
COMMANDS_AT_START_RESUME
= 3¶
-
COMMANDS_AT_STOP_PAUSE
= 4¶
-
COMMANDS_WITH_ARBITRARY_TIMES
= 2¶
-
PROVENANCE_REGION
= 5¶
-
SETUP
= 1¶
-
SYSTEM_REGION
= 0¶
-
-
TOTAL_REQUIRED_MALLOCS
= 5¶
-
generate_data_specification
(spec, placement, machine_time_step, time_scale_factor, n_machine_time_steps)[source]¶
-
get_binary_file_name
()[source]¶ Get the binary name to be run for this vertex
Return type: str Return a string representation of the models binary
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
-
class
spinn_front_end_common.utility_models.
LivePacketGather
(hostname, port, board_address=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, constraints=None, label=None)[source]¶ Bases:
spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,pacman.model.graphs.application.application_vertex.ApplicationVertex
A model which stores all the events it receives during a timer tick and then compresses them into Ethernet packets and sends them out of a spinnaker machine.
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
generate_data_specification
(spec, placement)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
-
-
class
spinn_front_end_common.utility_models.
LivePacketGatherMachineVertex
(label, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, hostname=None, port=None, strip_sdp=None, board_address=None, tag=None, constraints=None)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection
-
N_ADDITIONAL_PROVENANCE_ITEMS
= 2¶
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_provenance_data_from_machine
(transceiver, placement)[source]¶ Get provenance from the machine
Parameters: - transceiver – spinnman interface to the machine
- placement – the location of this vertex on the machine
-
is_in_injection_mode
¶ Whether this vertex is actually in injection mode.
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
-
class
spinn_front_end_common.utility_models.
MultiCastCommand
(key, payload=None, time=None, repeat=0, delay_between_repeats=0)[source]¶ Bases:
object
A command to be sent to a vertex
Parameters: - key (int) – The key of the command
- payload (int) – The payload of the command
- time (int) – The time within the simulation at which to send the command, or None if this is not a timed command
- repeat (int) – The number of times that the command should be repeated after sending it once. This could be used to ensure that the command is sent despite lost packets. Must be between 0 and 65535
- delay_between_repeats (int) – The amount of time in micro seconds to wait between sending repeats of the same command. Must be between 0 and 65535, and must be 0 if repeat is 0
Raises: SpynnakerException – If the repeat or delay are out of range
-
delay_between_repeats
¶
-
is_payload
¶ Determine if this command has a payload. By default, this returns True if the payload passed in to the constructor is not None, but this can be overridden to indicate that a payload will be generated, despite None being passed to the constructor
Returns: True if there is a payload, False otherwise Return type: bool
-
is_timed
¶
-
key
¶
-
payload
¶ Get the payload of the command.
Returns: The payload of the command, or None if there is no payload Return type: int
-
repeat
¶
-
time
¶
-
class
spinn_front_end_common.utility_models.
ReverseIpTagMultiCastSource
(n_keys, label=None, constraints=None, max_atoms_per_core=9223372036854775807, board_address=None, receive_port=None, receive_sdp_port=1, receive_tag=None, receive_rate=10, virtual_key=None, prefix=None, prefix_type=None, check_keys=False, send_buffer_times=None, send_buffer_partition_id=None, send_buffer_max_space=1048576, send_buffer_space_before_notify=640, buffer_notification_ip_address=None, buffer_notification_port=None, buffer_notification_tag=None, reserve_reverse_ip_tag=False)[source]¶ Bases:
pacman.model.graphs.application.application_vertex.ApplicationVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
,spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl
A model which will allow events to be injected into a spinnaker machine and converted into multicast packets.
Parameters: - n_keys – The number of keys to be sent via this multicast source
- label – The label of this vertex
- constraints – Any initial constraints to this vertex
- board_address – The IP address of the board on which to place this vertex if receiving data, either buffered or live (by default, any board is chosen)
- receive_port – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it)
- receive_sdp_port – The SDP port to listen on for incoming event packets (defaults to 1)
- receive_tag – The IP tag to use for receiving live events (uses any by default)
- receive_rate – The estimated rate of packets that will be sent by this source
- virtual_key – The base multicast key to send received events with (assigned automatically by default)
- prefix – The prefix to “or” with generated multicast keys (default is no prefix)
- prefix_type – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
- check_keys – True if the keys of received events should be verified before sending (default False)
- send_buffer_times – An array of arrays of times at which keys should be sent (one array for each key, default disabled)
- send_buffer_partition_id – The id of the partition containing the edges down which the events are to be sent
- send_buffer_max_space – The maximum amount of space to use of the SDRAM on the machine (default is 1MB)
- send_buffer_space_before_notify – The amount of space free in the sending buffer before the machine will ask the host for more data (default setting is optimised for most cases)
- buffer_notification_ip_address – The IP address of the host that will send new buffers (must be specified if a send buffer is specified or if recording will be used)
- buffer_notification_port – The port that the host that will send new buffers is listening on (must be specified if a send buffer is specified, or if recording will be used)
- buffer_notification_tag – The IP tag to use to notify the host about space in the buffer (default is to use any tag)
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice – The slice of atoms that the machine vertex will cover
- resources_required – the resources used by the machine vertex
- constraints – Constraints to be passed on to the machine vertex
-
enable_recording
(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_requests=0)[source]¶
-
generate_data_specification
(spec, placement)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex
Parameters: partition – An edge that comes out of this vertex Returns: A list of constraints Return type: list of pacman.model.constraints.abstract_constraint.AbstractConstraint
-
get_resources_used_by_atoms
(vertex_slice)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice ( pacman.model.graph.slice.Slice
) – the low value of atoms to calculate resources fromReturns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: pacman.model.resources.ResourceContainer Raises: None – this method does not raise any known exception
-
n_atoms
¶ The number of atoms in the vertex
Returns: The number of atoms Return type: int
-
send_buffer_times
¶
-
class
spinn_front_end_common.utility_models.
ReverseIPTagMulticastSourceMachineVertex
(*args, **kwargs)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
,spinn_front_end_common.interface.buffer_management.buffer_models.sends_buffers_from_host_pre_buffered_impl.SendsBuffersFromHostPreBufferedImpl
,spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost
,spinn_front_end_common.abstract_models.abstract_recordable.AbstractRecordable
A model which allows events to be injected into spinnaker and converted in to multicast packets
-
enable_recording
(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_triggers=0)[source]¶ Enable recording of the keys sent
Parameters: - record_buffer_size (int) – The size of the recording buffer in bytes. Note that when using automatic pause and resume, this will be used as the minimum size of the buffer
- buffer_size_before_receive (int) – The size that the buffer can grow to before a read request is issued to the host (in bytes)
- time_between_triggers (int) – The minimum time between the sending of read requests
-
generate_data_specification
(*args, **kwargs)[source]¶ Generate a data specification
Parameters: - spec (
data_specification.DataSpecificationGenerator
) – The data specification to write to - placement – the placement object this spec is associated with
Return type: None
- spec (
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run
Return type: spinn_front_end_common.utilities.utility_objs.executable_start_type.ExecutableStartType
-
get_n_timesteps_in_buffer_space
(buffer_space, machine_time_step)[source]¶ Get the number of timesteps that can be stored fully in the given buffer space in bytes
Parameters: - buffer_space – The buffer space in bytes
- machine_time_step – The size of each time step
Returns: The number of time steps that can be stored in the buffer
Return type: int
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex
Parameters: partition – An edge that comes out of this vertex Returns: A list of constraints Return type: list of pacman.model.constraints.abstract_constraint.AbstractConstraint
-
get_provenance_data_from_machine
(transceiver, placement)[source]¶ Get an iterable of provenance data items
Parameters: - transceiver – the SpinnMan interface object
- placement – the placement of the object
Returns: iterable of ProvenanceDataItem
-
get_recorded_region_ids
()[source]¶ Get the recording region ids that have been recorded using buffering
Returns: The region numbers that have active recording Return type: iterable of int
-
get_recording_region_base_address
(txrx, placement)[source]¶ Get the recording region base address
Parameters: - txrx – the SpiNNMan instance
- placement – the placement object of the core to find the address of
Returns: the base address of the recording region
-
is_in_injection_mode
¶ Whether this vertex is actually in injection mode.
-
mask
¶
-
static
n_regions_to_allocate
(send_buffering, recording)[source]¶ Get the number of regions that will be allocated
-
resources_required
¶ The resources required by the vertex
Return type: pacman.model.resources.ResourceContainer
-
send_buffer_times
¶
-
send_buffers
¶
-
virtual_key
¶
-