From 063a43d60e5717fbab3d6ddeed36914d59147f81 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Sun, 30 Aug 2020 12:16:34 +0200 Subject: [PATCH] minor refactoring --- include/ic_generator.hh | 4 ++-- src/ic_generator.cc | 4 ++-- src/main.cc | 17 ++++++++++------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/ic_generator.hh b/include/ic_generator.hh index 3d5ec28..8524c5d 100644 --- a/include/ic_generator.hh +++ b/include/ic_generator.hh @@ -25,9 +25,9 @@ namespace ic_generator{ - int Run( config_file& the_config ); + int run( config_file& the_config ); - int Initialise( config_file& the_config ); + int initialise( config_file& the_config ); void reset(); diff --git a/src/ic_generator.cc b/src/ic_generator.cc index 8a8d318..aefd5b5 100644 --- a/src/ic_generator.cc +++ b/src/ic_generator.cc @@ -40,7 +40,7 @@ std::unique_ptr the_random_number_generator; std::unique_ptr the_output_plugin; std::unique_ptr the_cosmo_calc; -int Initialise( config_file& the_config ) +int initialise( config_file& the_config ) { the_random_number_generator = std::move(select_RNG_plugin(the_config)); the_output_plugin = std::move(select_output_plugin(the_config)); @@ -55,7 +55,7 @@ void reset () { the_cosmo_calc.reset(); } -int Run( config_file& the_config ) +int run( config_file& the_config ) { //-------------------------------------------------------------------------------------------------------- // Read run parameters diff --git a/src/main.cc b/src/main.cc index 0c244dc..fb22277 100644 --- a/src/main.cc +++ b/src/main.cc @@ -221,12 +221,12 @@ int main( int argc, char** argv ) #else music::ilog << "FFTW_ESTIMATE" << std::endl; #endif - //-------------------------------------------------------------------- + + /////////////////////////////////////////////////////////////////////// // Initialise plug-ins - //-------------------------------------------------------------------- try { - ic_generator::Initialise( the_config ); + ic_generator::initialise( the_config ); }catch(...){ handle_eptr( std::current_exception() ); music::elog << "Problem during initialisation. See error(s) above. Exiting..." << std::endl; @@ -235,17 +235,20 @@ int main( int argc, char** argv ) #endif return 1; } + /////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////// // do the job... - /////////////////////////////////////////////////////////////////////// - ic_generator::Run( the_config ); - - // particle::test_plt(); + ic_generator::run( the_config ); /////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////////// // call the destructor of plugins before tearing down MPI ic_generator::reset(); + /////////////////////////////////////////////////////////////////////// + #if defined(USE_MPI) MPI_Barrier(MPI_COMM_WORLD);