diff --git a/nestkernel/connection_manager.cpp b/nestkernel/connection_manager.cpp index 71a81504c6..838bb66586 100644 --- a/nestkernel/connection_manager.cpp +++ b/nestkernel/connection_manager.cpp @@ -91,9 +91,9 @@ nest::ConnectionManager::~ConnectionManager() } void -nest::ConnectionManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::ConnectionManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { keep_source_table_ = true; connections_have_changed_ = false; diff --git a/nestkernel/event_delivery_manager.cpp b/nestkernel/event_delivery_manager.cpp index fdbf6c3687..4b4adbce45 100644 --- a/nestkernel/event_delivery_manager.cpp +++ b/nestkernel/event_delivery_manager.cpp @@ -76,9 +76,9 @@ EventDeliveryManager::~EventDeliveryManager() } void -EventDeliveryManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +EventDeliveryManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { init_moduli(); reset_timers_for_preparation(); diff --git a/nestkernel/io_manager.cpp b/nestkernel/io_manager.cpp index c8491a336f..9f9647d48f 100644 --- a/nestkernel/io_manager.cpp +++ b/nestkernel/io_manager.cpp @@ -132,9 +132,9 @@ IOManager::set_data_path_prefix_( const DictionaryDatum& dict ) } void -IOManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +IOManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { DictionaryDatum dict( new Dictionary ); // The properties data_path and data_prefix can be set via environment variables diff --git a/nestkernel/kernel_manager.cpp b/nestkernel/kernel_manager.cpp index 2ca78ddba4..63b5937ada 100644 --- a/nestkernel/kernel_manager.cpp +++ b/nestkernel/kernel_manager.cpp @@ -88,7 +88,7 @@ nest::KernelManager::initialize() { for ( auto& manager : managers ) { - manager->initialize( /* adjust_number_of_threads_only */ false ); + manager->initialize( /* adjust_number_of_threads_or_rng_only */ false ); } ++fingerprint_; @@ -122,7 +122,7 @@ nest::KernelManager::finalize() for ( auto&& m_it = managers.rbegin(); m_it != managers.rend(); ++m_it ) { - ( *m_it )->finalize( /* adjust_number_of_threads_only */ false ); + ( *m_it )->finalize( /* adjust_number_of_threads_or_rng_only */ false ); } initialized_ = false; } @@ -147,7 +147,7 @@ nest::KernelManager::change_number_of_threads( size_t new_num_threads ) // Finalize in reverse order of initialization with old thread number set for ( auto mgr_it = managers.rbegin(); mgr_it != managers.rend(); ++mgr_it ) { - ( *mgr_it )->finalize( /* adjust_number_of_threads_or_rng_seed_only */ true ); + ( *mgr_it )->finalize( /* adjust_number_of_threads_or_rng_only */ true ); } vp_manager.set_num_threads( new_num_threads ); @@ -155,7 +155,7 @@ nest::KernelManager::change_number_of_threads( size_t new_num_threads ) // Initialize in original order with new number of threads set for ( auto& manager : managers ) { - manager->initialize( /* adjust_number_of_threads_or_rng_seed_only */ true ); + manager->initialize( /* adjust_number_of_threads_or_rng_only */ true ); } // Finalizing deleted all register components. Now that all infrastructure diff --git a/nestkernel/logging_manager.cpp b/nestkernel/logging_manager.cpp index 82d53c09a9..500290b54e 100644 --- a/nestkernel/logging_manager.cpp +++ b/nestkernel/logging_manager.cpp @@ -42,9 +42,9 @@ nest::LoggingManager::LoggingManager() } void -nest::LoggingManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::LoggingManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { dict_miss_is_error_ = true; } diff --git a/nestkernel/manager_interface.h b/nestkernel/manager_interface.h index 12a453de87..34d7eabb5c 100644 --- a/nestkernel/manager_interface.h +++ b/nestkernel/manager_interface.h @@ -68,12 +68,13 @@ class ManagerInterface * is responsible for calling the initialization routines on the * specific managers in correct order. * - * @param adjust_number_of_threads_only Pass true if calling from kernel_manager::change_number_of_threads() to limit - * operations to those necessary for thread adjustment. + * @param adjust_number_of_threads_or_rng_only Pass true if calling from kernel_manager::change_number_of_threads() + * or RandomManager::get_status() to limit operations to those necessary for thread adjustment or switch or re-seeding + * of RNG. * * @see finalize() */ - virtual void initialize( const bool adjust_number_of_threads_only ) = 0; + virtual void initialize( const bool adjust_number_of_threads_or_rng_only ) = 0; /** * Take down manager after operation. @@ -88,12 +89,12 @@ class ManagerInterface * specific managers in correct order, i.e., the opposite order of * initialize() calls. * - * @param adjust_number_of_threads_only Pass true if calling from kernel_manager::change_number_of_threads() to limit - * operations to those necessary for thread adjustment. + * @param adjust_number_of_threads_or_rng_only Pass true if calling from kernel_manager::change_number_of_threads() + * to limit operations to those necessary for thread adjustment. * * @see initialize() */ - virtual void finalize( const bool adjust_number_of_threads_only ) = 0; + virtual void finalize( const bool adjust_number_of_threads_or_rng_only ) = 0; /** * Set the status of the manager diff --git a/nestkernel/module_manager.cpp b/nestkernel/module_manager.cpp index bf772556b1..57c668da9b 100644 --- a/nestkernel/module_manager.cpp +++ b/nestkernel/module_manager.cpp @@ -61,7 +61,7 @@ ModuleManager::ModuleManager() ModuleManager::~ModuleManager() { - finalize( /* adjust_number_of_threads_or_rng_seed_only */ false ); // closes dynamically loaded modules + finalize( /* adjust_number_of_threads_or_rng_only */ false ); // closes dynamically loaded modules lt_dlexit(); } @@ -71,9 +71,9 @@ ModuleManager::initialize( const bool ) } void -ModuleManager::finalize( const bool adjust_number_of_threads_or_rng_seed_only ) +ModuleManager::finalize( const bool adjust_number_of_threads_or_rng_only ) { - if ( adjust_number_of_threads_or_rng_seed_only ) + if ( adjust_number_of_threads_or_rng_only ) { return; } diff --git a/nestkernel/module_manager.h b/nestkernel/module_manager.h index f4bb9950a0..107ed9ed65 100644 --- a/nestkernel/module_manager.h +++ b/nestkernel/module_manager.h @@ -53,7 +53,7 @@ class ModuleManager : public ManagerInterface void initialize( const bool ) override; //! Unload modules but only on full ResetKernel(), not when just changing then number of threads - void finalize( const bool adjust_number_of_threads_only ) override; + void finalize( const bool adjust_number_of_threads_or_rng_only ) override; //! To be called after change of number of threads to re-register components provided by modules void reinitialize_dynamic_modules(); diff --git a/nestkernel/mpi_manager.cpp b/nestkernel/mpi_manager.cpp index 4e42e9ac29..b7a348322e 100644 --- a/nestkernel/mpi_manager.cpp +++ b/nestkernel/mpi_manager.cpp @@ -178,9 +178,9 @@ nest::MPIManager::init_mpi( int* argc, char** argv[] ) #endif /* #ifdef HAVE_MPI */ void -nest::MPIManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::MPIManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( adjust_number_of_threads_or_rng_seed_only ) + if ( adjust_number_of_threads_or_rng_only ) { return; } diff --git a/nestkernel/music_manager.cpp b/nestkernel/music_manager.cpp index 06d85c837a..827bb7d61f 100644 --- a/nestkernel/music_manager.cpp +++ b/nestkernel/music_manager.cpp @@ -48,9 +48,9 @@ MUSICManager::MUSICManager() } void -MUSICManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +MUSICManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( adjust_number_of_threads_or_rng_seed_only ) + if ( adjust_number_of_threads_or_rng_only ) { return; } diff --git a/nestkernel/node_manager.cpp b/nestkernel/node_manager.cpp index 8661563c6f..5e984ca7fa 100644 --- a/nestkernel/node_manager.cpp +++ b/nestkernel/node_manager.cpp @@ -68,7 +68,7 @@ NodeManager::~NodeManager() } void -NodeManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +NodeManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { // explicitly force construction of wfr_nodes_vec_ to ensure consistent state wfr_network_size_ = 0; @@ -76,7 +76,7 @@ NodeManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) num_thread_local_devices_.resize( kernel().vp_manager.get_num_threads(), 0 ); ensure_valid_thread_local_ids(); - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { sw_construction_create_.reset(); } diff --git a/nestkernel/random_manager.cpp b/nestkernel/random_manager.cpp index 82962ef304..db0a58fd65 100644 --- a/nestkernel/random_manager.cpp +++ b/nestkernel/random_manager.cpp @@ -60,9 +60,9 @@ nest::RandomManager::~RandomManager() } void -nest::RandomManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::RandomManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { register_rng_type< std::mt19937 >( "mt19937" ); register_rng_type< std::mt19937_64 >( "mt19937_64" ); @@ -97,7 +97,7 @@ nest::RandomManager::initialize( const bool adjust_number_of_threads_or_rng_seed } void -nest::RandomManager::finalize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::RandomManager::finalize( const bool adjust_number_of_threads_or_rng_only ) { // Delete existing RNGs auto delete_rngs = []( std::vector< RngPtr >& rng_vec ) @@ -114,7 +114,7 @@ nest::RandomManager::finalize( const bool adjust_number_of_threads_or_rng_seed_o vp_synced_rngs_.clear(); vp_specific_rngs_.clear(); - if ( not adjust_number_of_threads_or_rng_seed_only ) + if ( not adjust_number_of_threads_or_rng_only ) { for ( auto& it : rng_types_ ) { @@ -171,8 +171,8 @@ nest::RandomManager::set_status( const DictionaryDatum& d ) if ( rng_seed_updated or rng_type_updated ) { - finalize( /* adjust_number_of_threads_only */ true ); - initialize( /* adjust_number_of_threads_only */ true ); + finalize( /* adjust_number_of_threads_or_rng_only */ true ); + initialize( /* adjust_number_of_threads_or_rng_only */ true ); } } diff --git a/nestkernel/simulation_manager.cpp b/nestkernel/simulation_manager.cpp index 9d0ae00575..bad0b83e7c 100644 --- a/nestkernel/simulation_manager.cpp +++ b/nestkernel/simulation_manager.cpp @@ -69,9 +69,9 @@ nest::SimulationManager::SimulationManager() } void -nest::SimulationManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::SimulationManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( adjust_number_of_threads_or_rng_seed_only ) + if ( adjust_number_of_threads_or_rng_only ) { return; } diff --git a/nestkernel/sp_manager.cpp b/nestkernel/sp_manager.cpp index c7c3955ccc..52e1f73d29 100644 --- a/nestkernel/sp_manager.cpp +++ b/nestkernel/sp_manager.cpp @@ -51,9 +51,9 @@ SPManager::~SPManager() } void -SPManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +SPManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( adjust_number_of_threads_or_rng_seed_only ) + if ( adjust_number_of_threads_or_rng_only ) { return; } diff --git a/nestkernel/vp_manager.cpp b/nestkernel/vp_manager.cpp index 01e26c5ffc..6ebf211e34 100644 --- a/nestkernel/vp_manager.cpp +++ b/nestkernel/vp_manager.cpp @@ -48,9 +48,9 @@ nest::VPManager::VPManager() } void -nest::VPManager::initialize( const bool adjust_number_of_threads_or_rng_seed_only ) +nest::VPManager::initialize( const bool adjust_number_of_threads_or_rng_only ) { - if ( adjust_number_of_threads_or_rng_seed_only ) + if ( adjust_number_of_threads_or_rng_only ) { return; }