NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::KernelManager Class Reference

Global properties of the simulation kernel. More...

#include <kernel_manager.h>

Collaboration diagram for nest::KernelManager:
[legend]

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 ()
 

Public Attributes

LoggingManager logging_manager
 
MPIManager mpi_manager
 
VPManager vp_manager
 
ModuleManager module_manager
 
RandomManager random_manager
 
SimulationManager simulation_manager
 
ModelRangeManager modelrange_manager
 
ConnectionManager connection_manager
 
SPManager sp_manager
 
EventDeliveryManager event_delivery_manager
 
IOManager io_manager
 
ModelManager model_manager
 
MUSICManager music_manager
 
NodeManager node_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
 

Detailed Description

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:

Time and resolution
Parameters
biological_timeThe current simulation time (in ms).
max_delayThe maximum delay in the network, defaults to 0.1 (in ms).
min_delayThe minimum delay in the network, defaults to 0.1 (in ms).
max_update_timeLongest wall-clock time measured so far for a full update step (in s; read only).
min_update_timeShortest wall-clock time measured so far for a full update step (in s; read only).
ms_per_ticThe number of milliseconds per tic, calculated by ms_per_tic = 1 / tics_per_ms (read only).
resolutionThe resolution of the simulation (in ms), defaults to 0.1.
tics_per_msThe number of tics per millisecond, defaults to 1000.0.
tics_per_stepThe number of tics per simulation time step, calculated by tics_per_step = resolution * tics_per_ms (read only).
to_doThe number of steps yet to be simulated (read only).
T_maxThe largest representable time value (in ms; read only).
T_minThe smallest representable time value (in ms; read only).
update_time_limitMaximum wall-clock time for one full update step (in s; default +infinity).
Parallel processing
Parameters
adaptive_target_buffersWhether MPI buffers for communication of connections resize on the fly, defaults to true.
buffer_size_spike_dataTotal size of MPI buffer for communication of spikes, defaults to 2.
buffer_size_target_dataTotal size of MPI buffer for communication of connections, defaults to 2.
local_num_threadsThe local number of threads, defaults to 1.
num_processesThe number of MPI processes (read only).
off_grid_spikingWhether to transmit precise spike times in MPI communication (read only).
total_num_virtual_procsThe total number of virtual processes, defaults to 1.
use_compressed_spikesWhether to use spike compression, defaults to true.
Random number generators
Parameters
rng_seedSeed value used as basis of seeding of all random number generators managed by the kernel.
rng_typeName of random number generator type used by NEST, defaults to mt19937_64.
rng_typesList of available random number generator types (read only).
Output
Parameters
data_pathA path where all data is written to, defaults to current directory.
data_prefixA common prefix for all data files.
overwrite_filesWhether to overwrite existing data files, defaults to false.
print_timeWhether to print progress information during the simulation, defaults to false.
recording_backendsList of available backends for recording devices (read only).
Network information
Parameters
connection_rulesThe list of available connection rules (read only).
growth_curvesThe list of the available structural plasticity growth curves (read only).
growth_factor_buffer_target_dataIf MPI buffers for communication of connections resize on the fly, grow them by this factor each round, defaults to 1.5.
spike_buffer_grow_extraWhen spike exchange buffer is expanded, resize it to (1 + spike_buffer_grow_extra) * required_buffer_size, defaults to 0.5.
spike_buffer_shrink_limitIf 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_logInformation on spike buffer resizing as dictionary (read only).
keep_source_tableWhether to keep source table after connection setup is complete, defaults to true.
local_spike_counterNumber of spikes fired by neurons on a given MPI rank during the most recent call to Simulate() (read only).
max_num_syn_modelsMaximal number of synapse models supported (read only).
network_sizeThe number of nodes in the network (read only).
node_modelsThe list of available node models (neurons and devices; read only).
num_connectionsThe number of connections in the network (read only; local only).
stimulation_backendsList of available backends for stimulation devices (read only).
structural_plasticity_synapsesDefines all synapses which are plastic for the structural plasticity algorithm.
structural_plasticity_update_intervalDefines the time interval in ms at which the structural plasticity manager will make changes, defaults to 10000.
synapse_modelsThe list of the available synapse models (read only).
Waveform relaxation method (wfr)
Parameters
use_wfrWhether to use waveform relaxation method, defaults to true.
wfr_comm_intervalDesired waveform relaxation communication interval, defaults to 1.0.
wfr_interpolation_orderInterpolation order of polynomial used in wfr iterations, defaults to 3.
wfr_max_iterationsMaximal number of iterations used for waveform relaxation, defaults to 15.
wfr_tolConvergence tolerance of waveform relaxation method, defaults to 0.0001.
Miscellaneous
Parameters
dict_miss_is_errorWhether missed dictionary entries are treated as errors.
build_infoVarious information about the NEST build.
memory_sizeMemory occupied by NEST process in kB (-1 if not available for OS).
See also
Simulate, Node

