From a8949f4a948f1330fd7891f867cead1af209ed31 Mon Sep 17 00:00:00 2001 From: AlexanderSinn Date: Wed, 3 Nov 2021 16:32:14 +0100 Subject: [PATCH 1/2] Set verbose level for MG solver --- docs/source/run/parameters.rst | 3 +++ src/Hipace.H | 2 ++ src/Hipace.cpp | 3 +++ 3 files changed, 8 insertions(+) diff --git a/docs/source/run/parameters.rst b/docs/source/run/parameters.rst index bc72103d45..c46ae935dc 100644 --- a/docs/source/run/parameters.rst +++ b/docs/source/run/parameters.rst @@ -161,6 +161,9 @@ Explicit solver parameters * ``hipace.MG_tolerance_abs`` (`float`) optional (default `0.`) Absolute error tolerance of the AMReX multigrid solver. +* ``hipace.MG_verbose`` (`int`) optional (default `1`) + Level of verbosity of the AMReX multigrid solver. + Plasma parameters ----------------- diff --git a/src/Hipace.H b/src/Hipace.H index 0f1e3fd36f..f8b4ce3ccb 100644 --- a/src/Hipace.H +++ b/src/Hipace.H @@ -268,6 +268,8 @@ public: static amrex::Real m_MG_tolerance_rel; /** Absolute tolerance for the multigrid solver, when using the explicit solver */ static amrex::Real m_MG_tolerance_abs; + /** Level of verbosity for the MG solver */ + static int m_MG_verbose; /** Adaptive time step instance */ AdaptiveTimeStep m_adaptive_time_step; /** GridCurrent instance */ diff --git a/src/Hipace.cpp b/src/Hipace.cpp index 6798436249..a5ed8ffeff 100644 --- a/src/Hipace.cpp +++ b/src/Hipace.cpp @@ -45,6 +45,7 @@ amrex::Real Hipace::m_external_Ez_slope = 0.; amrex::Real Hipace::m_external_Ez_uniform = 0.; amrex::Real Hipace::m_MG_tolerance_rel = 1.e-4; amrex::Real Hipace::m_MG_tolerance_abs = 0.; +int Hipace::m_MG_verbose = 1; #ifdef AMREX_USE_GPU bool Hipace::m_do_tiling = false; #else @@ -130,6 +131,7 @@ Hipace::Hipace () : queryWithParser(pph, "MG_tolerance_rel", m_MG_tolerance_rel); queryWithParser(pph, "MG_tolerance_abs", m_MG_tolerance_abs); + queryWithParser(pph, "MG_verbose", m_MG_verbose); queryWithParser(pph, "do_tiling", m_do_tiling); #ifdef AMREX_USE_GPU AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_do_tiling==0, "Tiling must be turned off to run on GPU."); @@ -802,6 +804,7 @@ Hipace::ExplicitSolveBxBy (const int lev) amrex::LinOpBCType::Dirichlet)}); m_mlmg = std::make_unique(*m_mlalaplacian); + m_mlmg->setVerbose(m_MG_verbose); } // BxBy is assumed to have at least one ghost cell in x and y. From a47ea3a15906b4ec6edb6ce1cafa514a088b1c89 Mon Sep 17 00:00:00 2001 From: AlexanderSinn Date: Wed, 3 Nov 2021 17:15:34 +0100 Subject: [PATCH 2/2] set MG verbose default to 0 --- docs/source/run/parameters.rst | 2 +- src/Hipace.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/run/parameters.rst b/docs/source/run/parameters.rst index c46ae935dc..1bf4f72fc8 100644 --- a/docs/source/run/parameters.rst +++ b/docs/source/run/parameters.rst @@ -161,7 +161,7 @@ Explicit solver parameters * ``hipace.MG_tolerance_abs`` (`float`) optional (default `0.`) Absolute error tolerance of the AMReX multigrid solver. -* ``hipace.MG_verbose`` (`int`) optional (default `1`) +* ``hipace.MG_verbose`` (`int`) optional (default `0`) Level of verbosity of the AMReX multigrid solver. Plasma parameters diff --git a/src/Hipace.cpp b/src/Hipace.cpp index a5ed8ffeff..fca1de50c5 100644 --- a/src/Hipace.cpp +++ b/src/Hipace.cpp @@ -45,7 +45,7 @@ amrex::Real Hipace::m_external_Ez_slope = 0.; amrex::Real Hipace::m_external_Ez_uniform = 0.; amrex::Real Hipace::m_MG_tolerance_rel = 1.e-4; amrex::Real Hipace::m_MG_tolerance_abs = 0.; -int Hipace::m_MG_verbose = 1; +int Hipace::m_MG_verbose = 0; #ifdef AMREX_USE_GPU bool Hipace::m_do_tiling = false; #else