diff --git a/bfps/cpp/full_code/NSVE.cpp b/bfps/cpp/full_code/NSVE.cpp index ce0a95442957c77e80980f34fc8622e3cf60811b..d9cb72a220aaf6cb124cb37f827373f9a44b03ac 100644 --- a/bfps/cpp/full_code/NSVE.cpp +++ b/bfps/cpp/full_code/NSVE.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int NSVE<rnumber>::initialize(void) { + TIMEZONE("NSVE::initialize"); this->read_iteration(); this->read_parameters(); if (this->myrank == 0) @@ -67,6 +68,7 @@ int NSVE<rnumber>::initialize(void) template <typename rnumber> int NSVE<rnumber>::step(void) { + TIMEZONE("NSVE::step"); this->fs->step(this->dt); this->iteration = this->fs->iteration; return EXIT_SUCCESS; @@ -75,6 +77,7 @@ int NSVE<rnumber>::step(void) template <typename rnumber> int NSVE<rnumber>::write_checkpoint(void) { + TIMEZONE("NSVE::write_checkpoint"); this->fs->io_checkpoint(false); this->checkpoint = this->fs->checkpoint; this->write_iteration(); @@ -84,6 +87,7 @@ int NSVE<rnumber>::write_checkpoint(void) template <typename rnumber> int NSVE<rnumber>::finalize(void) { + TIMEZONE("NSVE::finalize"); if (this->myrank == 0) H5Fclose(this->stat_file); delete this->fs; @@ -104,6 +108,7 @@ int NSVE<rnumber>::finalize(void) template <typename rnumber> int NSVE<rnumber>::do_stats() { + TIMEZONE("NSVE::do_stats"); if (!(this->iteration % this->niter_stat == 0)) return EXIT_SUCCESS; hid_t stat_group; @@ -140,6 +145,7 @@ int NSVE<rnumber>::do_stats() template <typename rnumber> int NSVE<rnumber>::read_parameters(void) { + TIMEZONE("NSVE::read_parameters"); this->direct_numerical_simulation::read_parameters(); hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); this->nu = hdf5_tools::read_value<double>(parameter_file, "parameters/nu"); diff --git a/bfps/cpp/full_code/NSVE_field_stats.cpp b/bfps/cpp/full_code/NSVE_field_stats.cpp index 7e33acf93644208d292c5d8df66653f4bb7b806f..15980a20141a563be08ad0b28a3190b3e9e1c17c 100644 --- a/bfps/cpp/full_code/NSVE_field_stats.cpp +++ b/bfps/cpp/full_code/NSVE_field_stats.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int NSVE_field_stats<rnumber>::initialize(void) { + TIMEZONE("NSVE_field_stats::initialize"); this->postprocess::read_parameters(); this->vorticity = new field<rnumber, FFTW, THREE>( nx, ny, nz, @@ -49,6 +50,7 @@ int NSVE_field_stats<rnumber>::initialize(void) template <typename rnumber> int NSVE_field_stats<rnumber>::read_current_cvorticity(void) { + TIMEZONE("NSVE_field_stats::read_current_cvorticity"); this->vorticity->real_space_representation = false; if (this->bin_IO != NULL) { @@ -76,6 +78,7 @@ int NSVE_field_stats<rnumber>::read_current_cvorticity(void) template <typename rnumber> int NSVE_field_stats<rnumber>::finalize(void) { + TIMEZONE("NSVE_field_stats::finalize"); if (this->bin_IO != NULL) delete this->bin_IO; delete this->vorticity; @@ -85,6 +88,7 @@ int NSVE_field_stats<rnumber>::finalize(void) template <typename rnumber> int NSVE_field_stats<rnumber>::work_on_current_iteration(void) { + TIMEZONE("NSVE_field_stats::work_on_current_iteration"); return EXIT_SUCCESS; } diff --git a/bfps/cpp/full_code/NSVE_no_output.hpp b/bfps/cpp/full_code/NSVE_no_output.hpp index b98f89f6de95b806128a0b9d84dc322602234f71..045db08ec74b74206973e0dfbcb30716d62be0de 100644 --- a/bfps/cpp/full_code/NSVE_no_output.hpp +++ b/bfps/cpp/full_code/NSVE_no_output.hpp @@ -1,3 +1,29 @@ +/********************************************************************** +* * +* Copyright 2017 Max Planck Institute * +* for Dynamics and Self-Organization * +* * +* This file is part of bfps. * +* * +* bfps is free software: you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published * +* by the Free Software Foundation, either version 3 of the License, * +* or (at your option) any later version. * +* * +* bfps is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with bfps. If not, see <http://www.gnu.org/licenses/> * +* * +* Contact: Cristian.Lalescu@ds.mpg.de * +* * +**********************************************************************/ + + + #ifndef NSVE_NO_OUTPUT_HPP #define NSVE_NO_OUTPUT_HPP @@ -16,7 +42,8 @@ class NSVE_no_output: public NSVE<rnumber> ~NSVE_no_output(){} int write_checkpoint(void) { - return 0; + TIMEZONE("NSVE_no_output::write_checkpoint"); + return EXIT_SUCCESS; } }; diff --git a/bfps/cpp/full_code/NSVEcomplex_particles.cpp b/bfps/cpp/full_code/NSVEcomplex_particles.cpp index 1e138711b19c9bf686a4cb6dcfe1c79f5c8f59fe..81c6cd5ff37443fb110a0feb46a0858d274d4489 100644 --- a/bfps/cpp/full_code/NSVEcomplex_particles.cpp +++ b/bfps/cpp/full_code/NSVEcomplex_particles.cpp @@ -1,3 +1,29 @@ +/********************************************************************** +* * +* Copyright 2017 Max Planck Institute * +* for Dynamics and Self-Organization * +* * +* This file is part of bfps. * +* * +* bfps is free software: you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published * +* by the Free Software Foundation, either version 3 of the License, * +* or (at your option) any later version. * +* * +* bfps is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with bfps. If not, see <http://www.gnu.org/licenses/> * +* * +* Contact: Cristian.Lalescu@ds.mpg.de * +* * +**********************************************************************/ + + + #include <string> #include <cmath> #include "NSVEcomplex_particles.hpp" @@ -9,6 +35,7 @@ template <typename rnumber> int NSVEcomplex_particles<rnumber>::initialize(void) { + TIMEZONE("NSVEcomplex_particles::initialize"); this->NSVE<rnumber>::initialize(); p2p_computer<double, long long int> current_p2p_computer; @@ -63,6 +90,7 @@ int NSVEcomplex_particles<rnumber>::initialize(void) template <typename rnumber> int NSVEcomplex_particles<rnumber>::step(void) { + TIMEZONE("NSVEcomplex_particles::step"); this->fs->compute_velocity(this->fs->cvorticity); this->fs->cvelocity->ift(); if(enable_vorticity_omega){ @@ -80,6 +108,7 @@ int NSVEcomplex_particles<rnumber>::step(void) template <typename rnumber> int NSVEcomplex_particles<rnumber>::write_checkpoint(void) { + TIMEZONE("NSVEcomplex_particles::write_checkpoint"); this->NSVE<rnumber>::write_checkpoint(); this->particles_output_writer_mpi->open_file(this->fs->get_current_fname()); // TODO P2P write particle data too @@ -96,6 +125,7 @@ int NSVEcomplex_particles<rnumber>::write_checkpoint(void) template <typename rnumber> int NSVEcomplex_particles<rnumber>::finalize(void) { + TIMEZONE("NSVEcomplex_particles::finalize"); delete this->nabla_u; delete this->particles_output_writer_mpi; delete this->particles_sample_writer_mpi; @@ -109,6 +139,7 @@ int NSVEcomplex_particles<rnumber>::finalize(void) template <typename rnumber> int NSVEcomplex_particles<rnumber>::do_stats() { + TIMEZONE("NSVEcomplex_particles::do_stats"); /// perform fluid stats this->NSVE<rnumber>::do_stats(); @@ -194,6 +225,7 @@ int NSVEcomplex_particles<rnumber>::do_stats() template <typename rnumber> int NSVEcomplex_particles<rnumber>::read_parameters(void) { + TIMEZONE("NSVEcomplex_particles::read_parameters"); this->NSVE<rnumber>::read_parameters(); hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part"); diff --git a/bfps/cpp/full_code/NSVEp_extra_sampling.cpp b/bfps/cpp/full_code/NSVEp_extra_sampling.cpp index 3d002d341e26ba547ef4c6ecc47769923e41b8f8..22357510d2683f4a88f4af7a5371d74fdd45043d 100644 --- a/bfps/cpp/full_code/NSVEp_extra_sampling.cpp +++ b/bfps/cpp/full_code/NSVEp_extra_sampling.cpp @@ -5,6 +5,7 @@ template <typename rnumber> int NSVEp_extra_sampling<rnumber>::initialize(void) { + TIMEZONE("NSVEp_extra_sampling::initialize"); this->NSVEparticles<rnumber>::initialize(); /// allocate grad vel field @@ -30,6 +31,7 @@ int NSVEp_extra_sampling<rnumber>::initialize(void) template <typename rnumber> int NSVEp_extra_sampling<rnumber>::finalize(void) { + TIMEZONE("NSVEp_extra_sampling::finalize"); delete this->nabla_u; delete this->pressure; delete this->nabla_p; @@ -41,6 +43,7 @@ int NSVEp_extra_sampling<rnumber>::finalize(void) template <typename rnumber> int NSVEp_extra_sampling<rnumber>::do_stats() { + TIMEZONE("NSVEp_extra_sampling::do_stats"); this->NSVEparticles<rnumber>::do_stats(); if (!(this->iteration % this->niter_part == 0)) return EXIT_SUCCESS; diff --git a/bfps/cpp/full_code/NSVEparticles.cpp b/bfps/cpp/full_code/NSVEparticles.cpp index 78f3d6a02099ba3525187b333a7b4862190ec638..b09e32805bbfb61469926be9f9d1b259066f9080 100644 --- a/bfps/cpp/full_code/NSVEparticles.cpp +++ b/bfps/cpp/full_code/NSVEparticles.cpp @@ -1,3 +1,6 @@ + + + #include <string> #include <cmath> #include "NSVEparticles.hpp" @@ -6,6 +9,7 @@ template <typename rnumber> int NSVEparticles<rnumber>::initialize(void) { + TIMEZONE("NSVEparticles::intialize"); this->NSVE<rnumber>::initialize(); this->pressure = new field<rnumber, FFTW, ONE>( this->fs->cvelocity->rlayout->sizes[2], @@ -45,6 +49,7 @@ int NSVEparticles<rnumber>::initialize(void) template <typename rnumber> int NSVEparticles<rnumber>::step(void) { + TIMEZONE("NSVEparticles::step"); this->fs->compute_velocity(this->fs->cvorticity); this->fs->cvelocity->ift(); this->ps->completeLoop(this->dt); @@ -55,6 +60,7 @@ int NSVEparticles<rnumber>::step(void) template <typename rnumber> int NSVEparticles<rnumber>::write_checkpoint(void) { + TIMEZONE("NSVEparticles::write_checkpoint"); this->NSVE<rnumber>::write_checkpoint(); this->particles_output_writer_mpi->open_file(this->fs->get_current_fname()); this->particles_output_writer_mpi->template save<3>( @@ -70,6 +76,7 @@ int NSVEparticles<rnumber>::write_checkpoint(void) template <typename rnumber> int NSVEparticles<rnumber>::finalize(void) { + TIMEZONE("NSVEparticles::finalize"); delete this->pressure; this->ps.release(); delete this->particles_output_writer_mpi; @@ -84,6 +91,7 @@ int NSVEparticles<rnumber>::finalize(void) template <typename rnumber> int NSVEparticles<rnumber>::do_stats() { + TIMEZONE("NSVEparticles::do_stats"); /// fluid stats go here this->NSVE<rnumber>::do_stats(); @@ -145,6 +153,7 @@ int NSVEparticles<rnumber>::do_stats() template <typename rnumber> int NSVEparticles<rnumber>::read_parameters(void) { + TIMEZONE("NSVEparticles::read_parameters"); this->NSVE<rnumber>::read_parameters(); hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); this->niter_part = hdf5_tools::read_value<int>(parameter_file, "parameters/niter_part"); diff --git a/bfps/cpp/full_code/NSVEparticles_no_output.hpp b/bfps/cpp/full_code/NSVEparticles_no_output.hpp index d3d40139ca80b424d314baadbec5ceb0153061a3..5b9d5e15e00fd1b2d8551995e99e0a157339925c 100644 --- a/bfps/cpp/full_code/NSVEparticles_no_output.hpp +++ b/bfps/cpp/full_code/NSVEparticles_no_output.hpp @@ -16,7 +16,8 @@ class NSVEparticles_no_output: public NSVEparticles<rnumber> ~NSVEparticles_no_output(){} int write_checkpoint(void) { - return 0; + TIMEZONE("NSVEparticles_no_output::write_checkpoint"); + return EXIT_SUCCESS; } }; diff --git a/bfps/cpp/full_code/code_base.cpp b/bfps/cpp/full_code/code_base.cpp index 32fe9c1cf749ad124296ddf759da4014c7243c3b..a6487c726de44b018392128f955ccebf7e7100a1 100644 --- a/bfps/cpp/full_code/code_base.cpp +++ b/bfps/cpp/full_code/code_base.cpp @@ -1,12 +1,42 @@ +/********************************************************************** +* * +* Copyright 2017 Max Planck Institute * +* for Dynamics and Self-Organization * +* * +* This file is part of bfps. * +* * +* bfps is free software: you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published * +* by the Free Software Foundation, either version 3 of the License, * +* or (at your option) any later version. * +* * +* bfps is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with bfps. If not, see <http://www.gnu.org/licenses/> * +* * +* Contact: Cristian.Lalescu@ds.mpg.de * +* * +**********************************************************************/ + + + +#define NDEBUG + #include "code_base.hpp" #include "scope_timer.hpp" + code_base::code_base( const MPI_Comm COMMUNICATOR, const std::string &simulation_name): comm(COMMUNICATOR), simname(simulation_name) { + TIMEZONE("code_base::code_base"); MPI_Comm_rank(this->comm, &this->myrank); MPI_Comm_size(this->comm, &this->nprocs); this->stop_code_now = false; @@ -14,6 +44,7 @@ code_base::code_base( int code_base::check_stopping_condition(void) { + TIMEZONE("code_base::check_stopping_condition"); if (myrank == 0) { std::string fname = ( @@ -36,6 +67,7 @@ int code_base::check_stopping_condition(void) int code_base::read_parameters(void) { + TIMEZONE("code_base::read_parameters"); hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); this->dkx = hdf5_tools::read_value<double>(parameter_file, "parameters/dkx"); this->dky = hdf5_tools::read_value<double>(parameter_file, "parameters/dky"); diff --git a/bfps/cpp/full_code/direct_numerical_simulation.cpp b/bfps/cpp/full_code/direct_numerical_simulation.cpp index f763cde96b0979a7dc9205665378e6fe451233bb..c0b0441e5b274cbe088b6fd0903823c6d17b2076 100644 --- a/bfps/cpp/full_code/direct_numerical_simulation.cpp +++ b/bfps/cpp/full_code/direct_numerical_simulation.cpp @@ -8,6 +8,7 @@ int direct_numerical_simulation::grow_file_datasets() { + TIMEZONE("direct_numerical_simulation::grow_file_datasets"); return hdf5_tools::grow_file_datasets( this->stat_file, "statistics", @@ -16,6 +17,7 @@ int direct_numerical_simulation::grow_file_datasets() int direct_numerical_simulation::read_iteration(void) { + TIMEZONE("direct_numerical_simulation::read_iteration"); /* read iteration */ hid_t dset; hid_t iteration_file = H5Fopen( @@ -56,6 +58,7 @@ int direct_numerical_simulation::read_iteration(void) int direct_numerical_simulation::write_iteration(void) { + TIMEZONE("direct_numerical_simulation::write_iteration"); if (this->myrank == 0) { hid_t dset = H5Dopen( @@ -88,6 +91,7 @@ int direct_numerical_simulation::write_iteration(void) int direct_numerical_simulation::main_loop(void) { + TIMEZONE("direct_numerical_simulation::main_loop"); this->start_simple_timer(); int max_iter = (this->iteration + this->niter_todo - (this->iteration % this->niter_todo)); @@ -119,6 +123,7 @@ int direct_numerical_simulation::main_loop(void) int direct_numerical_simulation::read_parameters(void) { + TIMEZONE("direct_numerical_simulation::read_parameters"); this->code_base::read_parameters(); hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); this->checkpoints_per_file = hdf5_tools::read_value<int>(parameter_file, "parameters/checkpoints_per_file"); diff --git a/bfps/cpp/full_code/field_output_test.cpp b/bfps/cpp/full_code/field_output_test.cpp index f54400647bee3d8b05d7ef4dc58b9a90998ac184..30df4e7512bec3c08325fe156b21789f80882f54 100644 --- a/bfps/cpp/full_code/field_output_test.cpp +++ b/bfps/cpp/full_code/field_output_test.cpp @@ -8,6 +8,7 @@ template <typename rnumber> int field_output_test<rnumber>::initialize(void) { + TIMEZONE("field_output_test::initialize"); this->read_parameters(); return EXIT_SUCCESS; } @@ -15,12 +16,14 @@ int field_output_test<rnumber>::initialize(void) template <typename rnumber> int field_output_test<rnumber>::finalize(void) { + TIMEZONE("field_output_test::finalize"); return EXIT_SUCCESS; } template <typename rnumber> int field_output_test<rnumber>::read_parameters() { + TIMEZONE("field_output_test::read_parameters"); this->test::read_parameters(); return EXIT_SUCCESS; } @@ -28,6 +31,7 @@ int field_output_test<rnumber>::read_parameters() template <typename rnumber> int field_output_test<rnumber>::do_work(void) { + TIMEZONE("field_output_test::do_work"); // allocate field<rnumber, FFTW, ONE> *scal_field = new field<rnumber, FFTW, ONE>( this->nx, this->ny, this->nz, diff --git a/bfps/cpp/full_code/field_single_to_double.cpp b/bfps/cpp/full_code/field_single_to_double.cpp index bb34abd22ca3d629a2b05e1d3e0a94b903010610..92976ecfb3ff32dc798a2f6f4b17bfd44441a158 100644 --- a/bfps/cpp/full_code/field_single_to_double.cpp +++ b/bfps/cpp/full_code/field_single_to_double.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int field_single_to_double<rnumber>::initialize(void) { + TIMEZONE("field_single_to_double::intialize"); this->NSVE_field_stats<rnumber>::initialize(); DEBUG_MSG("after NSVE_field_stats::initialize\n"); this->kk = new kspace<FFTW, SMOOTH>( @@ -47,7 +48,7 @@ int field_single_to_double<rnumber>::initialize(void) template <typename rnumber> int field_single_to_double<rnumber>::work_on_current_iteration(void) { - DEBUG_MSG("entered field_single_to_double::work_on_current_iteration\n"); + TIMEZONE("field_single_to_double::work_on_current_iteration"); this->read_current_cvorticity(); // using CLOOP as opposed to a global std::copy because CLOOP @@ -83,6 +84,7 @@ int field_single_to_double<rnumber>::work_on_current_iteration(void) template <typename rnumber> int field_single_to_double<rnumber>::finalize(void) { + TIMEZONE("field_single_to_double::finalize"); delete this->vec_field_double; delete this->kk; return EXIT_SUCCESS; diff --git a/bfps/cpp/full_code/field_test.cpp b/bfps/cpp/full_code/field_test.cpp index 5c323e547900cc2e52561c0df16748659a7006b6..1627bc4088581468ebedab585db7ca9d6519d3a3 100644 --- a/bfps/cpp/full_code/field_test.cpp +++ b/bfps/cpp/full_code/field_test.cpp @@ -8,6 +8,7 @@ template <typename rnumber> int field_test<rnumber>::initialize(void) { + TIMEZONE("field_test::initialize"); this->read_parameters(); return EXIT_SUCCESS; } @@ -15,23 +16,22 @@ int field_test<rnumber>::initialize(void) template <typename rnumber> int field_test<rnumber>::finalize(void) { + TIMEZONE("field_test::finalize"); + this->read_parameters(); return EXIT_SUCCESS; } template <typename rnumber> int field_test<rnumber>::read_parameters() { + TIMEZONE("field_test::read_parameters"); this->test::read_parameters(); // in case any parameters are needed, this is where they should be read - hid_t parameter_file; - hid_t dset; - parameter_file = H5Fopen( + hid_t parameter_file = H5Fopen( (this->simname + std::string(".h5")).c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); - dset = H5Dopen(parameter_file, "/parameters/filter_length", H5P_DEFAULT); - H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &this->filter_length); - H5Dclose(dset); + this->filter_length = hdf5_tools::read_value<double>(parameter_file, "/parameters/filter_length"); H5Fclose(parameter_file); return EXIT_SUCCESS; } @@ -39,6 +39,7 @@ int field_test<rnumber>::read_parameters() template <typename rnumber> int field_test<rnumber>::do_work(void) { + TIMEZONE("field_test::do_work"); // allocate field<rnumber, FFTW, ONE> *scal_field = new field<rnumber, FFTW, ONE>( this->nx, this->ny, this->nz, diff --git a/bfps/cpp/full_code/filter_test.cpp b/bfps/cpp/full_code/filter_test.cpp index 80c4f83db69106c533e4ef21cecdf5874a24a06e..4db13843fa8f69db77f8a15cbd0563feb087dfcf 100644 --- a/bfps/cpp/full_code/filter_test.cpp +++ b/bfps/cpp/full_code/filter_test.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int filter_test<rnumber>::initialize(void) { + TIMEZONE("filter_test::initialize"); this->read_parameters(); this->scal_field = new field<rnumber, FFTW, ONE>( nx, ny, nz, @@ -30,6 +31,7 @@ int filter_test<rnumber>::initialize(void) template <typename rnumber> int filter_test<rnumber>::finalize(void) { + TIMEZONE("filter_test::finalize"); delete this->scal_field; delete this->kk; return EXIT_SUCCESS; @@ -38,16 +40,13 @@ int filter_test<rnumber>::finalize(void) template <typename rnumber> int filter_test<rnumber>::read_parameters() { + TIMEZONE("filter_test::read_parameters"); this->test::read_parameters(); - hid_t parameter_file; - hid_t dset; - parameter_file = H5Fopen( + hid_t parameter_file = H5Fopen( (this->simname + std::string(".h5")).c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); - dset = H5Dopen(parameter_file, "/parameters/filter_length", H5P_DEFAULT); - H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &this->filter_length); - H5Dclose(dset); + this->filter_length = hdf5_tools::read_value<double>(parameter_file, "/parameters/filter_length"); H5Fclose(parameter_file); return EXIT_SUCCESS; } @@ -56,6 +55,7 @@ template <typename rnumber> int filter_test<rnumber>::reset_field( int dimension) { + TIMEZONE("filter_test::reset_field"); this->scal_field->real_space_representation = true; *this->scal_field = 0.0; if (this->scal_field->rlayout->starts[0] == 0) @@ -95,6 +95,7 @@ int filter_test<rnumber>::reset_field( template <typename rnumber> int filter_test<rnumber>::do_work(void) { + TIMEZONE("filter_test::do_work"); std::string filename = this->simname + std::string("_fields.h5"); for (int dimension = 0; dimension < 3; dimension++) { diff --git a/bfps/cpp/full_code/get_rfields.cpp b/bfps/cpp/full_code/get_rfields.cpp index 3986b5f9de93cdeb83341402750dc05bf7e4b695..5d872b7225c48cb0513b95ee9b9560de27bb54b6 100644 --- a/bfps/cpp/full_code/get_rfields.cpp +++ b/bfps/cpp/full_code/get_rfields.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int get_rfields<rnumber>::initialize(void) { + TIMEZONE("get_rfields::initialize"); this->NSVE_field_stats<rnumber>::initialize(); DEBUG_MSG("after NSVE_field_stats::initialize\n"); this->kk = new kspace<FFTW, SMOOTH>( @@ -42,7 +43,7 @@ int get_rfields<rnumber>::initialize(void) template <typename rnumber> int get_rfields<rnumber>::work_on_current_iteration(void) { - DEBUG_MSG("entered get_rfields::work_on_current_iteration\n"); + TIMEZONE("get_rfields::work_on_current_iteration"); this->read_current_cvorticity(); field<rnumber, FFTW, THREE> *vel = new field<rnumber, FFTW, THREE>( this->nx, this->ny, this->nz, @@ -97,6 +98,7 @@ int get_rfields<rnumber>::work_on_current_iteration(void) template <typename rnumber> int get_rfields<rnumber>::finalize(void) { + TIMEZONE("get_rfields::finalize"); delete this->kk; this->NSVE_field_stats<rnumber>::finalize(); return EXIT_SUCCESS; diff --git a/bfps/cpp/full_code/joint_acc_vel_stats.cpp b/bfps/cpp/full_code/joint_acc_vel_stats.cpp index e4f4d5d40772292f44c7e776dcd4d1b82c4ce222..1c28527e5986e12a5d66151a5623194e4ffab3aa 100644 --- a/bfps/cpp/full_code/joint_acc_vel_stats.cpp +++ b/bfps/cpp/full_code/joint_acc_vel_stats.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int joint_acc_vel_stats<rnumber>::initialize(void) { + TIMEZONE("joint_acc_vel_stats::initialize"); this->NSVE_field_stats<rnumber>::initialize(); this->kk = new kspace<FFTW, SMOOTH>( this->vorticity->clayout, this->dkx, this->dky, this->dkz); @@ -85,7 +86,7 @@ int joint_acc_vel_stats<rnumber>::initialize(void) template <typename rnumber> int joint_acc_vel_stats<rnumber>::work_on_current_iteration(void) { - DEBUG_MSG("entered joint_acc_vel_stats::work_on_current_iteration\n"); + TIMEZONE("joint_acc_vel_stats::work_on_current_iteration"); /// read current vorticity, place it in this->ve->cvorticity this->read_current_cvorticity(); *this->ve->cvorticity = this->vorticity->get_cdata(); @@ -156,6 +157,7 @@ int joint_acc_vel_stats<rnumber>::work_on_current_iteration(void) template <typename rnumber> int joint_acc_vel_stats<rnumber>::finalize(void) { + DEBUG_MSG("entered joint_acc_vel_stats::finalize\n"); delete this->ve; delete this->kk; if (this->myrank == 0) diff --git a/bfps/cpp/full_code/native_binary_to_hdf5.cpp b/bfps/cpp/full_code/native_binary_to_hdf5.cpp index 7774e2dea9012394c389858038e8ca82674256d7..fb5a39c2af8a88a158df679ad27ce0f08fab37f8 100644 --- a/bfps/cpp/full_code/native_binary_to_hdf5.cpp +++ b/bfps/cpp/full_code/native_binary_to_hdf5.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int native_binary_to_hdf5<rnumber>::initialize(void) { + TIMEZONE("native_binary_to_hdf5::initialize"); this->read_parameters(); this->vec_field = new field<rnumber, FFTW, THREE>( nx, ny, nz, @@ -24,6 +25,7 @@ int native_binary_to_hdf5<rnumber>::initialize(void) template <typename rnumber> int native_binary_to_hdf5<rnumber>::work_on_current_iteration(void) { + TIMEZONE("native_binary_to_hdf5::work_on_current_iteration"); char itername[16]; sprintf(itername, "i%.5x", this->iteration); std::string native_binary_fname = ( @@ -45,6 +47,7 @@ int native_binary_to_hdf5<rnumber>::work_on_current_iteration(void) template <typename rnumber> int native_binary_to_hdf5<rnumber>::finalize(void) { + TIMEZONE("native_binary_to_hdf5::finalize"); delete this->bin_IO; delete this->vec_field; return EXIT_SUCCESS; @@ -53,6 +56,7 @@ int native_binary_to_hdf5<rnumber>::finalize(void) template <typename rnumber> int native_binary_to_hdf5<rnumber>::read_parameters(void) { + TIMEZONE("native_binary_to_hdf5::read_parameters"); this->postprocess::read_parameters(); hid_t parameter_file = H5Fopen( (this->simname + std::string(".h5")).c_str(), diff --git a/bfps/cpp/full_code/postprocess.cpp b/bfps/cpp/full_code/postprocess.cpp index 430d87a55fdec51ca145e6ee41d6ed7b3ed73a98..13bee7009e3d8d03e0f2ce10c8a3c1706318b460 100644 --- a/bfps/cpp/full_code/postprocess.cpp +++ b/bfps/cpp/full_code/postprocess.cpp @@ -8,6 +8,7 @@ int postprocess::main_loop(void) { + TIMEZONE("postprocess::main_loop"); this->start_simple_timer(); for (unsigned int iteration_counter = 0; iteration_counter < iteration_list.size(); @@ -33,6 +34,7 @@ int postprocess::main_loop(void) int postprocess::read_parameters() { + TIMEZONE("postprocess::read_parameters"); this->code_base::read_parameters(); hid_t parameter_file = H5Fopen((this->simname + ".h5").c_str(), H5F_ACC_RDONLY, H5P_DEFAULT); this->nu = hdf5_tools::read_value<double>(parameter_file, "parameters/nu"); diff --git a/bfps/cpp/full_code/resize.cpp b/bfps/cpp/full_code/resize.cpp index 41d68ef725ab89c9ad2d55e5f9cc014844294b71..de555a7436786d7ffdfd6a1b7206d74850065b6b 100644 --- a/bfps/cpp/full_code/resize.cpp +++ b/bfps/cpp/full_code/resize.cpp @@ -7,6 +7,7 @@ template <typename rnumber> int resize<rnumber>::initialize(void) { + TIMEZONE("resize::initialize"); this->NSVE_field_stats<rnumber>::initialize(); DEBUG_MSG("after NSVE_field_stats::initialize\n"); hid_t parameter_file = H5Fopen( @@ -46,7 +47,7 @@ int resize<rnumber>::initialize(void) template <typename rnumber> int resize<rnumber>::work_on_current_iteration(void) { - DEBUG_MSG("entered resize::work_on_current_iteration\n"); + TIMEZONE("resize::work_on_current_iteration"); this->read_current_cvorticity(); std::string fname = ( @@ -64,6 +65,7 @@ int resize<rnumber>::work_on_current_iteration(void) template <typename rnumber> int resize<rnumber>::finalize(void) { + TIMEZONE("resize::finalize"); delete this->new_field; this->NSVE_field_stats<rnumber>::finalize(); return EXIT_SUCCESS; diff --git a/bfps/cpp/full_code/symmetrize_test.cpp b/bfps/cpp/full_code/symmetrize_test.cpp index 3b4cd5a5b7304e233735cab87f603b5e164ef0eb..821161da846a323721c07ed47a7c66d9efea78f0 100644 --- a/bfps/cpp/full_code/symmetrize_test.cpp +++ b/bfps/cpp/full_code/symmetrize_test.cpp @@ -8,6 +8,7 @@ template <typename rnumber> int symmetrize_test<rnumber>::initialize(void) { + TIMEZONE("symmetrize_test::initialize"); this->read_parameters(); return EXIT_SUCCESS; } @@ -15,12 +16,14 @@ int symmetrize_test<rnumber>::initialize(void) template <typename rnumber> int symmetrize_test<rnumber>::finalize(void) { + TIMEZONE("symmetrize_test::finalize"); return EXIT_SUCCESS; } template <typename rnumber> int symmetrize_test<rnumber>::read_parameters() { + TIMEZONE("symmetrize_test::read_parameters"); this->test::read_parameters(); hid_t parameter_file = H5Fopen( (this->simname + std::string(".h5")).c_str(), @@ -35,6 +38,7 @@ int symmetrize_test<rnumber>::read_parameters() template <typename rnumber> int symmetrize_test<rnumber>::do_work(void) { + TIMEZONE("symmetrize_test::do_work"); // allocate DEBUG_MSG("about to allocate field0\n"); field<rnumber, FFTW, THREE> *test_field0 = new field<rnumber, FFTW, THREE>( diff --git a/bfps/cpp/full_code/test.cpp b/bfps/cpp/full_code/test.cpp index e382efb45238b621c0b9086d0619d46a9078c61b..aa909362df050c95282fd9c7de66de3d8a1acc34 100644 --- a/bfps/cpp/full_code/test.cpp +++ b/bfps/cpp/full_code/test.cpp @@ -8,9 +8,7 @@ int test::main_loop(void) { - #ifdef USE_TIMINGOUTPUT - TIMEZONE("test::main_loop"); - #endif + TIMEZONE("test::main_loop"); this->start_simple_timer(); this->do_work(); this->print_simple_timer( diff --git a/bfps/cpp/full_code/test_interpolation.cpp b/bfps/cpp/full_code/test_interpolation.cpp index b194d372f6b40916bcd64ff8268a44694b0465d0..5ef11de44b6f6a36ab6827facae3c637b702bc58 100644 --- a/bfps/cpp/full_code/test_interpolation.cpp +++ b/bfps/cpp/full_code/test_interpolation.cpp @@ -4,6 +4,7 @@ template <typename rnumber> int test_interpolation<rnumber>::read_parameters(void) { + TIMEZONE("test_interpolation::read_parameters"); this->test::read_parameters(); hid_t parameter_file = H5Fopen( (this->simname + std::string(".h5")).c_str(), @@ -24,6 +25,7 @@ int test_interpolation<rnumber>::read_parameters(void) template <typename rnumber> int test_interpolation<rnumber>::initialize(void) { + TIMEZONE("test_interpolation::initialize"); this->read_parameters(); this->vorticity = new field<rnumber, FFTW, THREE>( this->nx, this->ny, this->nz, @@ -86,6 +88,7 @@ int test_interpolation<rnumber>::initialize(void) template <typename rnumber> int test_interpolation<rnumber>::finalize(void) { + TIMEZONE("test_interpolation::finalize"); delete this->nabla_u; delete this->velocity; delete this->vorticity; @@ -99,6 +102,7 @@ int test_interpolation<rnumber>::finalize(void) template <typename rnumber> int test_interpolation<rnumber>::do_work() { + TIMEZONE("test_interpolation::do_work"); *this->nabla_u = 0.0; this->velocity->real_space_representation = false; this->vorticity->real_space_representation = false; diff --git a/bfps/cpp/scope_timer.hpp b/bfps/cpp/scope_timer.hpp index 2c48e2eda06ded74e668825181f0444eef22f647..890f522c415d7a102a0fff25c5292502cbcb459c 100644 --- a/bfps/cpp/scope_timer.hpp +++ b/bfps/cpp/scope_timer.hpp @@ -791,7 +791,8 @@ extern EventManager global_timer_manager; #define TIMEZONE(NAME) \ ScopeEvent TIMEZONE_Core_Pre_Merge(____TIMEZONE_AUTO_ID, __LINE__)( \ - NAME, global_timer_manager, ScopeEventUniqueKey); + NAME, global_timer_manager, ScopeEventUniqueKey); \ + DEBUG_MSG((NAME + std::string("\n")).c_str()); #define TIMEZONE_MULTI_REF(NAME) \ ScopeEvent TIMEZONE_Core_Pre_Merge(____TIMEZONE_AUTO_ID, __LINE__)( \ NAME, global_timer_manager, ScopeEventMultiRefKey);