Constructor & Destructor Documentation

◆ KernelManager() [1/2]

nest::KernelManager::KernelManager ( )
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().

Here is the caller graph for this function:

◆ ~KernelManager()

nest::KernelManager::~KernelManager ( )
private

◆ KernelManager() [2/2]

nest::KernelManager::KernelManager ( KernelManager const &  )
private

Member Function Documentation

◆ change_number_of_threads()

void nest::KernelManager::change_number_of_threads ( size_t  new_num_threads)

◆ cleanup()

void nest::KernelManager::cleanup ( )

References managers.

Referenced by nest::cleanup().

Here is the caller graph for this function:

◆ create_kernel_manager()

void nest::KernelManager::create_kernel_manager ( )
static

Create/destroy and access the KernelManager singleton.

References kernel_manager_instance_, and KernelManager().

Referenced by nest::init_nest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalize()

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().

See also
initialize(), reset()

References dump_, FULL_LOGGING_ONLY, initialized_, and managers.

Referenced by reset().

Here is the caller graph for this function:

◆ get_build_info_()

Dictionary nest::KernelManager::get_build_info_ ( )
private

Referenced by get_status().

Here is the caller graph for this function:

◆ get_fingerprint()

unsigned long nest::KernelManager::get_fingerprint ( ) const
inline

References fingerprint_.

Referenced by nest::NodeCollection::valid().

Here is the caller graph for this function:

◆ get_kernel_manager()

KernelManager & nest::KernelManager::get_kernel_manager ( )
inlinestatic

References kernel_manager_instance_.

Referenced by nest::kernel(), and nest::RecordingBackendMPI::write().

Here is the caller graph for this function:

◆ get_memsize_darwin_()

size_t nest::KernelManager::get_memsize_darwin_ ( ) const
private

return resident_size in kB

Referenced by get_status().

Here is the caller graph for this function:

◆ get_memsize_linux_()

size_t nest::KernelManager::get_memsize_linux_ ( ) const
private

return VmSize in kB

Referenced by get_status().

Here is the caller graph for this function:

◆ get_mpi_synchronization_stopwatch()

Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::MasterOnly > & nest::KernelManager::get_mpi_synchronization_stopwatch ( )
inline

References sw_mpi_synchronization_.

Referenced by nest::EventDeliveryManager::gather_spike_data_().

Here is the caller graph for this function:

◆ get_omp_synchronization_construction_stopwatch()

◆ get_omp_synchronization_simulation_stopwatch()

Stopwatch< StopwatchGranularity::Detailed, StopwatchParallelism::Threaded > & nest::KernelManager::get_omp_synchronization_simulation_stopwatch ( )
inline

Get the stopwatch to measure the time each thread is idle during simulation.

References sw_omp_synchronization_simulation_.

Referenced by nest::SimulationManager::update_().

Here is the caller graph for this function:

◆ get_status()

void nest::KernelManager::get_status ( Dictionary &  dict)

◆ initialize()

void nest::KernelManager::initialize ( )

Prepare kernel for operation.

This method calls the initialization methods of the specific managers in the proper order.

See also
finalize(), reset()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_initialized()

bool nest::KernelManager::is_initialized ( ) const
inline

Returns true if kernel is initialized.

References initialized_.

Referenced by get_status(), and set_status().

Here is the caller graph for this function:

◆ operator=()

void nest::KernelManager::operator= ( KernelManager const &  )
private

◆ prepare()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void nest::KernelManager::reset ( )

Reset kernel.

Resets the kernel by finalizing and initializing all managers.

See also
initialize(), finalize()

References finalize(), and initialize().

Referenced by nest::reset_kernel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_status()

void nest::KernelManager::set_status ( const Dictionary &  dict)

References is_initialized(), and managers.

Referenced by nest::set_kernel_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_to_dump()

void nest::KernelManager::write_to_dump ( const std::string &  msg)

Write data to file per rank and thread.

For use with FULL_LOGGING.

Note
This method has a 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().

Here is the caller graph for this function:

Member Data Documentation

◆ dump_

std::ofstream nest::KernelManager::dump_
private

for FULL_LOGGING output

Referenced by finalize(), initialize(), and write_to_dump().

◆ fingerprint_

unsigned long nest::KernelManager::fingerprint_
private

Referenced by get_fingerprint(), and initialize().

◆ initialized_

bool nest::KernelManager::initialized_
private

true if the kernel is initialized

Referenced by finalize(), initialize(), and is_initialized().

◆ kernel_manager_instance_

KernelManager * nest::KernelManager::kernel_manager_instance_ = nullptr
staticprivate

◆ managers

std::vector< ManagerInterface* > nest::KernelManager::managers
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().

◆ sw_mpi_synchronization_

◆ sw_omp_synchronization_construction_

◆ sw_omp_synchronization_simulation_


The documentation for this class was generated from the following files: