Global properties of the simulation kernel. More...
#include <kernel_manager.h>
Public Member Functions | |
| void | initialize () |
| Prepare kernel for operation. | |
| void | finalize () |
| Take down kernel after operation. | |
| void | reset () |
| Reset kernel. | |
| void | change_number_of_threads (size_t new_num_threads) |
| Change number of threads. | |
| void | set_status (const Dictionary &) |
| void | get_status (Dictionary &) |
| void | prepare () |
| void | cleanup () |
| bool | is_initialized () const |
| Returns true if kernel is initialized. | |
| unsigned long | get_fingerprint () const |
| void | write_to_dump (const std::string &msg) |
| Write data to file per rank and thread. | |
| Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::Threaded > & | get_omp_synchronization_construction_stopwatch () |
| Get the stopwatch to measure the time each thread is idle during network construction. | |
| Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::Threaded > & | get_omp_synchronization_simulation_stopwatch () |
| Get the stopwatch to measure the time each thread is idle during simulation. | |
| Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::MasterOnly > & | get_mpi_synchronization_stopwatch () |
Static Public Member Functions | |
| static void | create_kernel_manager () |
| Create/destroy and access the KernelManager singleton. | |
| static KernelManager & | get_kernel_manager () |
Private Member Functions | |
| KernelManager () | |
| ~KernelManager () | |
| KernelManager (KernelManager const &) | |
| void | operator= (KernelManager const &) |
| Dictionary | get_build_info_ () |
| size_t | get_memsize_linux_ () const |
| return VmSize in kB | |
| size_t | get_memsize_darwin_ () const |
| return resident_size in kB | |
Private Attributes | |
| unsigned long | fingerprint_ |
| std::vector< ManagerInterface * > | managers |
| All managers, order determines initialization and finalization order (latter backwards) | |
| bool | initialized_ |
| true if the kernel is initialized | |
| std::ofstream | dump_ |
| for FULL_LOGGING output | |
| Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::Threaded > | sw_omp_synchronization_construction_ |
| Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::Threaded > | sw_omp_synchronization_simulation_ |
| Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::MasterOnly > | sw_mpi_synchronization_ |
Static Private Attributes | |
| static KernelManager * | kernel_manager_instance_ = nullptr |
Global properties of the simulation kernel.
This class provides access to global properties of the simulation kernel.
The following parameters are available in the kernel status dictionary:
| biological_time | The current simulation time (in ms). |
| max_delay | The maximum delay in the network, defaults to 0.1 (in ms). |
| min_delay | The minimum delay in the network, defaults to 0.1 (in ms). |
| max_update_time | Longest wall-clock time measured so far for a full update step (in s; read only). |
| min_update_time | Shortest wall-clock time measured so far for a full update step (in s; read only). |
| ms_per_tic | The number of milliseconds per tic, calculated by ms_per_tic = 1 / tics_per_ms (read only). |
| resolution | The resolution of the simulation (in ms), defaults to 0.1. |
| tics_per_ms | The number of tics per millisecond, defaults to 1000.0. |
| tics_per_step | The number of tics per simulation time step, calculated by tics_per_step = resolution * tics_per_ms (read only). |
| to_do | The number of steps yet to be simulated (read only). |
| T_max | The largest representable time value (in ms; read only). |
| T_min | The smallest representable time value (in ms; read only). |
| update_time_limit | Maximum wall-clock time for one full update step (in s; default +infinity). |
| adaptive_target_buffers | Whether MPI buffers for communication of connections resize on the fly, defaults to true. |
| buffer_size_spike_data | Total size of MPI buffer for communication of spikes, defaults to 2. |
| buffer_size_target_data | Total size of MPI buffer for communication of connections, defaults to 2. |
| local_num_threads | The local number of threads, defaults to 1. |
| num_processes | The number of MPI processes (read only). |
| off_grid_spiking | Whether to transmit precise spike times in MPI communication (read only). |
| total_num_virtual_procs | The total number of virtual processes, defaults to 1. |
| use_compressed_spikes | Whether to use spike compression, defaults to true. |
| rng_seed | Seed value used as basis of seeding of all random number generators managed by the kernel. |
| rng_type | Name of random number generator type used by NEST, defaults to mt19937_64. |
| rng_types | List of available random number generator types (read only). |
| data_path | A path where all data is written to, defaults to current directory. |
| data_prefix | A common prefix for all data files. |
| overwrite_files | Whether to overwrite existing data files, defaults to false. |
| print_time | Whether to print progress information during the simulation, defaults to false. |
| recording_backends | List of available backends for recording devices (read only). |
| connection_rules | The list of available connection rules (read only). |
| growth_curves | The list of the available structural plasticity growth curves (read only). |
| growth_factor_buffer_target_data | If MPI buffers for communication of connections resize on the fly, grow them by this factor each round, defaults to 1.5. |
| spike_buffer_grow_extra | When spike exchange buffer is expanded, resize it to (1 + spike_buffer_grow_extra) * required_buffer_size, defaults to 0.5. |
| spike_buffer_shrink_limit | If largest number of spikes sent from any rank to any rank is less than spike_buffer_shrink_limit * buffer_size, then reduce buffer size. Defaults to 0.2. |
| spike_buffer_resize_log | Information on spike buffer resizing as dictionary (read only). |
| keep_source_table | Whether to keep source table after connection setup is complete, defaults to true. |
| local_spike_counter | Number of spikes fired by neurons on a given MPI rank during the most recent call to Simulate() (read only). |
| max_num_syn_models | Maximal number of synapse models supported (read only). |
| network_size | The number of nodes in the network (read only). |
| node_models | The list of available node models (neurons and devices; read only). |
| num_connections | The number of connections in the network (read only; local only). |
| stimulation_backends | List of available backends for stimulation devices (read only). |
| structural_plasticity_synapses | Defines all synapses which are plastic for the structural plasticity algorithm. |
| structural_plasticity_update_interval | Defines the time interval in ms at which the structural plasticity manager will make changes, defaults to 10000. |
| synapse_models | The list of the available synapse models (read only). |
| use_wfr | Whether to use waveform relaxation method, defaults to true. |
| wfr_comm_interval | Desired waveform relaxation communication interval, defaults to 1.0. |
| wfr_interpolation_order | Interpolation order of polynomial used in wfr iterations, defaults to 3. |
| wfr_max_iterations | Maximal number of iterations used for waveform relaxation, defaults to 15. |
| wfr_tol | Convergence tolerance of waveform relaxation method, defaults to 0.0001. |
| dict_miss_is_error | Whether missed dictionary entries are treated as errors. |
| build_info | Various information about the NEST build. |
| memory_size | Memory occupied by NEST process in kB (-1 if not available for OS). |
|
private |
References connection_manager, event_delivery_manager, io_manager, logging_manager, model_manager, modelrange_manager, module_manager, mpi_manager, music_manager, node_manager, random_manager, simulation_manager, sp_manager, and vp_manager.
Referenced by create_kernel_manager().
|
private |
|
private |
| void nest::KernelManager::change_number_of_threads | ( | size_t | new_num_threads | ) |
Change number of threads.
Set the new number of threads on all managers by calling change_number_of_threads() on each of them.
References connection_manager, event_delivery_manager, nest::ConnectionManager::get_user_set_delay_extrema(), nest::SimulationManager::has_been_simulated(), nest::SPManager::is_structural_plasticity_enabled(), nest::kernel(), managers, module_manager, node_manager, nest::ModuleManager::reinitialize_dynamic_modules(), nest::Stopwatch< detailed_timer, threaded_timer >::reset(), nest::EventDeliveryManager::reset_timers_for_dynamics(), nest::SimulationManager::reset_timers_for_dynamics(), nest::EventDeliveryManager::reset_timers_for_preparation(), nest::SimulationManager::reset_timers_for_preparation(), nest::VPManager::set_num_threads(), simulation_manager, nest::NodeManager::size(), sp_manager, sw_mpi_synchronization_, sw_omp_synchronization_construction_, sw_omp_synchronization_simulation_, and vp_manager.
Referenced by nest::VPManager::set_status().
| void nest::KernelManager::cleanup | ( | ) |
|
static |
Create/destroy and access the KernelManager singleton.
References kernel_manager_instance_, and KernelManager().
Referenced by nest::init_nest().
| void nest::KernelManager::finalize | ( | ) |
Take down kernel after operation.
This method calls the finalization methods of the specific managers in the proper order, i.e., inverse to initialize().
References dump_, FULL_LOGGING_ONLY, initialized_, and managers.
Referenced by reset().
|
private |
|
inline |
References fingerprint_.
Referenced by nest::NodeCollection::valid().
|
inlinestatic |
References kernel_manager_instance_.
Referenced by nest::kernel(), and nest::RecordingBackendMPI::write().
|
private |
|
private |
|
inline |
References sw_mpi_synchronization_.
Referenced by nest::EventDeliveryManager::gather_spike_data_().
|
inline |
Get the stopwatch to measure the time each thread is idle during network construction.
References sw_omp_synchronization_construction_.
Referenced by nest::PerThreadBoolIndicator::all_false(), nest::PerThreadBoolIndicator::all_true(), nest::PerThreadBoolIndicator::any_false(), nest::PerThreadBoolIndicator::any_true(), nest::ConnectionManager::collect_compressed_spike_data(), nest::SourceTable::compute_buffer_pos_for_unique_secondary_sources(), nest::EventDeliveryManager::gather_target_data(), nest::EventDeliveryManager::gather_target_data_compressed(), and nest::SimulationManager::update_connection_infrastructure().
|
inline |
Get the stopwatch to measure the time each thread is idle during simulation.
References sw_omp_synchronization_simulation_.
Referenced by nest::SimulationManager::update_().
| void nest::KernelManager::get_status | ( | Dictionary & | dict | ) |
References get_build_info_(), get_memsize_darwin_(), get_memsize_linux_(), nest::Stopwatch< detailed_timer, threaded_timer >::get_status(), is_initialized(), managers, sw_mpi_synchronization_, sw_omp_synchronization_construction_, sw_omp_synchronization_simulation_, nest::names::time_mpi_synchronization(), nest::names::time_mpi_synchronization_cpu(), nest::names::time_omp_synchronization_construction(), nest::names::time_omp_synchronization_construction_cpu(), nest::names::time_omp_synchronization_simulation(), and nest::names::time_omp_synchronization_simulation_cpu().
Referenced by nest::get_kernel_status().
| void nest::KernelManager::initialize | ( | ) |
Prepare kernel for operation.
This method calls the initialization methods of the specific managers in the proper order.
References dump_, fingerprint_, FULL_LOGGING_ONLY, nest::MPIManager::get_num_processes(), nest::MPIManager::get_rank(), initialized_, managers, mpi_manager, nest::Stopwatch< detailed_timer, threaded_timer >::reset(), sw_mpi_synchronization_, sw_omp_synchronization_construction_, and sw_omp_synchronization_simulation_.
Referenced by nest::init_nest(), and reset().
|
inline |
Returns true if kernel is initialized.
References initialized_.
Referenced by get_status(), and set_status().
|
private |
| void nest::KernelManager::prepare | ( | ) |
References managers, nest::Stopwatch< detailed_timer, threaded_timer >::reset(), sw_mpi_synchronization_, and sw_omp_synchronization_simulation_.
Referenced by nest::prepare().
| void nest::KernelManager::reset | ( | ) |
Reset kernel.
Resets the kernel by finalizing and initializing all managers.
References finalize(), and initialize().
Referenced by nest::reset_kernel().
| void nest::KernelManager::set_status | ( | const Dictionary & | dict | ) |
References is_initialized(), and managers.
Referenced by nest::set_kernel_status().
| void nest::KernelManager::write_to_dump | ( | const std::string & | msg | ) |
Write data to file per rank and thread.
For use with FULL_LOGGING.
omp critical section to avoid write-collisions from threads. References dump_.
Referenced by nest::SourceTable::dump_compressed_spike_data(), nest::SourceTable::dump_compressible_sources(), and nest::SourceTable::dump_sources().
|
private |
for FULL_LOGGING output
Referenced by finalize(), initialize(), and write_to_dump().
|
private |
Referenced by get_fingerprint(), and initialize().
|
private |
true if the kernel is initialized
Referenced by finalize(), initialize(), and is_initialized().
|
staticprivate |
Referenced by create_kernel_manager(), and get_kernel_manager().
|
private |
All managers, order determines initialization and finalization order (latter backwards)
Referenced by change_number_of_threads(), cleanup(), finalize(), get_status(), initialize(), prepare(), and set_status().
|
private |
Referenced by change_number_of_threads(), get_mpi_synchronization_stopwatch(), get_status(), initialize(), and prepare().
|
private |
Referenced by change_number_of_threads(), get_omp_synchronization_construction_stopwatch(), get_status(), and initialize().
|
private |
Referenced by change_number_of_threads(), get_omp_synchronization_simulation_stopwatch(), get_status(), initialize(), and prepare().