aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> 2023-09-04 05:29:03 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-04 14:29:03 +0200
commit0272129f4fa88d083a65f1b302d029a1810d43cf (patch)
tree3de434271fa06fb9f5cf412104987f1cdfb1c1c8 /Source/Particles/PhysicalParticleContainer.cpp
parent01f69c657c401b83fd795686a48a61e45b1a5b6e (diff)
downloadWarpX-0272129f4fa88d083a65f1b302d029a1810d43cf.tar.gz
WarpX-0272129f4fa88d083a65f1b302d029a1810d43cf.tar.zst
WarpX-0272129f4fa88d083a65f1b302d029a1810d43cf.zip
Print resampling message only if `verbose` is on (#4264)
* only print resampling message if `verbose` is on * clang-tidy fix Only use `const` qualification in function definitions, not in function declarations.
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 958c800ff..1358011b9 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -2949,7 +2949,7 @@ PlasmaInjector* PhysicalParticleContainer::GetPlasmaInjector ()
return plasma_injector.get();
}
-void PhysicalParticleContainer::resample (const int timestep)
+void PhysicalParticleContainer::resample (const int timestep, const bool verbose)
{
// In heavily load imbalanced simulations, MPI processes with few particles will spend most of
// the time at the MPI synchronization in TotalNumberOfParticles(). Having two profiler entries
@@ -2967,7 +2967,11 @@ void PhysicalParticleContainer::resample (const int timestep)
WARPX_PROFILE_VAR_START(blp_resample_actual);
if (m_resampler.triggered(timestep, global_numparts))
{
- amrex::Print() << Utils::TextMsg::Info("Resampling " + species_name);
+ if (verbose) {
+ amrex::Print() << Utils::TextMsg::Info(
+ "Resampling " + species_name + " at step " + std::to_string(timestep)
+ );
+ }
for (int lev = 0; lev <= maxLevel(); lev++)
{
for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti)
@@ -2977,7 +2981,6 @@ void PhysicalParticleContainer::resample (const int timestep)
}
}
WARPX_PROFILE_VAR_STOP(blp_resample_actual);
-
}