From 2bc1322aa76f7026e5b42639bb3d12125da2407c Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Mon, 18 Oct 2021 14:06:08 -0700 Subject: 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 * 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 Co-authored-by: Remi Lehe Co-authored-by: Axel Huebl Co-authored-by: Weiqun Zhang --- Source/WarpX.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/WarpX.cpp') diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index c9faf6110..7f620e515 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -117,6 +117,7 @@ bool WarpX::do_dive_cleaning = 0; bool WarpX::do_divb_cleaning = 0; int WarpX::em_solver_medium; int WarpX::macroscopic_solver_algo; +int WarpX::do_single_precision_comms=0; amrex::Vector WarpX::field_boundary_lo(AMREX_SPACEDIM,0); amrex::Vector WarpX::field_boundary_hi(AMREX_SPACEDIM,0); amrex::Vector WarpX::particle_boundary_lo(AMREX_SPACEDIM,ParticleBoundaryType::Absorbing); @@ -637,6 +638,15 @@ WarpX::ReadParameters () getArrWithParser(pp_warpx, "mirror_z_npoints", mirror_z_npoints, 0, num_mirrors); } + pp_warpx.query("do_single_precision_comms", do_single_precision_comms); +#ifdef AMREX_USE_FLOAT + if (do_single_precision_comms) { + do_single_precision_comms = 0; + amrex::Warning("\nWARNING: Overwrote warpx.do_single_precision_comms" + " to be 0, since WarpX was built in single precision."); + } +#endif + pp_warpx.query("serialize_ics", serialize_ics); pp_warpx.query("refine_plasma", refine_plasma); pp_warpx.query("do_dive_cleaning", do_dive_cleaning); -- cgit v1.2.3