From 69f8b1243c103fa6f6a088b3a3440e9e198af793 Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Tue, 4 Apr 2023 01:08:26 +0200 Subject: [PATCH] reformatted mem+time output --- src/grid_fft.cc | 2 +- src/ic_generator.cc | 20 ++++++++++---------- src/main.cc | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/grid_fft.cc b/src/grid_fft.cc index f2767af..24b52f1 100644 --- a/src/grid_fft.cc +++ b/src/grid_fft.cc @@ -32,7 +32,7 @@ void memory_report(void) curr_mem_high_mark = local_mem_high_mark; #endif if( curr_mem_high_mark > 1.1*global_mem_high_mark ){ - music::ilog << "----mem-> new memory high mark: " << curr_mem_high_mark/(1ull<<20) << " MBytes / task" << std::endl; + music::ilog << std::setw(57) << std::setfill(' ') << std::right << "mem high: " << std::setw(8) << curr_mem_high_mark/(1ull<<20) << " MBytes / task" << std::endl; global_mem_high_mark = curr_mem_high_mark; } } diff --git a/src/ic_generator.cc b/src/ic_generator.cc index 5308fae..6f941f0 100644 --- a/src/ic_generator.cc +++ b/src/ic_generator.cc @@ -357,7 +357,7 @@ int run( config_file& the_config ) music::ilog << "\n>>> Generating LPT fields.... <<<\n" << std::endl; double wtime = get_wtime(); - music::ilog << std::setw(40) << std::setfill('.') << std::left << ">> Computing phi(1) term" << std::endl; + music::ilog << std::setw(79) << std::setfill('.') << std::left << ">> Computing phi(1) term" << std::endl; phi.FourierTransformForward(false); phi.assign_function_of_grids_kdep([&](auto k, auto wn) { @@ -368,7 +368,7 @@ int run( config_file& the_config ) phi.zero_DC_mode(); - music::ilog << "----cpu-> phi(1) took " << get_wtime() - wtime << "s" << std::endl; + music::ilog << std::setw(70) << std::setfill(' ') << std::right << "took : " << std::setw(8) << get_wtime() - wtime << "s" << std::endl; //====================================================================== //... compute 2LPT displacement potential .... @@ -379,7 +379,7 @@ int run( config_file& the_config ) phi2.FourierTransformForward(false); wtime = get_wtime(); - music::ilog << std::setw(40) << std::setfill('.') << std::left << ">> Computing phi(2) term" << std::endl; + music::ilog << std::setw(79) << std::setfill('.') << std::left << ">> Computing phi(2) term" << std::endl; Conv.convolve_SumOfHessians(phi, {0, 0}, phi, {1, 1}, {2, 2}, op::assign_to(phi2)); Conv.convolve_Hessians(phi, {1, 1}, phi, {2, 2}, op::add_to(phi2)); Conv.convolve_Hessians(phi, {0, 1}, phi, {0, 1}, op::subtract_from(phi2)); @@ -398,7 +398,7 @@ int run( config_file& the_config ) } phi2.apply_InverseLaplacian(); - music::ilog << "----cpu-> phi(2) took " << get_wtime() - wtime << "s" << std::endl; + music::ilog << std::setw(70) << std::setfill(' ') << std::right << "took : " << std::setw(8) << get_wtime() - wtime << "s" << std::endl; if (bAddExternalTides) { @@ -419,18 +419,18 @@ int run( config_file& the_config ) //... phi3 = phi3a - 10/7 phi3b //... 3a term ... wtime = get_wtime(); - music::ilog << std::setw(40) << std::setfill('.') << std::left << ">> Computing phi(3a) term" << std::endl; + music::ilog << std::setw(79) << std::setfill('.') << std::left << ">> Computing phi(3a) term" << std::endl; Conv.convolve_Hessians(phi, {0, 0}, phi, {1, 1}, phi, {2, 2}, op::assign_to(phi3)); Conv.convolve_Hessians(phi, {0, 1}, phi, {0, 2}, phi, {1, 2}, op::multiply_add_to(phi3,2.0)); Conv.convolve_Hessians(phi, {1, 2}, phi, {1, 2}, phi, {0, 0}, op::subtract_from(phi3)); Conv.convolve_Hessians(phi, {0, 2}, phi, {0, 2}, phi, {1, 1}, op::subtract_from(phi3)); Conv.convolve_Hessians(phi, {0, 1}, phi, {0, 1}, phi, {2, 2}, op::subtract_from(phi3)); // phi3a.apply_InverseLaplacian(); - music::ilog << "----cpu-> phi(3a) took " << get_wtime() - wtime << "s" << std::endl; + music::ilog << std::setw(70) << std::setfill(' ') << std::right << "took : " << std::setw(8) << get_wtime() - wtime << "s" << std::endl; //... 3b term ... wtime = get_wtime(); - music::ilog << std::setw(40) << std::setfill('.') << std::left << ">> Computing phi(3b) term" << std::endl; + music::ilog << std::setw(71) << std::setfill('.') << std::left << ">> Computing phi(3b) term" << std::endl; Conv.convolve_SumOfHessians(phi, {0, 0}, phi2, {1, 1}, {2, 2}, op::multiply_add_to(phi3,-5.0/7.0)); Conv.convolve_SumOfHessians(phi, {1, 1}, phi2, {2, 2}, {0, 0}, op::multiply_add_to(phi3,-5.0/7.0)); Conv.convolve_SumOfHessians(phi, {2, 2}, phi2, {0, 0}, {1, 1}, op::multiply_add_to(phi3,-5.0/7.0)); @@ -438,11 +438,11 @@ int run( config_file& the_config ) Conv.convolve_Hessians(phi, {0, 2}, phi2, {0, 2}, op::multiply_add_to(phi3,+10.0/7.0)); Conv.convolve_Hessians(phi, {1, 2}, phi2, {1, 2}, op::multiply_add_to(phi3,+10.0/7.0)); phi3.apply_InverseLaplacian(); - music::ilog << "----cpu-> phi(3b) took " << get_wtime() - wtime << "s" << std::endl; + music::ilog << std::setw(70) << std::setfill(' ') << std::right << "took : " << std::setw(8) << get_wtime() - wtime << "s" << std::endl; //... transversal term ... wtime = get_wtime(); - music::ilog << std::setw(40) << std::setfill('.') << std::left << ">> Computing A(3) term" << std::endl; + music::ilog << std::setw(71) << std::setfill('.') << std::left << ">> Computing A(3) term" << std::endl; for (int idim = 0; idim < 3; ++idim) { // cyclic rotations of indices @@ -455,7 +455,7 @@ int run( config_file& the_config ) Conv.convolve_DifferenceOfHessians(phi2, {idimp, idimpp}, phi, {idimp, idimp}, {idimpp, idimpp}, op::subtract_from(*A3[idim])); A3[idim]->apply_InverseLaplacian(); } - music::ilog << "----cpu-> A(3) took " << get_wtime() - wtime << "s" << std::endl; + music::ilog << std::setw(70) << std::setfill(' ') << std::right << "took : " << std::setw(8) << get_wtime() - wtime << "s" << std::endl; } ///... scale all potentials with respective growth factors diff --git a/src/main.cc b/src/main.cc index 381b170..4668964 100644 --- a/src/main.cc +++ b/src/main.cc @@ -273,9 +273,9 @@ int main( int argc, char** argv ) #endif if( peak_mem > (1ull<<30) ) - music::ilog << "----mem-> peak memory usage was " << peak_mem /(1ull<<30) << " GBytes / task" << std::endl; + music::ilog << "Peak memory usage was " << peak_mem /(1ull<<30) << " GBytes / task" << std::endl; else - music::ilog << "----mem-> peak memory usage was " << peak_mem /(1ull<<20) << " MBytes / task" << std::endl; + music::ilog << "Peak memory usage was " << peak_mem /(1ull<<20) << " MBytes / task" << std::endl; #if defined(USE_MPI)