mirror of
https://github.com/cosmo-sims/monofonIC.git
synced 2024-09-19 17:03:45 +02:00
minor fixes and beautifications
This commit is contained in:
parent
e989fbc1fb
commit
5a621da120
3 changed files with 9 additions and 23 deletions
|
@ -5,8 +5,8 @@ project(fastLPT)
|
|||
# include class submodule
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/external/class.cmake)
|
||||
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -march=native -Wall -fno-omit-frame-pointer -g -fsanitize=address")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native -Wall")
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -march=native -Wall -fno-omit-frame-pointer -g -fsanitize=undefined")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native -Wall -pedantic")
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
set(CMAKE_MODULE_PATH
|
||||
|
@ -61,6 +61,7 @@ file( GLOB PLUGINS
|
|||
)
|
||||
|
||||
add_executable(${PRGNAME} ${SOURCES} ${PLUGINS})
|
||||
target_setup_class(${PRGNAME})
|
||||
|
||||
set_target_properties(${PRGNAME} PROPERTIES CXX_STANDARD 14)
|
||||
|
||||
|
|
21
src/main.cc
21
src/main.cc
|
@ -58,8 +58,8 @@ int main( int argc, char** argv )
|
|||
csoca::ilog << "MPI is enabled : " << "no" << std::endl;
|
||||
#endif
|
||||
|
||||
csoca::ilog << "MPI supports multi-threading : " << CONFIG::MPI_threads_ok << std::endl;
|
||||
csoca::ilog << "FFTW supports multi-threading : " << CONFIG::FFTW_threads_ok << std::endl;
|
||||
csoca::ilog << "MPI supports multi-threading : " << (CONFIG::MPI_threads_ok? "yes" : "no") << std::endl;
|
||||
csoca::ilog << "FFTW supports multi-threading : " << (CONFIG::FFTW_threads_ok? "yes" : "no") << std::endl;
|
||||
csoca::ilog << "Available HW threads / task : " << std::thread::hardware_concurrency() << std::endl;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -89,36 +89,21 @@ int main( int argc, char** argv )
|
|||
const real_t astart = 1.0/(1.0+zstart);
|
||||
const real_t volfac(std::pow(boxlen / ngrid / 2.0 / M_PI, 1.5));
|
||||
const real_t phifac = 1.0 / boxlen / boxlen; // to have potential in box units
|
||||
// const real_t deriv_fac = 1.0 ;//boxlen;
|
||||
|
||||
// real_t Dplus0 = the_config.GetValue<real_t>("setup", "Dplus0");
|
||||
// real_t Ddot0 = 1.0;
|
||||
|
||||
const bool bDoFixing = false;
|
||||
|
||||
|
||||
|
||||
//...
|
||||
const std::string fname_hdf5 = the_config.GetValueSafe<std::string>("output", "fname_hdf5", "output.hdf5");
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::unique_ptr<CosmologyCalculator>
|
||||
the_cosmo_calc;
|
||||
std::unique_ptr<CosmologyCalculator> the_cosmo_calc;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
the_random_number_generator = select_RNG_plugin(the_config);
|
||||
the_transfer_function = select_TransferFunction_plugin(the_config);
|
||||
the_output_plugin = select_output_plugin(the_config);
|
||||
|
||||
the_cosmo_calc = std::make_unique<CosmologyCalculator>(the_config, the_transfer_function);
|
||||
|
||||
// double pnorm = the_cosmo_calc->ComputePNorm();
|
||||
// csoca::ilog << "power spectrum is output for D+ =" << Dplus0 << std::endl;
|
||||
//csoca::ilog << "power spectrum normalisation is " << pnorm << std::endl;
|
||||
//csoca::ilog << "power spectrum normalisation is " << pnorm*Dplus*Dplus << std::endl;
|
||||
|
||||
}catch(...){
|
||||
csoca::elog << "Problem during initialisation. See error(s) above. Exiting..." << std::endl;
|
||||
#if defined(USE_MPI)
|
||||
|
|
|
@ -24,7 +24,7 @@ void print_output_plugins()
|
|||
|
||||
std::map< std::string, output_plugin_creator *>::iterator it;
|
||||
it = m.begin();
|
||||
csoca::ilog << " - Available output plug-ins:\n";
|
||||
csoca::ilog << "Available output plug-ins:\n";
|
||||
while( it!=m.end() )
|
||||
{
|
||||
if( (*it).second )
|
||||
|
@ -43,12 +43,12 @@ output_plugin *select_output_plugin( ConfigFile& cf )
|
|||
|
||||
if( !the_output_plugin_creator )
|
||||
{
|
||||
csoca::elog << " - Error: output plug-in \'" << formatname << "\' not found." << std::endl;
|
||||
csoca::elog << "Error: output plug-in \'" << formatname << "\' not found." << std::endl;
|
||||
print_output_plugins();
|
||||
throw std::runtime_error("Unknown output plug-in");
|
||||
|
||||
}else
|
||||
csoca::ilog << " - Selecting output plug-in \'" << formatname << "\'..." << std::endl;
|
||||
csoca::ilog << "Selecting output plug-in \'" << formatname << "\'..." << std::endl;
|
||||
|
||||
output_plugin *the_output_plugin
|
||||
= the_output_plugin_creator->create( cf );
|
||||
|
|
Loading…
Reference in a new issue