def get_static_sdram_usage(self, vertex_slice): n_record = len(self.__sampling_rates) sdram = ( recording_utilities.get_recording_header_size(n_record) + recording_utilities.get_recording_data_constant_size(n_record) + self.get_sdram_usage_in_bytes(vertex_slice)) return int(sdram)
def get_resources(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 step_in_microseconds = (time_step * time_scale_factor) # The number of sample per step CB believes does not have to be an int samples_per_step = (step_in_microseconds / sampling_frequency) recording_per_step = (samples_per_step / n_samples_per_recording) max_recording_per_step = math.ceil(recording_per_step) overflow_recordings = max_recording_per_step - recording_per_step system = SYSTEM_BYTES_REQUIREMENT config = CONFIG_SIZE_IN_BYTES recording = recording_utilities.get_recording_header_size(1) recording += recording_utilities.get_recording_data_constant_size(1) fixed_sdram = system + config + recording with_overflow = (fixed_sdram + overflow_recordings * RECORDING_SIZE_PER_ENTRY) per_timestep = recording_per_step * RECORDING_SIZE_PER_ENTRY container = ResourceContainer(sdram=VariableSDRAM( with_overflow, per_timestep), cpu_cycles=CPUCyclesPerTickResource(100), dtcm=DTCMResource(100)) return container
def get_resources_used_by_atoms(self, vertex_slice, machine_time_step): """ :param ~pacman.model.graphs.common.Slice vertex_slice: :param int machine_time_step: """ # pylint: disable=arguments-differ poisson_params_sz = self.get_rates_bytes(vertex_slice) other = ConstantSDRAM( SYSTEM_BYTES_REQUIREMENT + SpikeSourcePoissonMachineVertex.get_provenance_data_size(0) + poisson_params_sz + self.tdma_sdram_size_in_bytes + recording_utilities.get_recording_header_size(1) + recording_utilities.get_recording_data_constant_size(1) + profile_utils.get_profile_region_size(self.__n_profile_samples)) recording = self.get_recording_sdram_usage(vertex_slice, machine_time_step) # build resources as i currently know container = ResourceContainer(sdram=recording + other, dtcm=DTCMResource( self.get_dtcm_usage_for_atoms()), cpu_cycles=CPUCyclesPerTickResource( self.get_cpu_usage_for_atoms())) return container
def get_sdram_usage(cls, send_buffer_times, recording_enabled, machine_time_step, receive_rate, n_keys): """ :param send_buffer_times: When events will be sent :type send_buffer_times: ~numpy.ndarray(~numpy.ndarray(numpy.int32)) or list(~numpy.ndarray(numpy.int32)) or None :param bool recording_enabled: Whether recording is done :param int machine_time_step: What the machine timestep is :param float receive_rate: What the expected message receive rate is :param int n_keys: How many keys are being sent :rtype: ~pacman.model.resources.VariableSDRAM """ static_usage = (SYSTEM_BYTES_REQUIREMENT + cls._CONFIGURATION_REGION_SIZE + get_recording_header_size(1) + get_recording_data_constant_size(1) + cls.get_provenance_data_size(0)) per_timestep = ( cls._send_buffer_sdram_per_timestep(send_buffer_times, n_keys) + cls._recording_sdram_per_timestep(machine_time_step, recording_enabled, receive_rate, send_buffer_times, n_keys)) static_usage += per_timestep return VariableSDRAM(static_usage, per_timestep)
def resources_required(self): fixed_sdram = (SYSTEM_BYTES_REQUIREMENT + self.TRANSMISSION_DATA_SIZE + self.STATE_DATA_SIZE + self.NEIGHBOUR_INITIAL_STATES_SIZE + get_recording_header_size(len(Channels)) + get_recording_data_constant_size(len(Channels))) per_timestep_sdram = self.RECORDING_ELEMENT_SIZE return ResourceContainer( sdram=VariableSDRAM(fixed_sdram, per_timestep_sdram))
def resources_required(self): constant_sdram = ( SYSTEM_BYTES_REQUIREMENT + self.TRANSMISSION_REGION_N_BYTES + recording_utilities.get_recording_header_size(1) + recording_utilities.get_recording_data_constant_size(1)) variable_sdram = self.N_RECORDED_PER_TIMESTEP return ResourceContainer(cpu_cycles=CPUCyclesPerTickResource(45), dtcm=DTCMResource(100), sdram=VariableSDRAM(constant_sdram, variable_sdram))
def get_static_sdram_usage(self, vertex_slice): """ :param ~pacman.model.graphs.common.Slice vertex_slice: :rtype: int """ n_record = len(self.__sampling_rates) sdram = (get_recording_header_size(n_record) + get_recording_data_constant_size(n_record) + self.get_sdram_usage_in_bytes(vertex_slice)) return int(sdram)
def resources_required(self, app_graph): out_edges = app_graph.get_edges_starting_at_vertex(self.app_vertex) in_edges = app_graph.get_edges_starting_at_vertex(self.app_vertex) return ResourceContainer(sdram=VariableSDRAM(fixed_sdram=( SIMULATION_N_BYTES + (len(out_edges) * self.SDRAM_PARTITION_BASE_DSG_SIZE) + (len(in_edges) * self.SDRAM_PARTITION_BASE_DSG_SIZE) + (self.SDRAM_PARTITION_COUNTERS * 2) + SARK_PER_MALLOC_SDRAM_USAGE + recording_utilities.get_recording_header_size(len(Channels)) + recording_utilities.get_recording_data_constant_size(len(Channels)) ), per_timestep_sdram=self. RECORDING_ELEMENT_SIZE))
def resources_required(self): """ Reserve resources for data regions """ fixed_sdram = (SYSTEM_BYTES_REQUIREMENT + self.TRANSMISSION_DATA_SIZE + self.POSITION_DATA_SIZE + self.NEIGHBOUR_KEYS_SIZE + self.VELOCITY_SIZE + self.VERTEX_INDEX_SIZE + recording_utilities.get_recording_header_size(1) + recording_utilities.get_recording_data_constant_size(1)) per_timestep_sdram = self.RECORDING_ELEMENT_SIZE return ResourceContainer( sdram=VariableSDRAM(fixed_sdram, per_timestep_sdram))
def _get_sdram_usage_for_atoms(self, vertex_slice, graph, machine_time_step): n_record = len(self.__neuron_impl.get_recordable_variables()) + 1 sdram_requirement = ( common_constants.SYSTEM_BYTES_REQUIREMENT + self._get_sdram_usage_for_neuron_params(vertex_slice) + recording_utilities.get_recording_header_size(n_record) + recording_utilities.get_recording_data_constant_size(n_record) + PopulationMachineVertex.get_provenance_data_size( PopulationMachineVertex.N_ADDITIONAL_PROVENANCE_DATA_ITEMS) + self.__synapse_manager.get_sdram_usage_in_bytes( vertex_slice, graph.get_edges_ending_at_vertex(self), machine_time_step) + profile_utils.get_profile_region_size(self.__n_profile_samples)) return sdram_requirement
def _get_sdram_usage_for_atoms( self, vertex_slice, graph, machine_time_step): n_record = len(self._neuron_impl.get_recordable_variables()) + 1 sdram_requirement = ( common_constants.SYSTEM_BYTES_REQUIREMENT + self._get_sdram_usage_for_neuron_params(vertex_slice) + recording_utilities.get_recording_header_size(n_record) + recording_utilities.get_recording_data_constant_size(n_record) + PopulationMachineVertex.get_provenance_data_size( PopulationMachineVertex.N_ADDITIONAL_PROVENANCE_DATA_ITEMS) + self._synapse_manager.get_sdram_usage_in_bytes( vertex_slice, graph.get_edges_ending_at_vertex(self), machine_time_step) + profile_utils.get_profile_region_size( self._n_profile_samples)) return sdram_requirement
def get_sdram_usage(send_buffer_times, recording_enabled, machine_time_step, receive_rate, n_keys): static_usage = (SYSTEM_BYTES_REQUIREMENT + (ReverseIPTagMulticastSourceMachineVertex. _CONFIGURATION_REGION_SIZE) + get_recording_header_size(1) + get_recording_data_constant_size(1) + (ReverseIPTagMulticastSourceMachineVertex. get_provenance_data_size(0))) per_timestep = ( ReverseIPTagMulticastSourceMachineVertex. send_buffer_sdram_per_timestep(send_buffer_times, n_keys) + ReverseIPTagMulticastSourceMachineVertex. recording_sdram_per_timestep(machine_time_step, recording_enabled, receive_rate, send_buffer_times, n_keys)) static_usage += per_timestep return VariableSDRAM(static_usage, per_timestep)
def get_resources_used_by_atoms(self, vertex_slice, machine_time_step): # pylint: disable=arguments-differ poisson_params_sz = self.get_params_bytes(vertex_slice) other = ConstantSDRAM( SYSTEM_BYTES_REQUIREMENT + SpikeSourcePoissonMachineVertex.get_provenance_data_size(0) + poisson_params_sz + recording_utilities.get_recording_header_size(1) + recording_utilities.get_recording_data_constant_size(1)) recording = self.get_recording_sdram_usage( vertex_slice, machine_time_step) # build resources as i currently know container = ResourceContainer( sdram=recording + other, dtcm=DTCMResource(self.get_dtcm_usage_for_atoms()), cpu_cycles=CPUCyclesPerTickResource( self.get_cpu_usage_for_atoms())) return container
def get_resources_used_by_atoms(self, vertex_slice, machine_time_step): # pylint: disable=arguments-differ poisson_params_sz = self.get_params_bytes(vertex_slice) other = ConstantSDRAM( SYSTEM_BYTES_REQUIREMENT + SpikeSourcePoissonMachineVertex.get_provenance_data_size(0) + poisson_params_sz + recording_utilities.get_recording_header_size(1) + recording_utilities.get_recording_data_constant_size(1)) recording = self.get_recording_sdram_usage(vertex_slice, machine_time_step) # build resources as i currently know container = ResourceContainer(sdram=recording + other, dtcm=DTCMResource( self.get_dtcm_usage_for_atoms()), cpu_cycles=CPUCyclesPerTickResource( self.get_cpu_usage_for_atoms())) return container