aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/BackTransformedDiagnostic.cpp
diff options
context:
space:
mode:
authorGravatar Andrew Myers <atmyers@lbl.gov> 2021-10-18 14:06:08 -0700
committerGravatar GitHub <noreply@github.com> 2021-10-18 14:06:08 -0700
commit2bc1322aa76f7026e5b42639bb3d12125da2407c (patch)
tree7b8dbd4285fea5d47bf2b2b18a24af767342f34a /Source/Diagnostics/BackTransformedDiagnostic.cpp
parent3e9903c07561c24bb8309a7bfa8feeb76ba2eebd (diff)
downloadWarpX-2bc1322aa76f7026e5b42639bb3d12125da2407c.tar.gz
WarpX-2bc1322aa76f7026e5b42639bb3d12125da2407c.tar.zst
WarpX-2bc1322aa76f7026e5b42639bb3d12125da2407c.zip
Option to do single precision mesh communication. (#2294)
* option to use single precision guard cell exhanges * add missing files * fix namespace issue * change precision of comms to float * ParmParse the single_precision_comms flag * set back to real * test * make sure dst is filled * nGrow -> nGrowVect * restore float * don't override valid cells * single precision mesh * whitespace * wrap SumBoundary * Wrap additional uses of FillBoundary. * catch missing copies of ParallelCopy * missing OverrideSyncs * add wrapper for iMultifab * fix typo * moar typos * typo * strip single_precision_mesh option * fix original copy * update fusible syntax Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov> * Fix: Single Precision Builds Should not copy around data for `do_single_precision_comms` * Docs: warpx.do_single_precision_comms * initialize this tmp multifab to 0.0 * fix tiny profile label * remove orig copies, they are only correct for FillBoundary * loosen tolerance for space charge tests for single precision * missing some setVal * another missing setVal * missing setVal * add wrapper for new version of sumboundary * add explicit cast to silence compiler warning * add a test for single precision comms * revert change to test precision * add benchmark for single precision comms test * restore tolerance I removed by mistake * tolerance * copyright headers * drop tolerance for single precision tests in default analysis script * missing python module * bump tol again * fix bad merge * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Remi Lehe <remi.lehe@normalesup.org> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
Diffstat (limited to 'Source/Diagnostics/BackTransformedDiagnostic.cpp')
-rw-r--r--Source/Diagnostics/BackTransformedDiagnostic.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Diagnostics/BackTransformedDiagnostic.cpp b/Source/Diagnostics/BackTransformedDiagnostic.cpp
index 171687942..17b59d3ae 100644
--- a/Source/Diagnostics/BackTransformedDiagnostic.cpp
+++ b/Source/Diagnostics/BackTransformedDiagnostic.cpp
@@ -7,6 +7,7 @@
*/
#include "BackTransformedDiagnostic.H"
+#include "Parallelization/WarpXCommUtil.H"
#include "Utils/WarpXConst.H"
#include "Utils/WarpXProfilerWrapper.H"
#include "WarpX.H"
@@ -757,8 +758,10 @@ void BackTransformedDiagnostic::Flush (const Geometry& /*geom*/)
const int ncomp = lf_diags->m_data_buffer_->nComp();
MultiFab tmp(buff_ba, buff_dm, ncomp, 0);
+ tmp.setVal(0.0);
- tmp.ParallelCopy(*lf_diags->m_data_buffer_, 0, 0, ncomp);
+ WarpXCommUtil::ParallelCopy(tmp, *lf_diags->m_data_buffer_, 0, 0, ncomp,
+ IntVect(AMREX_D_DECL(0, 0, 0)), IntVect(AMREX_D_DECL(0, 0, 0)));
#ifdef WARPX_USE_HDF5
for (int comp = 0; comp < ncomp; ++comp) {
@@ -905,6 +908,7 @@ writeLabFrameData (const MultiFab* cell_centered_data,
tmp_slice_ptr = std::make_unique<MultiFab>(slice_ba,
lf_diags->m_data_buffer_->DistributionMap(),
ncomp, 0);
+ tmp_slice_ptr->setVal(0.0);
// slice is re-used if the t_lab of a diag is equal to
// that of the previous diag.
@@ -912,7 +916,8 @@ writeLabFrameData (const MultiFab* cell_centered_data,
// which has the dmap of the domain to
// tmp_slice_ptr which has the dmap of the
// data_buffer that stores the back-transformed data.
- tmp_slice_ptr->ParallelCopy(*slice, 0, 0, ncomp);
+ WarpXCommUtil::ParallelCopy(*tmp_slice_ptr, *slice, 0, 0, ncomp,
+ IntVect(AMREX_D_DECL(0, 0, 0)), IntVect(AMREX_D_DECL(0, 0, 0)));
lf_diags->AddDataToBuffer(*tmp_slice_ptr, i_lab,
map_actual_fields_to_dump);
tmp_slice_ptr = nullptr;