1
0
Fork 0
mirror of https://github.com/cosmo-sims/monofonIC.git synced 2024-09-19 17:03:45 +02:00

minor refactoring

This commit is contained in:
Oliver Hahn 2020-08-30 12:16:34 +02:00
parent 2a99302172
commit 063a43d60e
3 changed files with 14 additions and 11 deletions

View file

@ -25,9 +25,9 @@
namespace ic_generator{ 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(); void reset();

View file

@ -40,7 +40,7 @@ std::unique_ptr<RNG_plugin> the_random_number_generator;
std::unique_ptr<output_plugin> the_output_plugin; std::unique_ptr<output_plugin> the_output_plugin;
std::unique_ptr<cosmology::calculator> the_cosmo_calc; std::unique_ptr<cosmology::calculator> 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_random_number_generator = std::move(select_RNG_plugin(the_config));
the_output_plugin = std::move(select_output_plugin(the_config)); the_output_plugin = std::move(select_output_plugin(the_config));
@ -55,7 +55,7 @@ void reset () {
the_cosmo_calc.reset(); the_cosmo_calc.reset();
} }
int Run( config_file& the_config ) int run( config_file& the_config )
{ {
//-------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------
// Read run parameters // Read run parameters

View file

@ -221,12 +221,12 @@ int main( int argc, char** argv )
#else #else
music::ilog << "FFTW_ESTIMATE" << std::endl; music::ilog << "FFTW_ESTIMATE" << std::endl;
#endif #endif
//--------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////
// Initialise plug-ins // Initialise plug-ins
//--------------------------------------------------------------------
try try
{ {
ic_generator::Initialise( the_config ); ic_generator::initialise( the_config );
}catch(...){ }catch(...){
handle_eptr( std::current_exception() ); handle_eptr( std::current_exception() );
music::elog << "Problem during initialisation. See error(s) above. Exiting..." << std::endl; music::elog << "Problem during initialisation. See error(s) above. Exiting..." << std::endl;
@ -235,17 +235,20 @@ int main( int argc, char** argv )
#endif #endif
return 1; return 1;
} }
///////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// do the job... // do the job...
/////////////////////////////////////////////////////////////////////// ic_generator::run( the_config );
ic_generator::Run( the_config );
// particle::test_plt();
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// call the destructor of plugins before tearing down MPI // call the destructor of plugins before tearing down MPI
ic_generator::reset(); ic_generator::reset();
///////////////////////////////////////////////////////////////////////
#if defined(USE_MPI) #if defined(USE_MPI)
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);