def get_resources_used_by_atoms(self, vertex_slice, n_machine_time_steps, machine_time_step): # build resources as i currently know container = ResourceContainer( sdram=SDRAMResource(self.get_sdram_usage_for_atoms(vertex_slice)), dtcm=DTCMResource(self.get_dtcm_usage_for_atoms()), cpu_cycles=CPUCyclesPerTickResource( self.get_cpu_usage_for_atoms())) recording_sizes = recording_utilities.get_recording_region_sizes( [ self._spike_recorder.get_sdram_usage_in_bytes( vertex_slice.n_atoms, self._max_spikes_per_ts(vertex_slice, n_machine_time_steps, machine_time_step), self._N_POPULATION_RECORDING_REGIONS) ], n_machine_time_steps, self._minimum_buffer_sdram, self._maximum_sdram_for_buffering, self._using_auto_pause_and_resume) container.extend( recording_utilities.get_recording_resources( recording_sizes, self._receive_buffer_host, self._receive_buffer_port)) return container
def get_resources( n_machine_time_steps, time_step, time_scale_factor, n_samples_per_recording, sampling_frequency): """ Get the resources used by this vertex :return: Resource container """ # pylint: disable=too-many-locals # get config config = globals_variables.get_simulator().config # get recording params minimum_buffer_sdram = config.getint( "Buffers", "minimum_buffer_sdram") using_auto_pause_and_resume = config.getboolean( "Buffers", "use_auto_pause_and_resume") receive_buffer_host = config.get("Buffers", "receive_buffer_host") receive_buffer_port = read_config_int( config, "Buffers", "receive_buffer_port") # figure recording size for max run if not using_auto_pause_and_resume and n_machine_time_steps is None: raise Exception( "You cannot use the chip power montiors without auto pause " "and resume and not allocating a n_machine_time_steps") # figure max buffer size max_buffer_size = 0 if config.getboolean("Buffers", "enable_buffered_recording"): max_buffer_size = config.getint( "Buffers", "chip_power_monitor_buffer") maximum_sdram_for_buffering = [max_buffer_size] n_recording_entries = (math.ceil( (sampling_frequency / (time_step * time_scale_factor))) / n_samples_per_recording) recording_size = ( ChipPowerMonitorMachineVertex.RECORDING_SIZE_PER_ENTRY * n_recording_entries) container = ResourceContainer( sdram=SDRAMResource( ChipPowerMonitorMachineVertex.sdram_calculation()), cpu_cycles=CPUCyclesPerTickResource(100), dtcm=DTCMResource(100)) recording_sizes = recording_utilities.get_recording_region_sizes( [int(recording_size) * n_machine_time_steps], minimum_buffer_sdram, maximum_sdram_for_buffering, using_auto_pause_and_resume) container.extend(recording_utilities.get_recording_resources( recording_sizes, receive_buffer_host, receive_buffer_port)) return container
def get_resources(n_machine_time_steps, time_step, time_scale_factor, n_samples_per_recording, sampling_frequency): """ Get the resources used by this vertex :return: Resource container """ # pylint: disable=too-many-locals # get config config = globals_variables.get_simulator().config # get recording params minimum_buffer_sdram = config.getint("Buffers", "minimum_buffer_sdram") using_auto_pause_and_resume = config.getboolean( "Buffers", "use_auto_pause_and_resume") receive_buffer_host = config.get("Buffers", "receive_buffer_host") receive_buffer_port = read_config_int(config, "Buffers", "receive_buffer_port") # figure recording size for max run if not using_auto_pause_and_resume and n_machine_time_steps is None: raise Exception( "You cannot use the chip power montiors without auto pause " "and resume and not allocating a n_machine_time_steps") # figure max buffer size max_buffer_size = 0 if config.getboolean("Buffers", "enable_buffered_recording"): max_buffer_size = config.getint("Buffers", "chip_power_monitor_buffer") maximum_sdram_for_buffering = [max_buffer_size] n_recording_entries = (math.ceil( (sampling_frequency / (time_step * time_scale_factor))) / n_samples_per_recording) recording_size = ( ChipPowerMonitorMachineVertex.RECORDING_SIZE_PER_ENTRY * n_recording_entries) container = ResourceContainer(sdram=SDRAMResource( ChipPowerMonitorMachineVertex.sdram_calculation()), cpu_cycles=CPUCyclesPerTickResource(100), dtcm=DTCMResource(100)) recording_sizes = recording_utilities.get_recording_region_sizes( [int(recording_size) * n_machine_time_steps], minimum_buffer_sdram, maximum_sdram_for_buffering, using_auto_pause_and_resume) container.extend( recording_utilities.get_recording_resources( recording_sizes, receive_buffer_host, receive_buffer_port)) return container
def get_resources(n_machine_time_steps, time_step, time_scale_factor, n_samples_per_recording, sampling_frequency): """ get resources used by this vertex :return:Resource container """ # get config config = globals_variables.get_simulator().config # get recording params minimum_buffer_sdram = config.getint("Buffers", "minimum_buffer_sdram") using_auto_pause_and_resume = config.getboolean( "Buffers", "use_auto_pause_and_resume") receive_buffer_host = config.get("Buffers", "receive_buffer_host") receive_buffer_port = helpful_functions.read_config_int( config, "Buffers", "receive_buffer_port") # figure max buffer size max_buffer_size = 0 if config.getboolean("Buffers", "enable_buffered_recording"): max_buffer_size = config.getint("Buffers", "spike_buffer_size") maximum_sdram_for_buffering = [max_buffer_size] # figure recording size for max run if n_machine_time_steps is None: n_machine_time_steps = 1. n_recording_entries = math.ceil( (sampling_frequency / (n_machine_time_steps * time_step * time_scale_factor)) / n_samples_per_recording) recording_size = ( ChipPowerMonitorMachineVertex.RECORDING_SIZE_PER_ENTRY * n_recording_entries) container = ResourceContainer(sdram=SDRAMResource( ChipPowerMonitorMachineVertex.sdram_calculation()), cpu_cycles=CPUCyclesPerTickResource(100), dtcm=DTCMResource(100)) recording_sizes = recording_utilities.get_recording_region_sizes( [int(recording_size)], n_machine_time_steps, minimum_buffer_sdram, maximum_sdram_for_buffering, using_auto_pause_and_resume) container.extend( recording_utilities.get_recording_resources( recording_sizes, receive_buffer_host, receive_buffer_port)) return container
def generate_static_resources(self, outgoing_partition_slice, n_machine_time_steps, is_recording_output, n_provenance_items): recording_regions = 0 if is_recording_output: recording_regions += 1 sdram = ( # system region fec_constants.SYSTEM_BYTES_REQUIREMENT + # key region self._sdram_size_in_bytes_for_key_region( outgoing_partition_slice.n_atoms) + # output region self._sdram_size_in_bytes_for_output_region( outgoing_partition_slice.n_atoms, n_machine_time_steps) + # recordings recording_utilities.get_recording_header_size(recording_regions) + # params region (self.NEURON_REGION_ITEMS * constants.BYTE_TO_WORD_MULTIPLIER) + # provenance data region ProvidesProvenanceDataFromMachineImpl.get_provenance_data_size( n_provenance_items)) # the basic sdram basic_res = ResourceContainer(sdram=SDRAMResource(sdram)) # handle buffered recording res recording_sizes = recording_utilities.get_recording_region_sizes( [self._get_buffered_sdram(n_machine_time_steps)], self._minimum_buffer_sdram, self._maximum_sdram_for_buffering, self._using_auto_pause_and_resume) basic_res.extend( recording_utilities.get_recording_resources( recording_sizes, self._receive_buffer_host, self._receive_buffer_port)) return basic_res
def get_resources_used_by_atoms(self, vertex_slice, graph, n_machine_time_steps, machine_time_step): # pylint: disable=arguments-differ # set resources required from this object container = ResourceContainer( sdram=SDRAMResource( self.get_sdram_usage_for_atoms(vertex_slice, graph, machine_time_step)), dtcm=DTCMResource(self.get_dtcm_usage_for_atoms(vertex_slice)), cpu_cycles=CPUCyclesPerTickResource( self.get_cpu_usage_for_atoms(vertex_slice))) recording_sizes = recording_utilities.get_recording_region_sizes( self._get_buffered_sdram(vertex_slice, n_machine_time_steps), self._minimum_buffer_sdram, self._maximum_sdram_for_buffering, self._using_auto_pause_and_resume) container.extend( recording_utilities.get_recording_resources( recording_sizes, self._receive_buffer_host, self._receive_buffer_port)) # return the total resources. return container
def resources_required(self, n_machine_time_steps): container = ResourceContainer( sdram=SDRAMResource( constants.SYSTEM_BYTES_REQUIREMENT + ProvidesProvenanceDataFromMachineImpl.get_provenance_data_size( self.N_LOCAL_PROVENANCE_ITEMS) + ValueSinkMachineVertex.SLICE_DATA_SDRAM_REQUIREMENT + helpful_functions.sdram_size_in_bytes_for_filter_region( self._input_filters) + helpful_functions.sdram_size_in_bytes_for_routing_region( self._input_n_keys) + recording_utilities.get_recording_header_size( self.N_RECORDING_REGIONS)), dtcm=DTCMResource(0), cpu_cycles=CPUCyclesPerTickResource(0)) recording_sizes = recording_utilities.get_recording_region_sizes( [self._get_buffered_sdram(self._input_slice, n_machine_time_steps)], self._minimum_buffer_sdram, self._maximum_sdram_for_buffering, self._using_auto_pause_and_resume) container.extend(recording_utilities.get_recording_resources( recording_sizes, self._receive_buffer_host, self._receive_buffer_port)) return container