From ef636cdb8afe68b980e391cb747ee133eeead61a Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Mon, 31 Jul 2023 19:03:28 -0700 Subject: [PATCH] wip --- .clang-tidy | 3 + Src/Amr/AMReX_Amr.cpp | 4 +- Src/Amr/AMReX_AmrLevel.cpp | 2 +- Src/Amr/AMReX_AuxBoundaryData.cpp | 2 +- Src/Amr/AMReX_StateData.cpp | 4 +- Src/Amr/AMReX_StateDescriptor.cpp | 2 +- Src/AmrCore/AMReX_AmrCore.cpp | 2 +- Src/AmrCore/AMReX_AmrMesh.cpp | 2 +- Src/AmrCore/AMReX_Cluster.cpp | 2 +- Src/AmrCore/AMReX_FillPatchUtil.cpp | 2 +- Src/AmrCore/AMReX_TagBox.cpp | 8 +- Src/Base/AMReX_Algorithm.H | 8 +- Src/Base/AMReX_Arena.cpp | 2 +- Src/Base/AMReX_Array.H | 3 +- Src/Base/AMReX_BCUtil.cpp | 4 +- Src/Base/AMReX_BaseFab.H | 4 +- Src/Base/AMReX_Box.H | 11 +- Src/Base/AMReX_Box.cpp | 4 +- Src/Base/AMReX_BoxArray.cpp | 40 ++-- Src/Base/AMReX_BoxList.cpp | 4 +- Src/Base/AMReX_DistributionMapping.cpp | 2 +- Src/Base/AMReX_FACopyDescriptor.H | 4 +- Src/Base/AMReX_FArrayBox.cpp | 2 +- Src/Base/AMReX_FBI.H | 20 +- Src/Base/AMReX_FabArray.H | 6 +- Src/Base/AMReX_FabArrayBase.cpp | 4 +- Src/Base/AMReX_FabArrayCommI.H | 8 +- Src/Base/AMReX_FabArrayUtility.H | 4 +- Src/Base/AMReX_Geometry.cpp | 2 +- Src/Base/AMReX_GpuAsyncArray.H | 6 +- Src/Base/AMReX_GpuBuffer.H | 4 +- Src/Base/AMReX_GpuContainers.H | 18 +- Src/Base/AMReX_GpuDevice.H | 12 +- Src/Base/AMReX_GpuLaunchFunctsG.H | 44 ++-- Src/Base/AMReX_IArrayBox.cpp | 2 +- Src/Base/AMReX_MFIter.cpp | 4 +- Src/Base/AMReX_MPMD.H | 4 +- Src/Base/AMReX_MemProfiler.cpp | 2 +- Src/Base/AMReX_MultiFab.cpp | 6 +- Src/Base/AMReX_NonLocalBC.cpp | 2 +- Src/Base/AMReX_NonLocalBCImpl.H | 16 +- Src/Base/AMReX_PArena.cpp | 2 +- Src/Base/AMReX_PCI.H | 4 +- Src/Base/AMReX_ParmParse.cpp | 10 +- Src/Base/AMReX_PhysBCFunct.H | 6 +- Src/Base/AMReX_RealBox.H | 2 +- Src/Base/AMReX_Reduce.H | 4 +- Src/Base/AMReX_Scan.H | 18 +- Src/Base/AMReX_TagParallelFor.H | 4 +- Src/Base/AMReX_TinyProfiler.cpp | 6 +- Src/Base/AMReX_Utility.cpp | 2 +- Src/Base/AMReX_Vector.H | 2 +- Src/Base/AMReX_VisMF.cpp | 2 +- Src/Base/AMReX_iMultiFab.cpp | 2 +- Src/Base/Parser/AMReX_Parser_Y.cpp | 2 +- Src/Boundary/AMReX_YAFluxRegister.H | 2 +- Src/EB/AMReX_EB2_GeometryShop.H | 2 +- Src/EB/AMReX_EB2_Level.cpp | 6 +- Src/EB/AMReX_EBFluxRegister.cpp | 2 +- Src/EB/AMReX_EBMultiFabUtil.cpp | 8 +- Src/EB/AMReX_EBToPVD.cpp | 2 +- Src/Extern/HDF5/AMReX_ParticleHDF5.H | 2 +- .../SUNDIALS/AMReX_NVector_MultiFab.cpp | 12 +- Src/Extern/SUNDIALS/AMReX_SUNMemory.cpp | 4 +- .../MLMG/AMReX_MLABecLaplacian.H | 6 +- Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H | 4 +- Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H | 6 +- Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp | 4 +- Src/LinearSolvers/MLMG/AMReX_MLMG.H | 2 +- Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H | 66 +++--- Src/LinearSolvers/MLMG/AMReX_MLNodeLap_3D_K.H | 210 +++++++++--------- Src/LinearSolvers/MLMG/AMReX_MLNodeLap_K.H | 2 +- .../MLMG/AMReX_MLNodeLaplacian.cpp | 2 +- .../MLMG/AMReX_MLNodeLaplacian_eb.cpp | 4 +- .../MLMG/AMReX_MLNodeLaplacian_misc.cpp | 8 +- .../MLMG/AMReX_MLNodeLaplacian_sten.cpp | 2 +- Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp | 2 +- Src/LinearSolvers/MLMG/AMReX_MLPoisson.H | 2 +- Src/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp | 2 +- Src/Particle/AMReX_NeighborParticles.H | 16 +- Src/Particle/AMReX_NeighborParticlesCPUImpl.H | 6 +- Src/Particle/AMReX_NeighborParticlesGPUImpl.H | 4 +- Src/Particle/AMReX_NeighborParticlesI.H | 2 +- Src/Particle/AMReX_ParticleBufferMap.cpp | 10 +- Src/Particle/AMReX_ParticleCommunication.H | 8 +- Src/Particle/AMReX_ParticleCommunication.cpp | 4 +- Src/Particle/AMReX_ParticleContainerI.H | 10 +- Src/Particle/AMReX_ParticleIO.H | 2 +- Src/Particle/AMReX_ParticleLocator.H | 11 +- Src/Particle/AMReX_ParticleMPIUtil.cpp | 2 +- Src/Particle/AMReX_ParticleUtil.H | 6 +- Src/Particle/AMReX_SparseBins.H | 8 +- Src/Particle/AMReX_TracerParticles.cpp | 4 +- .../Advection_AmrCore/Source/AmrCoreAdv.cpp | 2 +- .../Advection_AmrLevel/Source/AmrLevelAdv.cpp | 6 +- Tests/EB/CNS/Source/CNS.cpp | 4 +- Tests/EB_CNS/Source/CNS.cpp | 4 +- Tests/GPU/CNS/Source/CNS.cpp | 4 +- Tools/Plotfile/fcompare.cpp | 2 +- .../Postprocessing/C_Src/particle_compare.cpp | 6 +- 100 files changed, 420 insertions(+), 414 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 02c78387f7f..8e26510a333 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -31,10 +31,13 @@ Checks: > performance-*, portability-*, readability-*, + -readability-else-after-return, -readability-function-cognitive-complexity, -readability-function-size, -readability-identifier-length, + -readability-implicit-bool-conversion, -readability-magic-numbers, + -readability-named-parameter, -readability-simplify-boolean-expr, mpi-* ' diff --git a/Src/Amr/AMReX_Amr.cpp b/Src/Amr/AMReX_Amr.cpp index 56e253b6ece..e5d21c90a1e 100644 --- a/Src/Amr/AMReX_Amr.cpp +++ b/Src/Amr/AMReX_Amr.cpp @@ -103,7 +103,7 @@ Amr::UsingPrecreateDirectories () noexcept void Amr::Initialize () { - if (initialized) return; + if (initialized) { return; } // // Set all defaults here!!! // @@ -2541,7 +2541,7 @@ Amr::regrid (int lbase, { BL_PROFILE("Amr::regrid()"); - if (lbase > std::min(finest_level,max_level-1)) return; + if (lbase > std::min(finest_level,max_level-1)) { return; } if (verbose > 0) amrex::Print() << "Now regridding at level lbase = " << lbase << "\n"; diff --git a/Src/Amr/AMReX_AmrLevel.cpp b/Src/Amr/AMReX_AmrLevel.cpp index 7ef14b505fb..1d1a3ef0f1e 100644 --- a/Src/Amr/AMReX_AmrLevel.cpp +++ b/Src/Amr/AMReX_AmrLevel.cpp @@ -1179,7 +1179,7 @@ FixUpPhysCorners (FArrayBox& fab, const Geometry& TheGeom = TheLevel.Geom(); const Box& ProbDomain = TheState.getDomain(); - if (!HasPhysBndry(fab.box(),ProbDomain,TheGeom)) return; + if (!HasPhysBndry(fab.box(),ProbDomain,TheGeom)) { return; } FArrayBox tmp; diff --git a/Src/Amr/AMReX_AuxBoundaryData.cpp b/Src/Amr/AMReX_AuxBoundaryData.cpp index fb8ffd6743e..361e09fe068 100644 --- a/Src/Amr/AMReX_AuxBoundaryData.cpp +++ b/Src/Amr/AMReX_AuxBoundaryData.cpp @@ -25,7 +25,7 @@ AuxBoundaryData::copy (const AuxBoundaryData& src, int dst_comp, int num_comp) { - if (m_empty || src.m_empty) return; + if (m_empty || src.m_empty) { return; } BL_ASSERT(m_initialized); BL_ASSERT(src_comp + num_comp <= src.m_fabs.nComp()); diff --git a/Src/Amr/AMReX_StateData.cpp b/Src/Amr/AMReX_StateData.cpp index b7429fd33e6..4ab00228181 100644 --- a/Src/Amr/AMReX_StateData.cpp +++ b/Src/Amr/AMReX_StateData.cpp @@ -442,7 +442,7 @@ StateData::FillBoundary (FArrayBox& dest, BL_PROFILE("StateData::FillBoundary(dx)"); BL_ASSERT(dest.box().ixType() == desc->getType()); - if (domain.contains(dest.box())) return; + if (domain.contains(dest.box())) { return; } const Box& bx = dest.box(); const int* dlo = dest.loVect(); @@ -531,7 +531,7 @@ StateData::FillBoundary (Box const& bx, { BL_PROFILE("StateData::FillBoundary(geom)"); - if (domain.contains(convert(bx,domain.ixType()))) return; + if (domain.contains(convert(bx,domain.ixType()))) { return; } Vector bcr(num_comp); diff --git a/Src/Amr/AMReX_StateDescriptor.cpp b/Src/Amr/AMReX_StateDescriptor.cpp index aa9d15445a4..d10758b5909 100644 --- a/Src/Amr/AMReX_StateDescriptor.cpp +++ b/Src/Amr/AMReX_StateDescriptor.cpp @@ -441,7 +441,7 @@ StateDescriptor::setUpMaps (int& use_default_map, icomp++; } - if (use_default_map) return; + if (use_default_map) { return; } maps = new InterpBase*[nmaps]; map_start_comp = new int[nmaps]; diff --git a/Src/AmrCore/AMReX_AmrCore.cpp b/Src/AmrCore/AMReX_AmrCore.cpp index ac35f279b44..502b3f5cb23 100644 --- a/Src/AmrCore/AMReX_AmrCore.cpp +++ b/Src/AmrCore/AMReX_AmrCore.cpp @@ -85,7 +85,7 @@ AmrCore::InitFromScratch (Real time) void AmrCore::regrid (int lbase, Real time, bool) { - if (lbase >= max_level) return; + if (lbase >= max_level) { return; } int new_finest; Vector new_grids(finest_level+2); diff --git a/Src/AmrCore/AMReX_AmrMesh.cpp b/Src/AmrCore/AMReX_AmrMesh.cpp index 46124fee39d..6738877346a 100644 --- a/Src/AmrCore/AMReX_AmrMesh.cpp +++ b/Src/AmrCore/AMReX_AmrMesh.cpp @@ -412,7 +412,7 @@ AmrMesh::GetLevel (Box const& domain) noexcept { Box ccdomain = amrex::enclosedCells(domain); for (int lev = 0; lev < geom.size(); ++lev) { - if (geom[lev].Domain() == ccdomain) return lev; + if (geom[lev].Domain() == ccdomain) { return lev; } } return -1; } diff --git a/Src/AmrCore/AMReX_Cluster.cpp b/Src/AmrCore/AMReX_Cluster.cpp index d9a5a7e80f4..1d06d8741fc 100644 --- a/Src/AmrCore/AMReX_Cluster.cpp +++ b/Src/AmrCore/AMReX_Cluster.cpp @@ -396,7 +396,7 @@ Cluster::new_chop () nlo += hist[dir][i-lo[dir]]; } - if (nlo <= 0 || nlo >= m_len) return chop(); + if (nlo <= 0 || nlo >= m_len) { return chop(); } Long nhi = m_len - nlo; diff --git a/Src/AmrCore/AMReX_FillPatchUtil.cpp b/Src/AmrCore/AMReX_FillPatchUtil.cpp index 84db10d2443..faa05685d11 100644 --- a/Src/AmrCore/AMReX_FillPatchUtil.cpp +++ b/Src/AmrCore/AMReX_FillPatchUtil.cpp @@ -35,7 +35,7 @@ namespace amrex BL_ASSERT(ngrow == fine[idim]->nGrowVect()); } - if (ngrow.max() == 0) return; + if (ngrow.max() == 0) { return; } bool include_periodic = true; bool include_physbndry = false; diff --git a/Src/AmrCore/AMReX_TagBox.cpp b/Src/AmrCore/AMReX_TagBox.cpp index f80daf81265..2d13285ebfa 100644 --- a/Src/AmrCore/AMReX_TagBox.cpp +++ b/Src/AmrCore/AMReX_TagBox.cpp @@ -375,7 +375,7 @@ TagBoxArray::mapPeriodicRemoveDuplicates (const Geometry& geom) void TagBoxArray::local_collate_cpu (Gpu::PinnedVector& v) const { - if (this->local_size() == 0) return; + if (this->local_size() == 0) { return; } Vector count(this->local_size()); #ifdef AMREX_USE_OMP @@ -398,7 +398,7 @@ TagBoxArray::local_collate_cpu (Gpu::PinnedVector& v) const v.resize(offset.back()); - if (v.empty()) return; + if (v.empty()) { return; } #ifdef AMREX_USE_OMP #pragma omp parallel @@ -425,7 +425,7 @@ void TagBoxArray::local_collate_gpu (Gpu::PinnedVector& v) const { const int nfabs = this->local_size(); - if (nfabs == 0) return; + if (nfabs == 0) { return; } constexpr int block_size = 128; Vector nblocks(nfabs); @@ -496,7 +496,7 @@ TagBoxArray::local_collate_gpu (Gpu::PinnedVector& v) const std::partial_sum(hv_ntags.begin(), hv_ntags.end(), hv_tags_offset.begin()+1); int ntotaltags = hv_tags_offset.back(); - if (ntotaltags == 0) return; + if (ntotaltags == 0) { return; } Gpu::NonManagedDeviceVector dv_tags_offset(ntotblocks); int* dp_tags_offset = dv_tags_offset.data(); diff --git a/Src/Base/AMReX_Algorithm.H b/Src/Base/AMReX_Algorithm.H index 510796a861b..b418f3cc1c0 100644 --- a/Src/Base/AMReX_Algorithm.H +++ b/Src/Base/AMReX_Algorithm.H @@ -110,8 +110,8 @@ namespace amrex T flo = f(lo); T fhi = f(hi); - if (flo == T(0)) return flo; - if (fhi == T(0)) return fhi; + if (flo == T(0)) { return flo; } + if (fhi == T(0)) { return fhi; } AMREX_ASSERT_WITH_MESSAGE(flo * fhi <= T(0), "Error - calling bisect but lo and hi don't bracket a root."); @@ -121,10 +121,10 @@ namespace amrex int n = 1; while (n <= max_iter) { - if (hi - lo < tol || almostEqual(lo,hi)) break; + if (hi - lo < tol || almostEqual(lo,hi)) { break; } mi = (lo + hi) / T(2); fmi = f(mi); - if (fmi == T(0)) break; + if (fmi == T(0)) { break; } fmi*flo < T(0) ? hi = mi : lo = mi; flo = f(lo); fhi = f(hi); diff --git a/Src/Base/AMReX_Arena.cpp b/Src/Base/AMReX_Arena.cpp index d18fa0dd5d5..435406deac9 100644 --- a/Src/Base/AMReX_Arena.cpp +++ b/Src/Base/AMReX_Arena.cpp @@ -265,7 +265,7 @@ namespace { void Arena::Initialize () { - if (initialized) return; + if (initialized) { return; } initialized = true; // see reason on allowed reuse of the default CPU BArena in Arena::Finalize diff --git a/Src/Base/AMReX_Array.H b/Src/Base/AMReX_Array.H index c9a3eb63a56..6efef8e8f22 100644 --- a/Src/Base/AMReX_Array.H +++ b/Src/Base/AMReX_Array.H @@ -103,7 +103,7 @@ namespace amrex { */ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void fill ( const T& value ) noexcept - { for (unsigned int i = 0; i < N; ++i) arr[i] = value; } + { for (unsigned int i = 0; i < N; ++i) { arr[i] = value; } } /** * Returns the sum of all elements in the GpuArray object. @@ -897,4 +897,3 @@ namespace amrex } #endif - diff --git a/Src/Base/AMReX_BCUtil.cpp b/Src/Base/AMReX_BCUtil.cpp index ff17bd4e244..c0a645ba05c 100644 --- a/Src/Base/AMReX_BCUtil.cpp +++ b/Src/Base/AMReX_BCUtil.cpp @@ -35,8 +35,8 @@ struct dummy_gpu_fill_extdir void FillDomainBoundary (MultiFab& phi, const Geometry& geom, const Vector& bc) { - if (geom.isAllPeriodic()) return; - if (phi.nGrow() == 0) return; + if (geom.isAllPeriodic()) { return; } + if (phi.nGrow() == 0) { return; } AMREX_ALWAYS_ASSERT(phi.ixType().cellCentered()); diff --git a/Src/Base/AMReX_BaseFab.H b/Src/Base/AMReX_BaseFab.H index 960f1078e18..2d6dcd0ca32 100644 --- a/Src/Base/AMReX_BaseFab.H +++ b/Src/Base/AMReX_BaseFab.H @@ -1895,7 +1895,7 @@ BaseFab::define () AMREX_ASSERT(this->dptr == nullptr); AMREX_ASSERT(this->domain.numPts() > 0); AMREX_ASSERT(this->nvar >= 0); - if (this->nvar == 0) return; + if (this->nvar == 0) { return; } AMREX_ASSERT(std::numeric_limits::max()/this->nvar > this->domain.numPts()); this->truesize = this->nvar*this->domain.numPts(); @@ -2590,7 +2590,7 @@ BaseFab::indexFromValue (Box const& subbox, int comp, T const& value) const n { AMREX_LOOP_3D(subbox, i, j, k, { - if (a(i,j,k) == value) return IntVect(AMREX_D_DECL(i,j,k)); + if (a(i,j,k) == value) { return IntVect(AMREX_D_DECL(i,j,k)); } }); return IntVect::TheMinVector(); } diff --git a/Src/Base/AMReX_Box.H b/Src/Base/AMReX_Box.H index 025c4b90c45..0a32d637d4f 100644 --- a/Src/Base/AMReX_Box.H +++ b/Src/Base/AMReX_Box.H @@ -636,10 +636,11 @@ public: AMREX_GPU_HOST_DEVICE Box& grow (Orientation face, int n_cell = 1) noexcept { int idir = face.coordDir(); - if (face.isLow()) + if (face.isLow()) { smallend.shift(idir, -n_cell); - else + } else { bigend.shift(idir,n_cell); + } return *this; } @@ -800,9 +801,11 @@ Box::coarsen (const IntVect& ref_ratio) noexcept IntVect off(0); for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { - if (btype[dir]) - if (bigend[dir]%ref_ratio[dir]) + if (btype[dir]) { + if (bigend[dir]%ref_ratio[dir]) { off.setVal(dir,1); + } + } } bigend.coarsen(ref_ratio); bigend += off; diff --git a/Src/Base/AMReX_Box.cpp b/Src/Base/AMReX_Box.cpp index 0b2560749b5..6fbb15184fa 100644 --- a/Src/Base/AMReX_Box.cpp +++ b/Src/Base/AMReX_Box.cpp @@ -123,7 +123,7 @@ AllGatherBoxes (Vector& bxs, int n_extra_reserve) count_tot += countvec[i]; } - if (count_tot == 0) return; + if (count_tot == 0) { return; } if (count_tot > static_cast(std::numeric_limits::max())) { amrex::Abort("AllGatherBoxes: too many boxes"); @@ -158,7 +158,7 @@ AllGatherBoxes (Vector& bxs, int n_extra_reserve) MPI_Bcast(&count_tot, 1, MPI_INT, root, comm); - if (count_tot == 0) return; + if (count_tot == 0) { return; } if (count_tot > static_cast(std::numeric_limits::max())) { amrex::Abort("AllGatherBoxes: too many boxes"); diff --git a/Src/Base/AMReX_BoxArray.cpp b/Src/Base/AMReX_BoxArray.cpp index 8dfbd2b6379..40f258ca96e 100644 --- a/Src/Base/AMReX_BoxArray.cpp +++ b/Src/Base/AMReX_BoxArray.cpp @@ -518,9 +518,9 @@ BoxArray::operator!= (const BoxArray& rhs) const noexcept bool BoxArray::operator== (const Vector& bv) const noexcept { - if (size() != bv.size()) return false; + if (size() != bv.size()) { return false; } for (int i = 0; i < static_cast(size()); ++i) { - if (this->operator[](i) != bv[i]) return false; + if (this->operator[](i) != bv[i]) { return false; } } return true; } @@ -601,11 +601,11 @@ bool BoxArray::coarsenable (const IntVect& refinement_ratio, const IntVect& min_width) const { const Long sz = size(); - if(size() == 0) return false; + if(size() == 0) { return false; } const Box& first = (*this)[0]; bool res = first.coarsenable(refinement_ratio,min_width); - if (res == false) return false; + if (res == false) { return false; } auto const& bxs = this->m_ref->m_abox; if (m_bat.is_null()) { @@ -873,17 +873,17 @@ BoxArray::ok () const auto const& bxs = this->m_ref->m_abox; if (m_bat.is_null()) { for (int i = 0; i < N; ++i) { - if (! bxs[i].ok()) return false; + if (! bxs[i].ok()) { return false; } } } else if (m_bat.is_simple()) { IndexType t = ixType(); IntVect cr = crseRatio(); for (int i = 0; i < N; ++i) { - if (! amrex::convert(amrex::coarsen(bxs[i],cr),t).ok()) return false; + if (! amrex::convert(amrex::coarsen(bxs[i],cr),t).ok()) { return false; } } } else { for (int i = 0; i < N; ++i) { - if (! m_bat.m_op.m_bndryReg(bxs[i]).ok()) return false; + if (! m_bat.m_op.m_bndryReg(bxs[i]).ok()) { return false; } } } } @@ -900,19 +900,19 @@ BoxArray::isDisjoint () const if (m_bat.is_null()) { for (int i = 0; i < N; ++i) { intersections(bxs[i],isects); - if ( isects.size() > 1 ) return false; + if ( isects.size() > 1 ) { return false; } } } else if (m_bat.is_simple()) { IndexType t = ixType(); IntVect cr = crseRatio(); for (int i = 0; i < N; ++i) { intersections(amrex::convert(amrex::coarsen(bxs[i],cr),t), isects); - if ( isects.size() > 1 ) return false; + if ( isects.size() > 1 ) { return false; } } } else { for (int i = 0; i < N; ++i) { intersections(m_bat.m_op.m_bndryReg(bxs[i]), isects); - if ( isects.size() > 1 ) return false; + if ( isects.size() > 1 ) { return false; } } } @@ -996,9 +996,9 @@ BoxArray::contains (const Box& b, bool assume_disjoint_ba, const IntVect& ng) co bool BoxArray::contains (const BoxArray& ba, bool assume_disjoint_ba, const IntVect& ng) const { - if (size() == 0) return false; + if (size() == 0) { return false; } - if (!minimalBox().grow(ng).contains(ba.minimalBox())) return false; + if (!minimalBox().grow(ng).contains(ba.minimalBox())) { return false; } for (int i = 0, N = static_cast(ba.size()); i < N; ++i) { if (!contains(ba[i],assume_disjoint_ba, ng)) { @@ -1200,7 +1200,7 @@ BoxArray::intersections (const Box& bx, Box cbx(sm,bg); cbx.normalize(); - if (!cbx.intersects(m_ref->bbox)) return; + if (!cbx.intersects(m_ref->bbox)) { return; } auto TheEnd = BoxHashMap.cend(); @@ -1221,7 +1221,7 @@ BoxArray::intersections (const Box& bx, if (isect.ok()) { isects.emplace_back(index,isect); - if (first_only) return; + if (first_only) { return; } } } } else if (m_bat.is_simple()) { @@ -1235,7 +1235,7 @@ BoxArray::intersections (const Box& bx, if (isect.ok()) { isects.emplace_back(index,isect); - if (first_only) return; + if (first_only) { return; } } } } else { @@ -1247,7 +1247,7 @@ BoxArray::intersections (const Box& bx, if (isect.ok()) { isects.emplace_back(index,isect); - if (first_only) return; + if (first_only) { return; } } } } @@ -1271,7 +1271,7 @@ BoxArray::complementIn (BoxList& bl, const Box& bx) const bl.set(bx.ixType()); bl.push_back(bx); - if (empty()) return; + if (empty()) { return; } BARef::HashType& BoxHashMap = getHashMap(); @@ -1293,7 +1293,7 @@ BoxArray::complementIn (BoxList& bl, const Box& bx) const Box cbx(sm,bg); cbx.normalize(); - if (!cbx.intersects(m_ref->bbox)) return; + if (!cbx.intersects(m_ref->bbox)) { return; } auto TheEnd = BoxHashMap.cend(); @@ -1481,7 +1481,7 @@ BoxArray::getHashMap () const { BARef::HashType& BoxHashMap = m_ref->hash; - if (m_ref->HasHashMap()) return BoxHashMap; + if (m_ref->HasHashMap()) { return BoxHashMap; } #ifdef AMREX_USE_OMP #pragma omp critical(intersections_lock) @@ -1669,7 +1669,7 @@ intersect (const BoxArray& ba, BoxArray intersect (const BoxArray& lhs, const BoxArray& rhs) { - if (lhs.empty() || rhs.empty()) return BoxArray(); + if (lhs.empty() || rhs.empty()) { return BoxArray(); } BoxList bl(lhs[0].ixType()); for (int i = 0, Nl = static_cast(lhs.size()); i < Nl; ++i) { diff --git a/Src/Base/AMReX_BoxList.cpp b/Src/Base/AMReX_BoxList.cpp index 584b707b4d8..4459b24dba9 100644 --- a/Src/Base/AMReX_BoxList.cpp +++ b/Src/Base/AMReX_BoxList.cpp @@ -251,9 +251,9 @@ BoxList::isDisjoint () const } bool -BoxList::contains (const BoxList& bl) const +BoxList::contains (const BoxList& bl) const { - if (isEmpty() || bl.isEmpty()) return false; + if (isEmpty() || bl.isEmpty()) { return false; } BL_ASSERT(ixType() == bl.ixType()); diff --git a/Src/Base/AMReX_DistributionMapping.cpp b/Src/Base/AMReX_DistributionMapping.cpp index 7ee39e310d7..253cfe813be 100644 --- a/Src/Base/AMReX_DistributionMapping.cpp +++ b/Src/Base/AMReX_DistributionMapping.cpp @@ -106,7 +106,7 @@ DistributionMapping::operator!= (const DistributionMapping& rhs) const noexcept void DistributionMapping::Initialize () { - if (initialized) return; + if (initialized) { return; } // // Set defaults here!!! // diff --git a/Src/Base/AMReX_FACopyDescriptor.H b/Src/Base/AMReX_FACopyDescriptor.H index 263fb9ece48..67a106f2700 100644 --- a/Src/Base/AMReX_FACopyDescriptor.H +++ b/Src/Base/AMReX_FACopyDescriptor.H @@ -435,7 +435,7 @@ FabArrayCopyDescriptor::CollectData () { dataAvailable = true; - if (ParallelDescriptor::NProcs() == 1) return; + if (ParallelDescriptor::NProcs() == 1) { return; } #ifdef BL_USE_MPI using value_type = typename FAB::value_type; @@ -538,7 +538,7 @@ FabArrayCopyDescriptor::CollectData () const auto N_snds = static_cast(Snds.size()); const auto N_rcvs = static_cast(Rcvs.size()); - if ( N_snds == 0 && N_rcvs == 0 ) return; + if ( N_snds == 0 && N_rcvs == 0 ) { return; } const int Nints = 4 + 3*AMREX_SPACEDIM; // # of ints in a meta-data diff --git a/Src/Base/AMReX_FArrayBox.cpp b/Src/Base/AMReX_FArrayBox.cpp index 2074ef8d663..cba4d713244 100644 --- a/Src/Base/AMReX_FArrayBox.cpp +++ b/Src/Base/AMReX_FArrayBox.cpp @@ -346,7 +346,7 @@ FArrayBox::get_initval () void FArrayBox::Initialize () { - if (initialized) return; + if (initialized) { return; } initialized = true; BL_ASSERT(fabio == nullptr); diff --git a/Src/Base/AMReX_FBI.H b/Src/Base/AMReX_FBI.H index 4c7ba5ec4f0..e20f8bb4b79 100644 --- a/Src/Base/AMReX_FBI.H +++ b/Src/Base/AMReX_FBI.H @@ -212,7 +212,7 @@ FabArray::FB_local_copy_cpu (const FB& TheFB, int scomp, int ncomp) { auto const& LocTags = *(TheFB.m_LocTags); auto N_locs = static_cast(LocTags.size()); - if (N_locs == 0) return; + if (N_locs == 0) { return; } bool is_thread_safe = TheFB.m_threadsafe_loc; if (is_thread_safe) { @@ -273,7 +273,7 @@ FabArray::FB_local_copy_gpu (const FB& TheFB, int scomp, int ncomp) { auto const& LocTags = *(TheFB.m_LocTags); int N_locs = LocTags.size(); - if (N_locs == 0) return; + if (N_locs == 0) { return; } bool is_thread_safe = TheFB.m_threadsafe_loc; using TagType = Array4CopyTag; @@ -334,7 +334,7 @@ FabArray::CMD_local_setVal_gpu (typename FabArray::value_type x, { auto const& LocTags = *(thecmd.m_LocTags); int N_locs = LocTags.size(); - if (N_locs == 0) return; + if (N_locs == 0) { return; } bool is_thread_safe = thecmd.m_threadsafe_loc; using TagType = Array4BoxTag; @@ -374,7 +374,7 @@ FabArray::CMD_remote_setVal_gpu (typename FabArray::value_type x, } } - if (rcv_setval_tags.empty()) return; + if (rcv_setval_tags.empty()) { return; } AMREX_ALWAYS_ASSERT(amrex::IsStoreAtomic::value || is_thread_safe); @@ -561,7 +561,7 @@ FabArray::FB_pack_send_buffer_cuda_graph (const FB& TheFB, int scomp, int n Vector::CopyComTagsContainer const*> const& send_cctc) { const int N_snds = send_data.size(); - if (N_snds == 0) return; + if (N_snds == 0) { return; } if ( !(TheFB.m_copyToBuffer.ready()) ) { @@ -648,7 +648,7 @@ FabArray::FB_unpack_recv_buffer_cuda_graph (const FB& TheFB, int dcomp, int bool /*is_thread_safe*/) { const int N_rcvs = recv_cctc.size(); - if (N_rcvs == 0) return; + if (N_rcvs == 0) { return; } int launches = 0; LayoutData > recv_copy_tags(boxArray(),DistributionMap()); @@ -735,7 +735,7 @@ FabArray::pack_send_buffer_gpu (FabArray const& src, int scomp, int nc amrex::ignore_unused(send_size); const int N_snds = send_data.size(); - if (N_snds == 0) return; + if (N_snds == 0) { return; } char* pbuffer = send_data[0]; std::size_t szbuffer = 0; @@ -796,7 +796,7 @@ FabArray::unpack_recv_buffer_gpu (FabArray& dst, int dcomp, int ncomp, amrex::ignore_unused(recv_size); const int N_rcvs = recv_cctc.size(); - if (N_rcvs == 0) return; + if (N_rcvs == 0) { return; } char* pbuffer = recv_data[0]; #if 0 @@ -905,7 +905,7 @@ FabArray::pack_send_buffer_cpu (FabArray const& src, int scomp, int nc amrex::ignore_unused(send_size); auto const N_snds = static_cast(send_data.size()); - if (N_snds == 0) return; + if (N_snds == 0) { return; } #ifdef AMREX_USE_OMP #pragma omp parallel for @@ -945,7 +945,7 @@ FabArray::unpack_recv_buffer_cpu (FabArray& dst, int dcomp, int ncomp, amrex::ignore_unused(recv_size); auto const N_rcvs = static_cast(recv_cctc.size()); - if (N_rcvs == 0) return; + if (N_rcvs == 0) { return; } if (is_thread_safe) { diff --git a/Src/Base/AMReX_FabArray.H b/Src/Base/AMReX_FabArray.H index 2df4cf53ba2..70eff52c11d 100644 --- a/Src/Base/AMReX_FabArray.H +++ b/Src/Base/AMReX_FabArray.H @@ -1937,7 +1937,7 @@ template bool FabArray::ok () const { - if (!define_function_called) return false; + if (!define_function_called) { return false; } int isok = 1; @@ -3242,7 +3242,7 @@ FabArray::SumBoundary_nowait (int scomp, int ncomp, IntVect const& src_ngho { BL_PROFILE("FabArray::SumBoundary_nowait()"); - if ( n_grow == IntVect::TheZeroVector() && boxArray().ixType().cellCentered()) return; + if ( n_grow == IntVect::TheZeroVector() && boxArray().ixType().cellCentered()) { return; } AMREX_ASSERT(src_nghost <= n_grow); @@ -3262,7 +3262,7 @@ FabArray::SumBoundary_finish () BL_PROFILE("FabArray::SumBoundary_finish()"); // If pcd doesn't exist, ParallelCopy was all local and operation was fully completed in "SumBoundary_nowait". - if ( (n_grow == IntVect::TheZeroVector() && boxArray().ixType().cellCentered()) || !(this->pcd) ) return; + if ( (n_grow == IntVect::TheZeroVector() && boxArray().ixType().cellCentered()) || !(this->pcd) ) { return; } auto* tmp = const_cast*> (this->pcd->src); this->ParallelCopy_finish(); diff --git a/Src/Base/AMReX_FabArrayBase.cpp b/Src/Base/AMReX_FabArrayBase.cpp index e7b8e1977ae..9523c47ad34 100644 --- a/Src/Base/AMReX_FabArrayBase.cpp +++ b/Src/Base/AMReX_FabArrayBase.cpp @@ -94,7 +94,7 @@ namespace void FabArrayBase::Initialize () { - if (initialized) return; + if (initialized) { return; } initialized = true; // @@ -1837,7 +1837,7 @@ FabArrayBase::FPinfo::FPinfo (const FabArrayBase& srcfa, amrex::AllGatherBoxes(bl.data()); } - if (bl.isEmpty()) return; + if (bl.isEmpty()) { return; } Long ncells_total = 0L; Long ncells_max = 0L; diff --git a/Src/Base/AMReX_FabArrayCommI.H b/Src/Base/AMReX_FabArrayCommI.H index d79df73c7b6..ea877266f9a 100644 --- a/Src/Base/AMReX_FabArrayCommI.H +++ b/Src/Base/AMReX_FabArrayCommI.H @@ -34,7 +34,7 @@ FabArray::FBEP_nowait (int scomp, int ncomp, const IntVect& nghost, // There can only be local work to do. // int N_locs = (*TheFB.m_LocTags).size(); - if (N_locs == 0) return; + if (N_locs == 0) { return; } #ifdef AMREX_USE_GPU if (Gpu::inLaunchRegion()) { @@ -647,7 +647,7 @@ FabArray::PrepareSendBuffers (const MapOfCopyComTagContainers& SndTags, send_reqs.clear(); send_cctc.clear(); const auto N_snds = SndTags.size(); - if (N_snds == 0) return; + if (N_snds == 0) { return; } send_data.reserve(N_snds); send_size.reserve(N_snds); send_rank.reserve(N_snds); @@ -843,7 +843,7 @@ template void fbv_copy (Vector const& tags) { const int N = tags.size(); - if (N == 0) return; + if (N == 0) { return; } #ifdef AMREX_USE_GPU if (Gpu::inLaunchRegion()) { ParallelFor(tags, 1, @@ -941,7 +941,7 @@ FillBoundary (Vector const& mf, Vector const& scomp, int SeqNum = ParallelDescriptor::SeqNum(); MPI_Comm comm = ParallelContext::CommunicatorSub(); - if (N_locs == 0 && N_rcvs == 0 && N_snds == 0) return; // No work to do + if (N_locs == 0 && N_rcvs == 0 && N_snds == 0) { return; } // No work to do char* the_recv_data = nullptr; Vector recv_from; diff --git a/Src/Base/AMReX_FabArrayUtility.H b/Src/Base/AMReX_FabArrayUtility.H index 04c4fc47b28..698e32ccc2f 100644 --- a/Src/Base/AMReX_FabArrayUtility.H +++ b/Src/Base/AMReX_FabArrayUtility.H @@ -1313,7 +1313,7 @@ OverrideSync_nowait (FabArray & fa, FabArray const& msk, const Period BL_PROFILE("OverrideSync_nowait()"); AMREX_ASSERT_WITH_MESSAGE(!fa.os_temp, "OverrideSync_nowait() called when already in progress."); - if (fa.ixType().cellCentered()) return; + if (fa.ixType().cellCentered()) { return; } const int ncomp = fa.nComp(); @@ -1359,7 +1359,7 @@ OverrideSync_finish (FabArray & fa) { BL_PROFILE("OverrideSync_finish()"); - if (fa.ixType().cellCentered()) return; + if (fa.ixType().cellCentered()) { return; } fa.os_temp->ParallelCopy_finish(); amrex::Copy(fa, *(fa.os_temp), 0, 0, fa.nComp(), 0); diff --git a/Src/Base/AMReX_Geometry.cpp b/Src/Base/AMReX_Geometry.cpp index ac30aba62c7..6565643f99c 100644 --- a/Src/Base/AMReX_Geometry.cpp +++ b/Src/Base/AMReX_Geometry.cpp @@ -111,7 +111,7 @@ Geometry::Setup (const RealBox* rb, int coord, int const* isper) noexcept { Geometry* gg = AMReX::top()->getDefaultGeometry(); - if (gg->ok) return; + if (gg->ok) { return; } AMREX_ASSERT(!OpenMP::in_parallel()); diff --git a/Src/Base/AMReX_GpuAsyncArray.H b/Src/Base/AMReX_GpuAsyncArray.H index 2258057e079..eda18a81dab 100644 --- a/Src/Base/AMReX_GpuAsyncArray.H +++ b/Src/Base/AMReX_GpuAsyncArray.H @@ -31,7 +31,7 @@ public: AsyncArray (T const* h_p, const std::size_t n) { - if (n == 0) return; + if (n == 0) { return; } h_data = static_cast(The_Pinned_Arena()->alloc(n*sizeof(T))); std::memcpy(h_data, h_p, n*sizeof(T)); #ifdef AMREX_USE_GPU @@ -46,7 +46,7 @@ public: template ::value && std::is_trivial::value,int>::type = 0> explicit AsyncArray (const std::size_t n) { - if (n == 0) return; + if (n == 0) { return; } #ifdef AMREX_USE_GPU if (Gpu::inLaunchRegion()) { @@ -120,7 +120,7 @@ public: void copyToHost (T* h_p, std::size_t n) const { - if (n == 0) return; + if (n == 0) { return; } #ifdef AMREX_USE_GPU if (d_data) { diff --git a/Src/Base/AMReX_GpuBuffer.H b/Src/Base/AMReX_GpuBuffer.H index 245a55910be..314cdf8b83c 100644 --- a/Src/Base/AMReX_GpuBuffer.H +++ b/Src/Base/AMReX_GpuBuffer.H @@ -20,7 +20,7 @@ public: Buffer (std::initializer_list init) : m_size(init.size()) { - if (m_size == 0) return; + if (m_size == 0) { return; } #ifdef AMREX_USE_GPU h_data = static_cast(The_Pinned_Arena()->alloc(m_size*sizeof(T))); #else @@ -39,7 +39,7 @@ public: Buffer (T const* h_p, const std::size_t n) : m_size(n) { - if (m_size == 0) return; + if (m_size == 0) { return; } #ifdef AMREX_USE_GPU h_data = static_cast(The_Pinned_Arena()->alloc(m_size*sizeof(T))); #else diff --git a/Src/Base/AMReX_GpuContainers.H b/Src/Base/AMReX_GpuContainers.H index cb7b97acaf3..05399b2e047 100644 --- a/Src/Base/AMReX_GpuContainers.H +++ b/Src/Base/AMReX_GpuContainers.H @@ -129,7 +129,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU htod_memcpy(&(*result), &(*begin), size*sizeof(value_type)); #else @@ -166,7 +166,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU dtoh_memcpy(&(*result), &(*begin), size*sizeof(value_type)); #else @@ -203,7 +203,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU dtod_memcpy(&(*result), &(*begin), size*sizeof(value_type)); #else @@ -241,7 +241,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU htod_memcpy_async(&(*result), &(*begin), size*sizeof(value_type)); #else @@ -279,7 +279,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU dtoh_memcpy_async(&(*result), &(*begin), size*sizeof(value_type)); #else @@ -317,7 +317,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU dtod_memcpy_async(&(*result), &(*begin), size*sizeof(value_type)); #else @@ -339,7 +339,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU // Currently only implemented for CUDA. @@ -370,7 +370,7 @@ namespace amrex::Gpu { "Can only copy trivially copyable types"); auto size = std::distance(begin, end); - if (size == 0) return; + if (size == 0) { return; } #ifdef AMREX_USE_GPU // Currently only implemented for CUDA. @@ -411,7 +411,7 @@ namespace amrex::Gpu { void fillAsync (IT first, IT last, F&& f) noexcept { auto N = static_cast(std::distance(first, last)); - if (N <= 0) return; + if (N <= 0) { return; } auto p = &(*first); #ifndef AMREX_USE_GPU for (Long i = 0; i < N; ++i) { diff --git a/Src/Base/AMReX_GpuDevice.H b/Src/Base/AMReX_GpuDevice.H index 371bff773ca..20514aa367e 100644 --- a/Src/Base/AMReX_GpuDevice.H +++ b/Src/Base/AMReX_GpuDevice.H @@ -252,7 +252,7 @@ streamSynchronizeAll () noexcept inline void htod_memcpy_async (void* p_d, const void* p_h, const std::size_t sz) noexcept { - if (sz == 0) return; + if (sz == 0) { return; } #ifdef AMREX_USE_SYCL auto& q = Device::streamQueue(); q.submit([&] (sycl::handler& h) { h.memcpy(p_d, p_h, sz); }); @@ -266,7 +266,7 @@ htod_memcpy_async (void* p_d, const void* p_h, const std::size_t sz) noexcept inline void dtoh_memcpy_async (void* p_h, const void* p_d, const std::size_t sz) noexcept { - if (sz == 0) return; + if (sz == 0) { return; } #ifdef AMREX_USE_SYCL auto& q = Device::streamQueue(); q.submit([&] (sycl::handler& h) { h.memcpy(p_h, p_d, sz); }); @@ -280,7 +280,7 @@ dtoh_memcpy_async (void* p_h, const void* p_d, const std::size_t sz) noexcept inline void dtod_memcpy_async (void* p_d_dst, const void* p_d_src, const std::size_t sz) noexcept { - if (sz == 0) return; + if (sz == 0) { return; } #ifdef AMREX_USE_SYCL auto& q = Device::streamQueue(); q.submit([&] (sycl::handler& h) { h.memcpy(p_d_dst, p_d_src, sz); }); @@ -294,7 +294,7 @@ dtod_memcpy_async (void* p_d_dst, const void* p_d_src, const std::size_t sz) noe inline void htod_memcpy (void* p_d, const void* p_h, const std::size_t sz) noexcept { - if (sz == 0) return; + if (sz == 0) { return; } htod_memcpy_async(p_d, p_h, sz); Gpu::streamSynchronize(); } @@ -302,7 +302,7 @@ htod_memcpy (void* p_d, const void* p_h, const std::size_t sz) noexcept inline void dtoh_memcpy (void* p_h, const void* p_d, const std::size_t sz) noexcept { - if (sz == 0) return; + if (sz == 0) { return; } dtoh_memcpy_async(p_h, p_d, sz); Gpu::streamSynchronize(); } @@ -310,7 +310,7 @@ dtoh_memcpy (void* p_h, const void* p_d, const std::size_t sz) noexcept inline void dtod_memcpy (void* p_d_dst, const void* p_d_src, const std::size_t sz) noexcept { - if (sz == 0) return; + if (sz == 0) { return; } dtod_memcpy_async(p_d_dst, p_d_src, sz); Gpu::streamSynchronize(); } diff --git a/Src/Base/AMReX_GpuLaunchFunctsG.H b/Src/Base/AMReX_GpuLaunchFunctsG.H index 6c958f2070d..aea0c030152 100644 --- a/Src/Base/AMReX_GpuLaunchFunctsG.H +++ b/Src/Base/AMReX_GpuLaunchFunctsG.H @@ -114,7 +114,7 @@ void launch (int nblocks, gpuStream_t stream, L&& f) noexcept template void launch (T const& n, L&& f) noexcept { - if (amrex::isEmpty(n)) return; + if (amrex::isEmpty(n)) { return; } const auto ec = Gpu::makeExecutionConfig(n); int nthreads_per_block = ec.numThreads.x; int nthreads_total = nthreads_per_block * ec.numBlocks.x; @@ -190,7 +190,7 @@ namespace detail { template ::value> > void ParallelFor (Gpu::KernelInfo const& info, T n, L&& f) noexcept { - if (amrex::isEmpty(n)) return; + if (amrex::isEmpty(n)) { return; } const auto ec = Gpu::makeExecutionConfig(n); int nthreads_per_block = ec.numThreads.x; int nthreads_total = nthreads_per_block * ec.numBlocks.x; @@ -238,7 +238,7 @@ void ParallelFor (Gpu::KernelInfo const& info, T n, L&& f) noexcept template void ParallelFor (Gpu::KernelInfo const& info, Box const& box, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } int ncells = box.numPts(); const auto lo = amrex::lbound(box); const auto len = amrex::length(box); @@ -303,7 +303,7 @@ void ParallelFor (Gpu::KernelInfo const& info, Box const& box, L&& f) noexcept template ::value> > void ParallelFor (Gpu::KernelInfo const& info, Box const& box, T ncomp, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } int ncells = box.numPts(); const auto lo = amrex::lbound(box); const auto len = amrex::length(box); @@ -369,7 +369,7 @@ void ParallelFor (Gpu::KernelInfo const& info, Box const& box, T ncomp, L&& f) n template ::value> > void ParallelForRNG (T n, L&& f) noexcept { - if (amrex::isEmpty(n)) return; + if (amrex::isEmpty(n)) { return; } const auto ec = Gpu::ExecutionConfig(n); int nthreads_per_block = ec.numThreads.x; int nthreads_total = nthreads_per_block * amrex::min(ec.numBlocks.x,Gpu::Device::maxBlocksPerLaunch()); @@ -402,7 +402,7 @@ void ParallelForRNG (T n, L&& f) noexcept template void ParallelForRNG (Box const& box, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } int ncells = box.numPts(); const auto lo = amrex::lbound(box); const auto len = amrex::length(box); @@ -447,7 +447,7 @@ void ParallelForRNG (Box const& box, L&& f) noexcept template ::value> > void ParallelForRNG (Box const& box, T ncomp, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } int ncells = box.numPts(); const auto lo = amrex::lbound(box); const auto len = amrex::length(box); @@ -494,7 +494,7 @@ void ParallelForRNG (Box const& box, T ncomp, L&& f) noexcept template void ParallelFor (Gpu::KernelInfo const& /*info*/, Box const& box1, Box const& box2, L1&& f1, L2&& f2) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells = amrex::max(ncells1, ncells2); @@ -551,7 +551,7 @@ void ParallelFor (Gpu::KernelInfo const& /*info*/, Box const& box1, Box const& box2, Box const& box3, L1&& f1, L2&& f2, L3&& f3) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells3 = box3.numPts(); @@ -624,7 +624,7 @@ void ParallelFor (Gpu::KernelInfo const& /*info*/, Box const& box1, T1 ncomp1, L1&& f1, Box const& box2, T2 ncomp2, L2&& f2) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells = amrex::max(ncells1, ncells2); @@ -689,7 +689,7 @@ void ParallelFor (Gpu::KernelInfo const& /*info*/, Box const& box2, T2 ncomp2, L2&& f2, Box const& box3, T3 ncomp3, L3&& f3) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells3 = box3.numPts(); @@ -808,7 +808,7 @@ void launch (int nblocks, int nthreads_per_block, gpuStream_t stream, L&& f) noe template void launch (T const& n, L&& f) noexcept { - if (amrex::isEmpty(n)) return; + if (amrex::isEmpty(n)) { return; } const auto ec = Gpu::makeExecutionConfig(n); AMREX_LAUNCH_KERNEL(MT, ec.numBlocks, ec.numThreads, 0, Gpu::gpuStream(), [=] AMREX_GPU_DEVICE () noexcept { @@ -873,7 +873,7 @@ template ::value> ParallelFor (Gpu::KernelInfo const&, T n, L&& f) noexcept { - if (amrex::isEmpty(n)) return; + if (amrex::isEmpty(n)) { return; } const auto ec = Gpu::makeExecutionConfig(n); AMREX_LAUNCH_KERNEL(MT, ec.numBlocks, ec.numThreads, 0, Gpu::gpuStream(), [=] AMREX_GPU_DEVICE () noexcept { @@ -889,7 +889,7 @@ template std::enable_if_t::value> ParallelFor (Gpu::KernelInfo const&, Box const& box, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } int ncells = box.numPts(); const auto lo = amrex::lbound(box); const auto len = amrex::length(box); @@ -917,7 +917,7 @@ template ::value> ParallelFor (Gpu::KernelInfo const&, Box const& box, T ncomp, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } int ncells = box.numPts(); const auto lo = amrex::lbound(box); const auto len = amrex::length(box); @@ -944,7 +944,7 @@ template ::value> ParallelForRNG (T n, L&& f) noexcept { - if (amrex::isEmpty(n)) return; + if (amrex::isEmpty(n)) { return; } randState_t* rand_state = getRandState(); const auto ec = Gpu::ExecutionConfig(n); AMREX_LAUNCH_KERNEL(AMREX_GPU_MAX_THREADS, @@ -965,7 +965,7 @@ template std::enable_if_t::value> ParallelForRNG (Box const& box, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } randState_t* rand_state = getRandState(); int ncells = box.numPts(); const auto lo = amrex::lbound(box); @@ -997,7 +997,7 @@ template ::value> ParallelForRNG (Box const& box, T ncomp, L&& f) noexcept { - if (amrex::isEmpty(box)) return; + if (amrex::isEmpty(box)) { return; } randState_t* rand_state = getRandState(); int ncells = box.numPts(); const auto lo = amrex::lbound(box); @@ -1032,7 +1032,7 @@ std::enable_if_t::value && MaybeDeviceRunnable::valu ParallelFor (Gpu::KernelInfo const&, Box const& box1, Box const& box2, L1&& f1, L2&& f2) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells = amrex::max(ncells1, ncells2); @@ -1078,7 +1078,7 @@ ParallelFor (Gpu::KernelInfo const&, Box const& box1, Box const& box2, Box const& box3, L1&& f1, L2&& f2, L3&& f3) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells3 = box3.numPts(); @@ -1140,7 +1140,7 @@ ParallelFor (Gpu::KernelInfo const&, Box const& box1, T1 ncomp1, L1&& f1, Box const& box2, T2 ncomp2, L2&& f2) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells = amrex::max(ncells1, ncells2); @@ -1194,7 +1194,7 @@ ParallelFor (Gpu::KernelInfo const&, Box const& box2, T2 ncomp2, L2&& f2, Box const& box3, T3 ncomp3, L3&& f3) noexcept { - if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) return; + if (amrex::isEmpty(box1) && amrex::isEmpty(box2) && amrex::isEmpty(box3)) { return; } int ncells1 = box1.numPts(); int ncells2 = box2.numPts(); int ncells3 = box3.numPts(); diff --git a/Src/Base/AMReX_IArrayBox.cpp b/Src/Base/AMReX_IArrayBox.cpp index 6f751cf610c..40b2762729d 100644 --- a/Src/Base/AMReX_IArrayBox.cpp +++ b/Src/Base/AMReX_IArrayBox.cpp @@ -31,7 +31,7 @@ namespace void IArrayBox::Initialize () { - if (initialized) return; + if (initialized) { return; } // ParmParse pp("iab"); ifabio = std::make_unique(); diff --git a/Src/Base/AMReX_MFIter.cpp b/Src/Base/AMReX_MFIter.cpp index 5ae34d30a81..94e3ab02eb3 100644 --- a/Src/Base/AMReX_MFIter.cpp +++ b/Src/Base/AMReX_MFIter.cpp @@ -216,7 +216,7 @@ void MFIter::Finalize () { // avoid double finalize - if (finalized) return; + if (finalized) { return; } finalized = true; // mark as invalid @@ -503,7 +503,7 @@ Box MFIter::grownnodaltilebox (int dir, IntVect const& a_ng) const noexcept { BL_ASSERT(dir < AMREX_SPACEDIM); - if (dir < 0) return tilebox(IntVect::TheNodeVector(), a_ng); + if (dir < 0) { return tilebox(IntVect::TheNodeVector(), a_ng); } return tilebox(IntVect::TheDimensionVector(dir), a_ng); } diff --git a/Src/Base/AMReX_MPMD.H b/Src/Base/AMReX_MPMD.H index 60a478f4ca1..79ff3dd69b4 100644 --- a/Src/Base/AMReX_MPMD.H +++ b/Src/Base/AMReX_MPMD.H @@ -41,7 +41,7 @@ void Copier::send (FabArray const& mf, int icomp, int ncomp) const { const auto N_snds = static_cast(m_SndTags.size()); - if (N_snds == 0) return; + if (N_snds == 0) { return; } // Prepare buffer @@ -108,7 +108,7 @@ void Copier::recv (FabArray& mf, int icomp, int ncomp) const { const auto N_rcvs = static_cast(m_RcvTags.size()); - if (N_rcvs == 0) return; + if (N_rcvs == 0) { return; } // Prepare buffer diff --git a/Src/Base/AMReX_MemProfiler.cpp b/Src/Base/AMReX_MemProfiler.cpp index 223a5dad1ba..c9fc7ae0814 100644 --- a/Src/Base/AMReX_MemProfiler.cpp +++ b/Src/Base/AMReX_MemProfiler.cpp @@ -217,7 +217,7 @@ MemProfiler::report_ (const std::string& prefix, const std::string& memory_log_n std::ofstream memlog(memory_log_name.c_str(), std::ofstream::out|std::ofstream::app); - if (!memlog.good()) return; + if (!memlog.good()) { return; } static int width_name = 0; if (width_name == 0) { diff --git a/Src/Base/AMReX_MultiFab.cpp b/Src/Base/AMReX_MultiFab.cpp index a77d01d6375..3c7df473574 100644 --- a/Src/Base/AMReX_MultiFab.cpp +++ b/Src/Base/AMReX_MultiFab.cpp @@ -452,7 +452,7 @@ MultiFab::negate (const Box& region, int nghost) void MultiFab::Initialize () { - if (initialized) return; + if (initialized) { return; } initialized = true; amrex::ExecOnFinalize(MultiFab::Finalize); @@ -1411,7 +1411,7 @@ MultiFab::AverageSync (const Periodicity& period) { BL_PROFILE("MultiFab::AverageSync()"); - if (ixType().cellCentered()) return; + if (ixType().cellCentered()) { return; } auto wgt = this->OverlapMask(period); wgt->invert(1.0, 0, 1); this->WeightedSync(*wgt, period); @@ -1422,7 +1422,7 @@ MultiFab::WeightedSync (const MultiFab& wgt, const Periodicity& period) { BL_PROFILE("MultiFab::WeightedSync()"); - if (ixType().cellCentered()) return; + if (ixType().cellCentered()) { return; } const int ncomp = nComp(); for (int comp = 0; comp < ncomp; ++comp) diff --git a/Src/Base/AMReX_NonLocalBC.cpp b/Src/Base/AMReX_NonLocalBC.cpp index 109a77d1e54..ebd78f7b3d1 100644 --- a/Src/Base/AMReX_NonLocalBC.cpp +++ b/Src/Base/AMReX_NonLocalBC.cpp @@ -51,7 +51,7 @@ void PrepareCommBuffers(CommData& comm, comm.stats.clear(); const auto N_comms = static_cast(cctc.size()); - if (N_comms == 0) return; + if (N_comms == 0) { return; } // reserve for upcominf push_backs comm.data.reserve(N_comms); comm.size.reserve(N_comms); diff --git a/Src/Base/AMReX_NonLocalBCImpl.H b/Src/Base/AMReX_NonLocalBCImpl.H index ab2a0dfb978..3e1e45ff5a7 100644 --- a/Src/Base/AMReX_NonLocalBCImpl.H +++ b/Src/Base/AMReX_NonLocalBCImpl.H @@ -188,7 +188,7 @@ std::enable_if_t() && IsCallableR() && IsFabPro local_copy_cpu (FabArray& dest, const FabArray& src, int dcomp, int scomp, int ncomp, FabArrayBase::CopyComTagsContainer const& local_tags, DTOS const& dtos, Proj const& proj) noexcept { const auto N_locs = static_cast(local_tags.size()); - if (N_locs == 0) return; + if (N_locs == 0) { return; } #ifdef AMREX_USE_OMP #pragma omp parallel for #endif @@ -218,7 +218,7 @@ unpack_recv_buffer_cpu (FabArray& mf, int dcomp, int ncomp, Vector c amrex::ignore_unused(recv_size); const auto N_rcvs = static_cast(recv_cctc.size()); - if (N_rcvs == 0) return; + if (N_rcvs == 0) { return; } using T = typename FAB::value_type; #ifdef AMREX_USE_OMP @@ -256,7 +256,7 @@ std::enable_if_t() && IsCallableR() && IsFabPro local_copy_gpu (FabArray& dest, const FabArray& src, int dcomp, int scomp, int ncomp, FabArrayBase::CopyComTagsContainer const& local_tags, DTOS const& dtos, Proj const& proj) noexcept { int N_locs = local_tags.size(); - if (N_locs == 0) return; + if (N_locs == 0) { return; } using T = typename FAB::value_type; Vector > loc_copy_tags; @@ -284,7 +284,7 @@ unpack_recv_buffer_gpu (FabArray& mf, int scomp, int ncomp, amrex::ignore_unused(recv_size); const int N_rcvs = recv_cctc.size(); - if (N_rcvs == 0) return; + if (N_rcvs == 0) { return; } char* pbuffer = recv_data[0]; #if 0 @@ -484,7 +484,7 @@ void Comm_finish (FabArray& mf, int scomp, int ncomp, FabArrayBase::CommMetaData const& cmd, CommHandler handler, DTOS const& dtos, Proj const& proj) { - if (ParallelContext::NProcsSub() == 1) return; + if (ParallelContext::NProcsSub() == 1) { return; } const auto N_rcvs = static_cast(cmd.m_RcvTags->size()); if (N_rcvs > 0) @@ -535,7 +535,7 @@ Rotate90 (FabArray& mf, int scomp, int ncomp, IntVect const& nghost, Box co AMREX_ASSERT(scomp < mf.nComp() && scomp+ncomp <= mf.nComp()); AMREX_ASSERT(nghost.allLE(mf.nGrowVect()) && nghost[0] == nghost[1]); - if (nghost[0] <= 0) return; + if (nghost[0] <= 0) { return; } const FabArrayBase::RB90& TheRB90 = mf.getRB90(nghost, domain); @@ -585,7 +585,7 @@ Rotate180 (FabArray& mf, int scomp, int ncomp, IntVect const& nghost, Box c AMREX_ASSERT(scomp < mf.nComp() && scomp+ncomp <= mf.nComp()); AMREX_ASSERT(nghost.allLE(mf.nGrowVect())); - if (nghost[0] <= 0) return; + if (nghost[0] <= 0) { return; } const FabArrayBase::RB180& TheRB180 = mf.getRB180(nghost, domain); @@ -620,7 +620,7 @@ FillPolar (FabArray& mf, int scomp, int ncomp, IntVect const& nghost, Box c AMREX_ASSERT(scomp < mf.nComp() && scomp+ncomp <= mf.nComp()); AMREX_ASSERT(nghost.allLE(mf.nGrowVect())); - if (nghost[0] <= 0) return; + if (nghost[0] <= 0) { return; } const FabArrayBase::PolarB& ThePolarB = mf.getPolarB(nghost, domain); diff --git a/Src/Base/AMReX_PArena.cpp b/Src/Base/AMReX_PArena.cpp index a7c7ee1f4bb..82781a7be65 100644 --- a/Src/Base/AMReX_PArena.cpp +++ b/Src/Base/AMReX_PArena.cpp @@ -67,7 +67,7 @@ PArena::alloc (std::size_t nbytes) void PArena::free (void* p) { - if (p == nullptr) return; + if (p == nullptr) { return; } #if defined(AMREX_USE_GPU) diff --git a/Src/Base/AMReX_PCI.H b/Src/Base/AMReX_PCI.H index 7897adcbed8..6ccbe4078fc 100644 --- a/Src/Base/AMReX_PCI.H +++ b/Src/Base/AMReX_PCI.H @@ -7,7 +7,7 @@ FabArray::PC_local_cpu (const CPC& thecpc, FabArray const& src, int scomp, int dcomp, int ncomp, CpOp op) { auto const N_locs = static_cast(thecpc.m_LocTags->size()); - if (N_locs == 0) return; + if (N_locs == 0) { return; } bool is_thread_safe = thecpc.m_threadsafe_loc; if (is_thread_safe) @@ -89,7 +89,7 @@ FabArray::PC_local_gpu (const CPC& thecpc, FabArray const& src, int scomp, int dcomp, int ncomp, CpOp op) { int N_locs = thecpc.m_LocTags->size(); - if (N_locs == 0) return; + if (N_locs == 0) { return; } bool is_thread_safe = thecpc.m_threadsafe_loc; using TagType = Array4CopyTag; diff --git a/Src/Base/AMReX_ParmParse.cpp b/Src/Base/AMReX_ParmParse.cpp index 8fb37dab408..f002179e3c6 100644 --- a/Src/Base/AMReX_ParmParse.cpp +++ b/Src/Base/AMReX_ParmParse.cpp @@ -85,7 +85,7 @@ ParmParse::PP_entry::~PP_entry () ParmParse::PP_entry& ParmParse::PP_entry::operator= (const PP_entry& pe) { - if ( &pe == this ) return *this; + if ( &pe == this ) { return *this; } m_name = pe.m_name; m_vals = pe.m_vals; m_table = nullptr; @@ -147,10 +147,10 @@ isT (const std::string& str, T& val) { std::istringstream s(str); s >> val; - if ( s.fail() ) return false; + if ( s.fail() ) { return false; } std::string left; std::getline(s, left); - if ( !left.empty() ) return false; + if ( !left.empty() ) { return false; } return true; } @@ -915,7 +915,7 @@ squeryarr (const ParmParse::Table& table, num_val = static_cast(def->m_vals.size()); } - if ( num_val == 0 ) return true; + if ( num_val == 0 ) { return true; } int stop_ix = start_ix + num_val - 1; if ( static_cast(ref.size()) <= stop_ix ) @@ -1183,7 +1183,7 @@ unused_table_entries_q (const ParmParse::Table& table, const std::string& prefix } else { - if (unused_table_entries_q(*li.m_table, prefix)) return true; + if (unused_table_entries_q(*li.m_table, prefix)) { return true; } } } else if ( !li.m_queried ) diff --git a/Src/Base/AMReX_PhysBCFunct.H b/Src/Base/AMReX_PhysBCFunct.H index 211b6a5b777..1e0f1be99ec 100644 --- a/Src/Base/AMReX_PhysBCFunct.H +++ b/Src/Base/AMReX_PhysBCFunct.H @@ -140,7 +140,7 @@ public: void operator() (MultiFab& mf, int icomp, int ncomp, IntVect const& nghost, Real time, int bccomp) { - if (m_geom.isAllPeriodic()) return; + if (m_geom.isAllPeriodic()) { return; } BL_PROFILE("PhysBCFunct::()"); @@ -234,7 +234,7 @@ GpuBndryFuncFab::nddoit (Box const& bx, FArrayBox& dest, } } - if (gdomain.contains(bx)) return; + if (gdomain.contains(bx)) { return; } Array4 const& fab = dest.array(); const auto geomdata = geom.data(); @@ -359,7 +359,7 @@ GpuBndryFuncFab::ccfcdoit (Box const& bx, FArrayBox& dest, } } - if (gdomain.contains(bx)) return; + if (gdomain.contains(bx)) { return; } Array4 const& fab = dest.array(); const auto geomdata = geom.data(); diff --git a/Src/Base/AMReX_RealBox.H b/Src/Base/AMReX_RealBox.H index ddbc96b1b90..6f429c8262b 100644 --- a/Src/Base/AMReX_RealBox.H +++ b/Src/Base/AMReX_RealBox.H @@ -92,7 +92,7 @@ public: //! it's volume is considered to be zero. [[nodiscard]] AMREX_GPU_HOST_DEVICE Real volume () const noexcept { - if (ok()) return AMREX_D_TERM(length(0), *length(1), *length(2)); + if (ok()) { return AMREX_D_TERM(length(0), *length(1), *length(2)); } return 0.0; } diff --git a/Src/Base/AMReX_Reduce.H b/Src/Base/AMReX_Reduce.H index 34f1c6e74bb..497806cbac6 100644 --- a/Src/Base/AMReX_Reduce.H +++ b/Src/Base/AMReX_Reduce.H @@ -618,7 +618,7 @@ public: typename M=std::enable_if_t::value> > void eval (N n, D & reduce_data, F&& f) { - if (n <= 0) return; + if (n <= 0) { return; } using ReduceTuple = typename D::Type; auto const& stream = Gpu::gpuStream(); auto dp = reduce_data.devicePtr(stream); @@ -1259,7 +1259,7 @@ bool AnyOf (Box const& box, P&&pred) for (int k = lo.z; k <= hi.z; ++k) { for (int j = lo.y; j <= hi.y; ++j) { for (int i = lo.x; i <= hi.x; ++i) { - if (pred(i,j,k)) return true; + if (pred(i,j,k)) { return true; } }}} return false; } diff --git a/Src/Base/AMReX_Scan.H b/Src/Base/AMReX_Scan.H index df255b16e09..99af9561e88 100644 --- a/Src/Base/AMReX_Scan.H +++ b/Src/Base/AMReX_Scan.H @@ -189,7 +189,7 @@ struct BlockStatus template T PrefixSum_mp (N n, FIN && fin, FOUT && fout, TYPE, RetSum a_ret_sum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } constexpr int nwarps_per_block = 8; constexpr int nthreads = nwarps_per_block*Gpu::Device::warp_size; constexpr int nchunks = 12; @@ -390,7 +390,7 @@ template ,Type::Exclusive>::value)> > T PrefixSum (N n, FIN && fin, FOUT && fout, TYPE type, RetSum a_ret_sum = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } constexpr int nwarps_per_block = 8; constexpr int nthreads = nwarps_per_block*Gpu::Device::warp_size; constexpr int nchunks = 12; @@ -629,7 +629,7 @@ template ,Type::Exclusive>::value)> > T PrefixSum (N n, FIN && fin, FOUT && fout, TYPE, RetSum a_ret_sum = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } constexpr int nwarps_per_block = 4; constexpr int nthreads = nwarps_per_block*Gpu::Device::warp_size; // # of threads per block constexpr int nelms_per_thread = sizeof(T) >= 8 ? 8 : 16; @@ -772,7 +772,7 @@ template ,Type::Exclusive>::value)> > T PrefixSum (N n, FIN && fin, FOUT && fout, TYPE, RetSum a_ret_sum = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } constexpr int nwarps_per_block = 8; constexpr int nthreads = nwarps_per_block*Gpu::Device::warp_size; // # of threads per block constexpr int nelms_per_thread = sizeof(T) >= 8 ? 4 : 8; @@ -905,7 +905,7 @@ template ,Type::Exclusive>::value)> > T PrefixSum (N n, FIN && fin, FOUT && fout, TYPE, RetSum a_ret_sum = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } constexpr int nwarps_per_block = 4; constexpr int nthreads = nwarps_per_block*Gpu::Device::warp_size; constexpr int nchunks = 12; @@ -1208,7 +1208,7 @@ T InclusiveSum (N n, T const* in, T * out, RetSum a_ret_sum = retSum) template ::value> > T ExclusiveSum (N n, T const* in, T * out, RetSum a_ret_sum = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } #if defined(AMREX_USE_CUDA) && defined(__CUDACC__) && (__CUDACC_VER_MAJOR__ >= 11) T in_last = 0; if (a_ret_sum) { @@ -1286,7 +1286,7 @@ template ,Type::Exclusive>::value)> > T PrefixSum (N n, FIN && fin, FOUT && fout, TYPE, RetSum = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } T totalsum = 0; for (N i = 0; i < n; ++i) { T x = fin(i); @@ -1317,7 +1317,7 @@ T InclusiveSum (N n, T const* in, T * out, RetSum /*a_ret_sum*/ = retSum) template ::value> > T ExclusiveSum (N n, T const* in, T * out, RetSum /*a_ret_sum*/ = retSum) { - if (n <= 0) return 0; + if (n <= 0) { return 0; } auto in_last = in[n-1]; #if (__cplusplus >= 201703L) && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 10) @@ -1366,7 +1366,7 @@ namespace Gpu // GCC's __cplusplus is not a reliable indication for C++17 support return std::exclusive_scan(begin, end, result, 0); #else - if (begin == end) return result; + if (begin == end) { return result; } typename std::iterator_traits::value_type sum = *begin; *result++ = sum - *begin; diff --git a/Src/Base/AMReX_TagParallelFor.H b/Src/Base/AMReX_TagParallelFor.H index ae832f3b2af..5aa748a3d61 100644 --- a/Src/Base/AMReX_TagParallelFor.H +++ b/Src/Base/AMReX_TagParallelFor.H @@ -149,7 +149,7 @@ void ParallelFor_doit (Vector const& tags, F && f) { const int ntags = tags.size(); - if (ntags == 0) return; + if (ntags == 0) { return; } int ntotwarps = 0; Vector nwarps; @@ -197,7 +197,7 @@ ParallelFor_doit (Vector const& tags, F && f) int g_tid = blockDim.x*blockIdx.x + threadIdx.x; #endif int g_wid = g_tid / Gpu::Device::warp_size; - if (g_wid >= ntotwarps) return; + if (g_wid >= ntotwarps) { return; } int tag_id = amrex::bisect(d_nwarps, 0, ntags, g_wid); diff --git a/Src/Base/AMReX_TinyProfiler.cpp b/Src/Base/AMReX_TinyProfiler.cpp index 8c59a1eae7b..bf827659062 100644 --- a/Src/Base/AMReX_TinyProfiler.cpp +++ b/Src/Base/AMReX_TinyProfiler.cpp @@ -543,7 +543,7 @@ TinyProfiler::PrintStats (std::map& regstats, double dt_max) } } - if (regstats.empty()) return; + if (regstats.empty()) { return; } int nprocs = ParallelDescriptor::NProcs(); int ioproc = ParallelDescriptor::IOProcessorNumber(); @@ -742,7 +742,7 @@ TinyProfiler::PrintMemStats(std::map& memstats, } } - if (memstats.empty()) return; + if (memstats.empty()) { return; } const int nprocs = ParallelDescriptor::NProcs(); const int ioproc = ParallelDescriptor::IOProcessorNumber(); @@ -864,7 +864,7 @@ TinyProfiler::PrintMemStats(std::map& memstats, maxlen[i] += 2; } - if (allstatsstr.size() == 1) return; + if (allstatsstr.size() == 1) { return; } int lenhline = 0; for (auto i : maxlen) { diff --git a/Src/Base/AMReX_Utility.cpp b/Src/Base/AMReX_Utility.cpp index 423f3046ed9..8441324621a 100644 --- a/Src/Base/AMReX_Utility.cpp +++ b/Src/Base/AMReX_Utility.cpp @@ -132,7 +132,7 @@ std::string amrex::trim(std::string s, std::string const& space) { const auto sbegin = s.find_first_not_of(space); - if (sbegin == std::string::npos) return std::string{}; + if (sbegin == std::string::npos) { return std::string{}; } const auto send = s.find_last_not_of(space); s = s.substr(sbegin, send-sbegin+1); return s; diff --git a/Src/Base/AMReX_Vector.H b/Src/Base/AMReX_Vector.H index 248aced1de4..6b4f28a7ff0 100644 --- a/Src/Base/AMReX_Vector.H +++ b/Src/Base/AMReX_Vector.H @@ -199,7 +199,7 @@ namespace amrex std::size_t removeDupDoit (Vector& vec, std::size_t start, std::size_t stop) { std::size_t N = stop-start; - if (N < 2) return stop; + if (N < 2) { return stop; } T* const data = vec.data() + start; T const sentinel = data[0]; // duplicates will be set to sentinel and removed later diff --git a/Src/Base/AMReX_VisMF.cpp b/Src/Base/AMReX_VisMF.cpp index a109a09b04e..1855d1ddd63 100644 --- a/Src/Base/AMReX_VisMF.cpp +++ b/Src/Base/AMReX_VisMF.cpp @@ -1535,7 +1535,7 @@ VisMF::Read (FabArray &mf, // This allows us to read in an empty MultiFab without an error -- but only if explicitly told to if (allow_empty_mf > 0) { - if (hdr.m_ba.empty()) return; + if (hdr.m_ba.empty()) { return; } } else { if (hdr.m_ba.empty()) { diff --git a/Src/Base/AMReX_iMultiFab.cpp b/Src/Base/AMReX_iMultiFab.cpp index 63465f0a036..3941c4267b2 100644 --- a/Src/Base/AMReX_iMultiFab.cpp +++ b/Src/Base/AMReX_iMultiFab.cpp @@ -148,7 +148,7 @@ iMultiFab::negate (const Box& region, int nghost) void iMultiFab::Initialize () { - if (initialized) return; + if (initialized) { return; } amrex::ExecOnFinalize(iMultiFab::Finalize); diff --git a/Src/Base/Parser/AMReX_Parser_Y.cpp b/Src/Base/Parser/AMReX_Parser_Y.cpp index 74dde9679ec..75a58498c15 100644 --- a/Src/Base/Parser/AMReX_Parser_Y.cpp +++ b/Src/Base/Parser/AMReX_Parser_Y.cpp @@ -631,7 +631,7 @@ namespace { bool parser_node_equal (struct parser_node* a, struct parser_node* b) { - if (a->type != b->type) return false; + if (a->type != b->type) { return false; } switch (a->type) { case PARSER_NUMBER: diff --git a/Src/Boundary/AMReX_YAFluxRegister.H b/Src/Boundary/AMReX_YAFluxRegister.H index 619b7100983..6f17c4de556 100644 --- a/Src/Boundary/AMReX_YAFluxRegister.H +++ b/Src/Boundary/AMReX_YAFluxRegister.H @@ -426,7 +426,7 @@ YAFluxRegisterT::FineAdd (const MFIter& mfi, // const int li = mfi.LocalIndex(); Vector& cfp_fabs = m_cfp_fab[li]; - if (cfp_fabs.empty()) return; + if (cfp_fabs.empty()) { return; } const Box& tbx = mfi.tilebox(); const Box& bx = amrex::coarsen(tbx, m_ratio); diff --git a/Src/EB/AMReX_EB2_GeometryShop.H b/Src/EB/AMReX_EB2_GeometryShop.H index 6b5e255286e..c0cae18ca32 100644 --- a/Src/EB/AMReX_EB2_GeometryShop.H +++ b/Src/EB/AMReX_EB2_GeometryShop.H @@ -220,7 +220,7 @@ public: } else { ++nfluid; } - if (nbody > 0 && nfluid > 0) return mixedcells; + if (nbody > 0 && nfluid > 0) { return mixedcells; } } } } diff --git a/Src/EB/AMReX_EB2_Level.cpp b/Src/EB/AMReX_EB2_Level.cpp index 9289f5d77f9..daa22113082 100644 --- a/Src/EB/AMReX_EB2_Level.cpp +++ b/Src/EB/AMReX_EB2_Level.cpp @@ -162,7 +162,7 @@ Level::coarsenFromFine (Level& fineLevel, bool fill_boundary) ParallelDescriptor::ReduceBoolOr(b); mvmc_error = b; } - if (mvmc_error) return mvmc_error; + if (mvmc_error) { return mvmc_error; } const int ng = 2; m_cellflag.define(m_grids, m_dmap, 1, ng); @@ -483,7 +483,7 @@ void Level::fillVolFrac (MultiFab& vfrac, const Geometry& geom) const { vfrac.setVal(1.0); - if (isAllRegular()) return; + if (isAllRegular()) { return; } vfrac.ParallelCopy(m_volfrac,0,0,1,0,vfrac.nGrow(),geom.periodicity()); @@ -715,7 +715,7 @@ Level::fillAreaFrac (Array const& a_areafrac, const Ge a_areafrac[idim]->setVal(1.0); } - if (isAllRegular()) return; + if (isAllRegular()) { return; } for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { diff --git a/Src/EB/AMReX_EBFluxRegister.cpp b/Src/EB/AMReX_EBFluxRegister.cpp index ed2c42f758c..a447be226c7 100644 --- a/Src/EB/AMReX_EBFluxRegister.cpp +++ b/Src/EB/AMReX_EBFluxRegister.cpp @@ -166,7 +166,7 @@ EBFluxRegister::FineAdd (const MFIter& mfi, const int li = mfi.LocalIndex(); Vector& cfp_fabs = m_cfp_fab[li]; - if (cfp_fabs.empty()) return; + if (cfp_fabs.empty()) { return; } const Box& tbx = mfi.tilebox(); BL_ASSERT(tbx.cellCentered()); diff --git a/Src/EB/AMReX_EBMultiFabUtil.cpp b/Src/EB/AMReX_EBMultiFabUtil.cpp index a5202c7d805..b83b2f0f62d 100644 --- a/Src/EB/AMReX_EBMultiFabUtil.cpp +++ b/Src/EB/AMReX_EBMultiFabUtil.cpp @@ -27,7 +27,7 @@ void EB_set_covered (MultiFab& mf, int icomp, int ncomp, int ngrow, Real val) { const auto *const factory = dynamic_cast(&(mf.Factory())); - if (factory == nullptr) return; + if (factory == nullptr) { return; } const auto& flags = factory->getMultiEBCellFlagFab(); AMREX_ALWAYS_ASSERT(mf.ixType().cellCentered() || mf.ixType().nodeCentered()); @@ -69,7 +69,7 @@ void EB_set_covered (MultiFab& mf, int icomp, int ncomp, int ngrow, const Vector& a_vals) { const auto *const factory = dynamic_cast(&(mf.Factory())); - if (factory == nullptr) return; + if (factory == nullptr) { return; } const auto& flags = factory->getMultiEBCellFlagFab(); AMREX_ALWAYS_ASSERT(mf.ixType().cellCentered() || mf.ixType().nodeCentered()); @@ -109,7 +109,7 @@ void EB_set_covered_faces (const Array& umac, Real val) { const auto *const factory = dynamic_cast(&(umac[0]->Factory())); - if (factory == nullptr) return; + if (factory == nullptr) { return; } const auto& area = factory->getAreaFrac(); const auto& flags = factory->getMultiEBCellFlagFab(); @@ -220,7 +220,7 @@ void EB_set_covered_faces (const Array& umac, const int scomp, const int ncomp, const Vector& a_vals ) { const auto *const factory = dynamic_cast(&(umac[0]->Factory())); - if (factory == nullptr) return; + if (factory == nullptr) { return; } const auto& area = factory->getAreaFrac(); const auto& flags = factory->getMultiEBCellFlagFab(); diff --git a/Src/EB/AMReX_EBToPVD.cpp b/Src/EB/AMReX_EBToPVD.cpp index dc6e93d5fb2..bd5c85721d5 100644 --- a/Src/EB/AMReX_EBToPVD.cpp +++ b/Src/EB/AMReX_EBToPVD.cpp @@ -443,7 +443,7 @@ void EBToPVD::EBGridCoverage(const int myID, const Real* problo, const Real* dx, }; ++m_grid; - if(lc1 == 0) return; + if(lc1 == 0) { return; } std::stringstream ss; ss << std::setw(4) << std::setfill('0') << myID; diff --git a/Src/Extern/HDF5/AMReX_ParticleHDF5.H b/Src/Extern/HDF5/AMReX_ParticleHDF5.H index db58f07d6a3..469f70e5924 100644 --- a/Src/Extern/HDF5/AMReX_ParticleHDF5.H +++ b/Src/Extern/HDF5/AMReX_ParticleHDF5.H @@ -1285,7 +1285,7 @@ ParticleContainer_impl const int rank = ParallelDescriptor::MyProc(); const int NReaders = MaxReaders(); - if (rank >= NReaders) return; + if (rank >= NReaders) { return; } const int Navg = ngrids[lev] / NReaders; const int Nleft = ngrids[lev] - Navg * NReaders; diff --git a/Src/Extern/SUNDIALS/AMReX_NVector_MultiFab.cpp b/Src/Extern/SUNDIALS/AMReX_NVector_MultiFab.cpp index 1674a83343a..8408f75c41d 100644 --- a/Src/Extern/SUNDIALS/AMReX_NVector_MultiFab.cpp +++ b/Src/Extern/SUNDIALS/AMReX_NVector_MultiFab.cpp @@ -29,7 +29,7 @@ N_Vector N_VNewEmpty_MultiFab(sunindextype length, ::sundials::Context* sunctx) { /* Create vector */ N_Vector v = N_VNewEmpty(*sunctx); - if (v == nullptr) return(nullptr); + if (v == nullptr) { return(nullptr); } v->ops->nvclone = N_VClone_MultiFab; v->ops->nvcloneempty = N_VCloneEmpty_MultiFab; @@ -85,7 +85,7 @@ N_Vector N_VNew_MultiFab(sunindextype length, ::sundials::Context* sunctx) { N_Vector v = N_VNewEmpty_MultiFab(length, sunctx); - if (v == nullptr) return(nullptr); + if (v == nullptr) { return(nullptr); } // Create and attach new MultiFab if (length > 0) @@ -107,7 +107,7 @@ N_Vector N_VMake_MultiFab(sunindextype length, amrex::MultiFab *v_mf, ::sundials::Context* sunctx) { N_Vector v = N_VNewEmpty_MultiFab(length, sunctx); - if (v == nullptr) return(nullptr); + if (v == nullptr) { return(nullptr); } if (length > 0) { @@ -157,11 +157,11 @@ int N_VGetOwnMF_MultiFab(N_Vector v) N_Vector N_VCloneEmpty_MultiFab(N_Vector w) { - if (w == nullptr) return(nullptr); + if (w == nullptr) { return(nullptr); } /* Create vector and copy operations */ N_Vector v = N_VNewEmpty(w->sunctx); - if (v == nullptr) return(nullptr); + if (v == nullptr) { return(nullptr); } N_VCopyOps(w, v); /* Create content */ @@ -182,7 +182,7 @@ N_Vector N_VCloneEmpty_MultiFab(N_Vector w) N_Vector N_VClone_MultiFab(N_Vector w) { N_Vector v = N_VCloneEmpty_MultiFab(w); - if (v == nullptr) return(nullptr); + if (v == nullptr) { return(nullptr); } sunindextype length = amrex::sundials::N_VGetLength_MultiFab(w); diff --git a/Src/Extern/SUNDIALS/AMReX_SUNMemory.cpp b/Src/Extern/SUNDIALS/AMReX_SUNMemory.cpp index 043c44b0634..ce17180411b 100644 --- a/Src/Extern/SUNDIALS/AMReX_SUNMemory.cpp +++ b/Src/Extern/SUNDIALS/AMReX_SUNMemory.cpp @@ -37,7 +37,7 @@ namespace { { SUNMemory mem = SUNMemoryNewEmpty(); - if (mem == nullptr) return -1; + if (mem == nullptr) { return -1; } mem->ptr = nullptr; mem->own = SUNTRUE; mem->type = mem_type; @@ -59,7 +59,7 @@ namespace { int Dealloc(SUNMemoryHelper, SUNMemory mem, void* /*queue*/) { - if (mem == nullptr) return 0; + if (mem == nullptr) { return 0; } auto* arena = getArena(mem->type); if (arena) { if(mem->own) diff --git a/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H b/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H index 5384f534107..a54e8fbde30 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H @@ -478,7 +478,7 @@ template void MLABecLaplacianT::applyRobinBCTermsCoeffs () { - if (!(this->hasRobinBC())) return; + if (!(this->hasRobinBC())) { return; } const int ncomp = this->getNComp(); bool reset_alpha = false; @@ -1166,7 +1166,7 @@ template std::unique_ptr> MLABecLaplacianT::makeNLinOp (int /*grid_size*/) const { - if (this->m_overset_mask[0][0] == nullptr) return nullptr; + if (this->m_overset_mask[0][0] == nullptr) { return nullptr; } const Geometry& geom = this->m_geom[0].back(); const BoxArray& ba = this->m_grids[0].back(); @@ -1265,7 +1265,7 @@ template void MLABecLaplacianT::copyNSolveSolution (MF& dst, MF const& src) const { - if (this->m_overset_mask[0].back() == nullptr) return; + if (this->m_overset_mask[0].back() == nullptr) { return; } const int ncomp = dst.nComp(); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H b/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H index f58137ca9b6..fa781ab461a 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLCellABecLap.H @@ -277,7 +277,7 @@ MLCellABecLapT::applyInhomogNeumannTerm (int amrlev, MF& rhs) const bool has_inhomog_neumann = this->hasInhomogNeumannBC(); bool has_robin = this->hasRobinBC(); - if (!has_inhomog_neumann && !has_robin) return; + if (!has_inhomog_neumann && !has_robin) { return; } int ncomp = this->getNComp(); const int mglev = 0; @@ -509,7 +509,7 @@ MLCellABecLapT::addInhomogNeumannFlux ( bool has_inhomog_neumann = this->hasInhomogNeumannBC(); bool has_robin = this->hasRobinBC(); - if (!has_inhomog_neumann && !has_robin) return; + if (!has_inhomog_neumann && !has_robin) { return; } int ncomp = this->getNComp(); const int mglev = 0; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H b/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H index 9fa69d8de12..19e82a336be 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLCellLinOp.H @@ -1408,7 +1408,7 @@ MLCellLinOpT::applyMetricTerm (int amrlev, int mglev, MF& rhs) const { amrex::ignore_unused(amrlev,mglev,rhs); #if (AMREX_SPACEDIM != 3) - if (!m_has_metric_term) return; + if (!m_has_metric_term) { return; } const int ncomp = rhs.nComp(); @@ -1464,7 +1464,7 @@ MLCellLinOpT::unapplyMetricTerm (int amrlev, int mglev, MF& rhs) const { amrex::ignore_unused(amrlev,mglev,rhs); #if (AMREX_SPACEDIM != 3) - if (!m_has_metric_term) return; + if (!m_has_metric_term) { return; } const int ncomp = rhs.nComp(); @@ -1904,7 +1904,7 @@ template void MLCellLinOpT::computeVolInv () const { - if (!m_volinv.empty()) return; + if (!m_volinv.empty()) { return; } m_volinv.resize(this->m_num_amr_levels); for (int amrlev = 0; amrlev < this->m_num_amr_levels; ++amrlev) { diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp b/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp index 0538421683b..3aa722c4cc5 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp @@ -203,7 +203,7 @@ MLEBTensorOp::apply (int amrlev, int mglev, MultiFab& out, MultiFab& in, BCMode BL_PROFILE("MLEBTensorOp::apply()"); MLEBABecLap::apply(amrlev, mglev, out, in, bc_mode, s_mode, bndry); - if (mglev >= m_kappa[amrlev].size()) return; + if (mglev >= m_kappa[amrlev].size()) { return; } applyBCTensor(amrlev, mglev, in, bc_mode, s_mode, bndry); @@ -511,7 +511,7 @@ MLEBTensorOp::compFlux (int amrlev, const Array& fluxe const int ncomp = getNComp(); MLEBABecLap::compFlux(amrlev, fluxes, sol, loc); - if (mglev >= m_kappa[amrlev].size()) return; + if (mglev >= m_kappa[amrlev].size()) { return; } applyBCTensor(amrlev, mglev, sol, BCMode::Inhomogeneous, StateMode::Solution, m_bndry_sol[amrlev].get()); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLMG.H b/Src/LinearSolvers/MLMG/AMReX_MLMG.H index ccc54128f7c..310b73d10b0 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLMG.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLMG.H @@ -1417,7 +1417,7 @@ MLMGT::actualBottomSolve () { BL_PROFILE("MLMG::actualBottomSolve()"); - if (!linop.isBottomActive()) return; + if (!linop.isBottomActive()) { return; } auto bottom_start_time = amrex::second(); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H index 0aeaf698bc4..a98824c4fee 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H @@ -190,7 +190,7 @@ void mlndlap_bc_doit (Box const& vbx, Array4 const& a, Box const& domain, if (! bfhi[idim]) gdomain.growHi(idim,1); } - if (gdomain.strictly_contains(vbx)) return; + if (gdomain.strictly_contains(vbx)) { return; } const int offset = domain.cellCentered() ? 0 : 1; @@ -2901,7 +2901,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -2912,7 +2912,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -2923,7 +2923,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -2934,7 +2934,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -2945,7 +2945,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -2956,7 +2956,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -2967,7 +2967,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -2978,7 +2978,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. @@ -3034,7 +3034,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -3055,7 +3055,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -3070,7 +3070,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -3091,7 +3091,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -3112,7 +3112,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -3127,7 +3127,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -3148,7 +3148,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -3163,7 +3163,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. @@ -3217,7 +3217,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -3240,7 +3240,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -3255,7 +3255,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -3278,7 +3278,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -3301,7 +3301,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -3316,7 +3316,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -3339,7 +3339,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -3354,7 +3354,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. @@ -3410,7 +3410,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -3431,7 +3431,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -3446,7 +3446,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -3467,7 +3467,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -3488,7 +3488,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -3503,7 +3503,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -3524,7 +3524,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -3539,7 +3539,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_3D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_3D_K.H index 9211f6ef2de..23b69982bba 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_3D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_3D_K.H @@ -262,7 +262,7 @@ inline void mlndlap_bc_doit (Box const& vbx, Array4 const& a, Box const& doma if (! bfhi[idim]) gdomain.growHi(idim,1); } - if (gdomain.strictly_contains(vbx)) return; + if (gdomain.strictly_contains(vbx)) { return; } const int offset = domain.cellCentered() ? 0 : 1; @@ -8711,7 +8711,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -8722,7 +8722,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -8733,7 +8733,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -8744,7 +8744,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -8755,7 +8755,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -8766,7 +8766,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -8777,7 +8777,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -8788,7 +8788,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 9 || offset == 0) { @@ -8799,7 +8799,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 10 || offset == 0) { @@ -8810,7 +8810,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 11 || offset == 0) { @@ -8821,7 +8821,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 12 || offset == 0) { @@ -8832,7 +8832,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 13 || offset == 0) { @@ -8843,7 +8843,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 14 || offset == 0) { @@ -8854,7 +8854,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 15 || offset == 0) { @@ -8865,7 +8865,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 16 || offset == 0) { @@ -8876,7 +8876,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 17 || offset == 0) { @@ -8887,7 +8887,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 18 || offset == 0) { @@ -8898,7 +8898,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 19 || offset == 0) { @@ -8909,7 +8909,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 20 || offset == 0) { @@ -8920,7 +8920,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 21 || offset == 0) { @@ -8931,7 +8931,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 22 || offset == 0) { @@ -8942,7 +8942,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 23 || offset == 0) { @@ -8953,7 +8953,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 24 || offset == 0) { @@ -8964,7 +8964,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 25 || offset == 0) { @@ -8975,7 +8975,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 26 || offset == 0) { @@ -8986,7 +8986,7 @@ void mlndlap_fillijmat_sten_gpu (const int ps, const int i, const int j, const i } ++nelems; } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. @@ -9039,7 +9039,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -9060,7 +9060,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -9075,7 +9075,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -9096,7 +9096,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -9123,7 +9123,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -9144,7 +9144,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -9159,7 +9159,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -9180,7 +9180,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 9 || offset == 0) { @@ -9195,7 +9195,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 10 || offset == 0) { @@ -9216,7 +9216,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 11 || offset == 0) { @@ -9243,7 +9243,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 12 || offset == 0) { @@ -9264,7 +9264,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 13 || offset == 0) { @@ -9291,7 +9291,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 14 || offset == 0) { @@ -9318,7 +9318,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 15 || offset == 0) { @@ -9339,7 +9339,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 16 || offset == 0) { @@ -9366,7 +9366,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 17 || offset == 0) { @@ -9387,7 +9387,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 18 || offset == 0) { @@ -9402,7 +9402,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 19 || offset == 0) { @@ -9423,7 +9423,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 20 || offset == 0) { @@ -9438,7 +9438,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 21 || offset == 0) { @@ -9459,7 +9459,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 22 || offset == 0) { @@ -9486,7 +9486,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 23 || offset == 0) { @@ -9507,7 +9507,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 24 || offset == 0) { @@ -9522,7 +9522,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 25 || offset == 0) { @@ -9543,7 +9543,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 26 || offset == 0) { @@ -9558,7 +9558,7 @@ void mlndlap_fillijmat_aa_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. @@ -9608,7 +9608,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -9633,7 +9633,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -9650,7 +9650,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -9675,7 +9675,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -9711,7 +9711,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -9736,7 +9736,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -9753,7 +9753,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -9778,7 +9778,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 9 || offset == 0) { @@ -9795,7 +9795,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 10 || offset == 0) { @@ -9820,7 +9820,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 11 || offset == 0) { @@ -9855,7 +9855,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 12 || offset == 0) { @@ -9880,7 +9880,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 13 || offset == 0) { @@ -9915,7 +9915,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 14 || offset == 0) { @@ -9950,7 +9950,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 15 || offset == 0) { @@ -9975,7 +9975,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 16 || offset == 0) { @@ -10010,7 +10010,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 17 || offset == 0) { @@ -10035,7 +10035,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 18 || offset == 0) { @@ -10052,7 +10052,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 19 || offset == 0) { @@ -10077,7 +10077,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 20 || offset == 0) { @@ -10094,7 +10094,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 21 || offset == 0) { @@ -10119,7 +10119,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 22 || offset == 0) { @@ -10154,7 +10154,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 23 || offset == 0) { @@ -10179,7 +10179,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 24 || offset == 0) { @@ -10196,7 +10196,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 25 || offset == 0) { @@ -10221,7 +10221,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 26 || offset == 0) { @@ -10238,7 +10238,7 @@ void mlndlap_fillijmat_ha_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. @@ -10290,7 +10290,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 2 || offset == 0) { @@ -10311,7 +10311,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 3 || offset == 0) { @@ -10326,7 +10326,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 4 || offset == 0) { @@ -10347,7 +10347,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 5 || offset == 0) { @@ -10374,7 +10374,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 6 || offset == 0) { @@ -10395,7 +10395,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 7 || offset == 0) { @@ -10410,7 +10410,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 8 || offset == 0) { @@ -10431,7 +10431,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 9 || offset == 0) { @@ -10446,7 +10446,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 10 || offset == 0) { @@ -10467,7 +10467,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 11 || offset == 0) { @@ -10494,7 +10494,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 12 || offset == 0) { @@ -10515,7 +10515,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 13 || offset == 0) { @@ -10542,7 +10542,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 14 || offset == 0) { @@ -10569,7 +10569,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 15 || offset == 0) { @@ -10590,7 +10590,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 16 || offset == 0) { @@ -10617,7 +10617,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 17 || offset == 0) { @@ -10638,7 +10638,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 18 || offset == 0) { @@ -10653,7 +10653,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 19 || offset == 0) { @@ -10674,7 +10674,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 20 || offset == 0) { @@ -10689,7 +10689,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 21 || offset == 0) { @@ -10710,7 +10710,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 22 || offset == 0) { @@ -10737,7 +10737,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 23 || offset == 0) { @@ -10758,7 +10758,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 24 || offset == 0) { @@ -10773,7 +10773,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 25 || offset == 0) { @@ -10794,7 +10794,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } if (offset == 26 || offset == 0) { @@ -10809,7 +10809,7 @@ void mlndlap_fillijmat_cs_gpu (const int ps, const int i, const int j, const int ++nelems; } } - if (offset != 0) return; + if (offset != 0) { return; } } // Only offset == 0 could get this far. diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_K.H index 211c4abf6a2..32bd012ac34 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_K.H @@ -206,7 +206,7 @@ bool mlndlap_any_fine_sync_cells (Box const& bx, Array4 const& msk, i for (int k = lo.z; k <= hi.z; ++k) { for (int j = lo.y; j <= hi.y; ++j) { for (int i = lo.x; i <= hi.x; ++i) { - if (msk(i,j,k) == fine_flag) return true; + if (msk(i,j,k) == fine_flag) { return true; } }}} return false; } diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp index e33bdfdb21d..23e81402021 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp @@ -838,7 +838,7 @@ MLNodeLaplacian::normalize (int amrlev, int mglev, MultiFab& mf) const { BL_PROFILE("MLNodeLaplacian::normalize()"); - if (m_sigma[0][0][0] == nullptr) return; + if (m_sigma[0][0][0] == nullptr) { return; } const auto& sigma = m_sigma[amrlev][mglev]; const auto& stencil = m_stencil[amrlev][mglev]; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_eb.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_eb.cpp index 67ebc27b884..eebfc961bb3 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_eb.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_eb.cpp @@ -14,7 +14,7 @@ namespace amrex { void MLNodeLaplacian::buildIntegral () { - if (m_integral_built) return; + if (m_integral_built) { return; } BL_PROFILE("MLNodeLaplacian::buildIntegral()"); @@ -83,7 +83,7 @@ MLNodeLaplacian::buildIntegral () void MLNodeLaplacian::buildSurfaceIntegral () { - if (m_surface_integral_built) return; + if (m_surface_integral_built) { return; } BL_PROFILE("MLNodeLaplacian::buildSurfaceIntegral()"); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_misc.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_misc.cpp index 907b0483400..c9e2637c1a2 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_misc.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_misc.cpp @@ -18,7 +18,7 @@ MLNodeLaplacian::averageDownCoeffs () { BL_PROFILE("MLNodeLaplacian::averageDownCoeffs()"); - if (m_sigma[0][0][0] == nullptr) return; + if (m_sigma[0][0][0] == nullptr) { return; } if (m_coarsening_strategy == CoarseningStrategy::Sigma) { @@ -85,7 +85,7 @@ MLNodeLaplacian::averageDownCoeffs () void MLNodeLaplacian::averageDownCoeffsToCoarseAmrLevel (int flev) { - if (m_sigma[0][0][0] == nullptr) return; + if (m_sigma[0][0][0] == nullptr) { return; } const int mglev = 0; const int idim = 0; // other dimensions are just aliases @@ -101,9 +101,9 @@ MLNodeLaplacian::averageDownCoeffsToCoarseAmrLevel (int flev) void MLNodeLaplacian::averageDownCoeffsSameAmrLevel (int amrlev) { - if (m_sigma[0][0][0] == nullptr) return; + if (m_sigma[0][0][0] == nullptr) { return; } - if (m_coarsening_strategy != CoarseningStrategy::Sigma) return; + if (m_coarsening_strategy != CoarseningStrategy::Sigma) { return; } #if (AMREX_SPACEDIM == 1) const int nsigma = 1; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sten.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sten.cpp index 8a71c6cf760..ff3548cb4d8 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sten.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sten.cpp @@ -25,7 +25,7 @@ MLNodeLaplacian::buildStencil () m_s0_norm0[amrlev].resize(m_num_mg_levels[amrlev],0.0); } - if (m_coarsening_strategy != CoarseningStrategy::RAP) return; + if (m_coarsening_strategy != CoarseningStrategy::RAP) { return; } const int ncomp_s = (AMREX_SPACEDIM == 2) ? 5 : 9; AMREX_ALWAYS_ASSERT_WITH_MESSAGE(AMREX_SPACEDIM != 1, diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp index f6f6dbd80e6..14a58922c5e 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp @@ -257,7 +257,7 @@ void MLNodeLinOp_set_dot_mask (MultiFab& dot_mask, iMultiFab const& omask, Geome void MLNodeLinOp::buildMasks () { - if (m_masks_built) return; + if (m_masks_built) { return; } BL_PROFILE("MLNodeLinOp::buildMasks()"); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLPoisson.H b/Src/LinearSolvers/MLMG/AMReX_MLPoisson.H index 8cf808c073b..0586f833d53 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLPoisson.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLPoisson.H @@ -299,7 +299,7 @@ MLPoissonT::normalize (int amrlev, int mglev, MF& mf) const #if (AMREX_SPACEDIM != 3) BL_PROFILE("MLPoisson::normalize()"); - if (!this->m_has_metric_term) return; + if (!this->m_has_metric_term) { return; } const Real* dxinv = this->m_geom[amrlev][mglev].InvCellSize(); AMREX_D_TERM(const RT dhx = RT(dxinv[0]*dxinv[0]);, diff --git a/Src/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp b/Src/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp index f8a7ff71b97..adbc1b20c49 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLTensorOp.cpp @@ -207,7 +207,7 @@ MLTensorOp::apply (int amrlev, int mglev, MultiFab& out, MultiFab& in, BCMode bc MLABecLaplacian::apply(amrlev, mglev, out, in, bc_mode, s_mode, bndry); - if (mglev >= m_kappa[amrlev].size()) return; + if (mglev >= m_kappa[amrlev].size()) { return; } applyBCTensor(amrlev, mglev, in, bc_mode, s_mode, bndry); diff --git a/Src/Particle/AMReX_NeighborParticles.H b/Src/Particle/AMReX_NeighborParticles.H index 1e0872a032e..fd744c0be43 100644 --- a/Src/Particle/AMReX_NeighborParticles.H +++ b/Src/Particle/AMReX_NeighborParticles.H @@ -93,9 +93,9 @@ private: {} bool operator< (const NeighborCopyTag& other) const { - if (level != other.level) return level < other.level; - if (grid != other.grid) return grid < other.grid; - if (tile != other.tile) return tile < other.tile; + if (level != other.level) { return level < other.level; } + if (grid != other.grid) { return grid < other.grid; } + if (tile != other.tile) { return tile < other.tile; } AMREX_D_TERM( if (periodic_shift[0] != other.periodic_shift[0]) return periodic_shift[0] < other.periodic_shift[0];, @@ -433,15 +433,15 @@ protected: : grid_id(a_grid_id), box(a_box), periodic_shift(a_periodic_shift) {} bool operator<(const NeighborTask& other) const { - if (grid_id != other.grid_id) return grid_id < other.grid_id; - if (box != other.box ) return box < other.box; + if (grid_id != other.grid_id) { return grid_id < other.grid_id; } + if (box != other.box ) { return box < other.box; } AMREX_D_TERM( if (periodic_shift[0] != other.periodic_shift[0]) - return periodic_shift[0] < other.periodic_shift[0];, + { return periodic_shift[0] < other.periodic_shift[0]; }, if (periodic_shift[1] != other.periodic_shift[1]) - return periodic_shift[1] < other.periodic_shift[1];, + { return periodic_shift[1] < other.periodic_shift[1]; }, if (periodic_shift[2] != other.periodic_shift[2]) - return periodic_shift[2] < other.periodic_shift[2]; + { return periodic_shift[2] < other.periodic_shift[2]; } ) return false; } diff --git a/Src/Particle/AMReX_NeighborParticlesCPUImpl.H b/Src/Particle/AMReX_NeighborParticlesCPUImpl.H index 6be73c64a5a..3ba3509509f 100644 --- a/Src/Particle/AMReX_NeighborParticlesCPUImpl.H +++ b/Src/Particle/AMReX_NeighborParticlesCPUImpl.H @@ -132,7 +132,7 @@ sumNeighborsMPI (std::map >& not_ours, ParallelAllReduce::Max(num_isnds, ParallelContext::CommunicatorSub()); - if (num_isnds == 0) return; + if (num_isnds == 0) { return; } const int num_ircvs = neighbor_procs.size(); Vector stats(num_ircvs); @@ -461,7 +461,7 @@ getRcvCountsMPI () { ParallelAllReduce::Max(num_snds, ParallelContext::CommunicatorSub()); - if (num_snds == 0) return; + if (num_snds == 0) { return; } const int num_rcvs = neighbor_procs.size(); Vector stats(num_rcvs); @@ -509,7 +509,7 @@ fillNeighborsMPI (bool reuse_rcv_counts) { // each proc figures out how many bytes it will send, and how // many it will receive if (!reuse_rcv_counts) getRcvCountsMPI(); - if (num_snds == 0) return; + if (num_snds == 0) { return; } Vector RcvProc; Vector rOffset; // Offset (in bytes) in the receive buffer diff --git a/Src/Particle/AMReX_NeighborParticlesGPUImpl.H b/Src/Particle/AMReX_NeighborParticlesGPUImpl.H index 6338d9d55f8..83c6f0773b8 100644 --- a/Src/Particle/AMReX_NeighborParticlesGPUImpl.H +++ b/Src/Particle/AMReX_NeighborParticlesGPUImpl.H @@ -57,7 +57,7 @@ buildNeighborMask () const BoxArray& ba = this->ParticleBoxArray(lev); const DistributionMapping& dmap = this->ParticleDistributionMap(lev); - if (ba.size() == 1 && (! geom.isAnyPeriodic()) ) return; + if (ba.size() == 1 && (! geom.isAnyPeriodic()) ) { return; } if (m_neighbor_mask_ptr == nullptr || ! BoxArray::SameRefs(m_neighbor_mask_ptr->boxArray(), ba) || @@ -131,7 +131,7 @@ buildNeighborCopyOp (bool use_boundary_neighbor) auto& plev = this->GetParticles(lev); auto& ba = this->ParticleBoxArray(lev); - if (ba.size() == 1 && (! geom.isAnyPeriodic()) ) return; + if (ba.size() == 1 && (! geom.isAnyPeriodic()) ) { return; } for(MFIter mfi = this->MakeMFIter(lev); mfi.isValid(); ++mfi) { diff --git a/Src/Particle/AMReX_NeighborParticlesI.H b/Src/Particle/AMReX_NeighborParticlesI.H index 56ce4ff27d8..ea97ad7767f 100644 --- a/Src/Particle/AMReX_NeighborParticlesI.H +++ b/Src/Particle/AMReX_NeighborParticlesI.H @@ -550,7 +550,7 @@ getNeighborTags (Vector& tags, const ParticleType& p, const int lev = 0; const IntVect& iv = this->Index(p, lev); - if (shrink_box.contains(iv)) return; + if (shrink_box.contains(iv)) { return; } const Periodicity& periodicity = this->Geom(lev).periodicity(); const Box& domain = this->Geom(lev).Domain(); diff --git a/Src/Particle/AMReX_ParticleBufferMap.cpp b/Src/Particle/AMReX_ParticleBufferMap.cpp index 86686ec87b1..387f0a0680f 100644 --- a/Src/Particle/AMReX_ParticleBufferMap.cpp +++ b/Src/Particle/AMReX_ParticleBufferMap.cpp @@ -57,15 +57,15 @@ void ParticleBufferMap::define (const ParGDBBase* a_gdb) { int pid_a = std::get<2>(a); int pid_b = std::get<2>(b); - if (pid_a != pid_b) return pid_a < pid_b; + if (pid_a != pid_b) { return pid_a < pid_b; } int lev_a = std::get<1>(a); int lev_b = std::get<1>(b); - if (lev_a != lev_b) return lev_a < lev_b; + if (lev_a != lev_b) { return lev_a < lev_b; } int gid_a = std::get<0>(a); int gid_b = std::get<0>(b); - if (gid_a != gid_b) return gid_a < gid_b; + if (gid_a != gid_b) { return gid_a < gid_b; } return false; }); @@ -113,10 +113,10 @@ void ParticleBufferMap::define (const ParGDBBase* a_gdb) bool ParticleBufferMap::isValid (const ParGDBBase* a_gdb) const { - if (!m_defined) return false; + if (!m_defined) { return false; } int num_levs = a_gdb->finestLevel() + 1; - if (num_levs != m_ba.size()) return false; + if (num_levs != m_ba.size()) { return false; } bool valid = true; for (int lev = 0; lev < num_levs; ++lev) diff --git a/Src/Particle/AMReX_ParticleCommunication.H b/Src/Particle/AMReX_ParticleCommunication.H index 924fc894a89..ad50efb5cea 100644 --- a/Src/Particle/AMReX_ParticleCommunication.H +++ b/Src/Particle/AMReX_ParticleCommunication.H @@ -66,7 +66,7 @@ struct ParticleCopyOp [[nodiscard]] int numCopies (int gid, int lev) const { - if (m_boxes.size() <= lev) return 0; + if (m_boxes.size() <= lev) { return 0; } auto mit = m_boxes[lev].find(gid); return mit == m_boxes[lev].end() ? 0 : int(mit->second.size()); } @@ -461,7 +461,7 @@ void communicateParticlesStart (const PC& pc, ParticleCopyPlan& plan, const SndB const int NProcs = ParallelContext::NProcsSub(); const int MyProc = ParallelContext::MyProcSub(); - if (NProcs == 1) return; + if (NProcs == 1) { return; } Vector RcvProc; Vector rOffset; @@ -519,7 +519,7 @@ void communicateParticlesStart (const PC& pc, ParticleCopyPlan& plan, const SndB ParallelDescriptor::Arecv((char*) (rcv_buffer.dataPtr() + offset), Cnt, Who, SeqNum, ParallelContext::CommunicatorSub()).req(); } - if (plan.m_NumSnds == 0) return; + if (plan.m_NumSnds == 0) { return; } // Send. for (int i = 0; i < NProcs; ++i) @@ -554,7 +554,7 @@ void unpackRemotes (PC& pc, const ParticleCopyPlan& plan, Buffer& rcv_buffer, Un #ifdef AMREX_USE_MPI const int NProcs = ParallelContext::NProcsSub(); - if (NProcs == 1) return; + if (NProcs == 1) { return; } const int MyProc = ParallelContext::MyProcSub(); amrex::ignore_unused(MyProc); diff --git a/Src/Particle/AMReX_ParticleCommunication.cpp b/Src/Particle/AMReX_ParticleCommunication.cpp index 474c8adc40e..7742e31f0a7 100644 --- a/Src/Particle/AMReX_ParticleCommunication.cpp +++ b/Src/Particle/AMReX_ParticleCommunication.cpp @@ -54,7 +54,7 @@ void ParticleCopyPlan::buildMPIStart (const ParticleBufferMap& map, Long psize) const int MyProc = ParallelContext::MyProcSub(); const auto NNeighborProcs = static_cast(m_neighbor_procs.size()); - if (NProcs == 1) return; + if (NProcs == 1) { return; } m_Snds.resize(0); m_Snds.resize(NProcs, 0); @@ -212,7 +212,7 @@ void ParticleCopyPlan::buildMPIFinish (const ParticleBufferMap& map) // NOLINT(r #ifdef AMREX_USE_MPI const int NProcs = ParallelContext::NProcsSub(); - if (NProcs == 1) return; + if (NProcs == 1) { return; } if (m_nrcvs > 0) { diff --git a/Src/Particle/AMReX_ParticleContainerI.H b/Src/Particle/AMReX_ParticleContainerI.H index 9712a13a415..1736997b3f6 100644 --- a/Src/Particle/AMReX_ParticleContainerI.H +++ b/Src/Particle/AMReX_ParticleContainerI.H @@ -176,7 +176,7 @@ ParticleContainer_impl AMREX_ASSERT(m_gdb != nullptr); - if (!Geom(0).isAnyPeriodic()) return false; + if (!Geom(0).isAnyPeriodic()) { return false; } if (lev_max == -1) lev_max = finestLevel(); @@ -424,7 +424,7 @@ Long ParticleContainer_impl::Num { Long nparticles = 0; - if (level < 0 || level >= int(m_particles.size())) return nparticles; + if (level < 0 || level >= int(m_particles.size())) { return nparticles; } if (only_valid) { ReduceOps reduce_op; @@ -575,7 +575,7 @@ ParticleContainer_impl::Incremen BL_PROFILE("ParticleContainer::Increment"); AMREX_ASSERT(OK()); - if (m_particles.empty()) return; + if (m_particles.empty()) { return; } AMREX_ASSERT(lev >= 0 && lev < int(m_particles.size())); AMREX_ASSERT(numParticlesOutOfRange(*this, 0) == 0); @@ -609,7 +609,7 @@ void ParticleContainer_impl::RemoveParticlesAtLevel (int level) { BL_PROFILE("ParticleContainer::RemoveParticlesAtLevel()"); - if (level >= int(this->m_particles.size())) return; + if (level >= int(this->m_particles.size())) { return; } if (!this->m_particles[level].empty()) { @@ -1175,7 +1175,7 @@ ParticleContainer_impl { BL_PROFILE("ParticleContainer::SortParticlesByBin()"); - if (bin_size == IntVect::TheZeroVector()) return; + if (bin_size == IntVect::TheZeroVector()) { return; } for (int lev = 0; lev < numLevels(); ++lev) { diff --git a/Src/Particle/AMReX_ParticleIO.H b/Src/Particle/AMReX_ParticleIO.H index 4417385d39f..e9d8c478fb6 100644 --- a/Src/Particle/AMReX_ParticleIO.H +++ b/Src/Particle/AMReX_ParticleIO.H @@ -798,7 +798,7 @@ ParticleContainer_impl const int rank = ParallelDescriptor::MyProc(); const int NReaders = MaxReaders(); - if (rank >= NReaders) return; + if (rank >= NReaders) { return; } const int Navg = ngrids[lev] / NReaders; const int Nleft = ngrids[lev] - Navg * NReaders; diff --git a/Src/Particle/AMReX_ParticleLocator.H b/Src/Particle/AMReX_ParticleLocator.H index 35257049b9d..27246060b4a 100644 --- a/Src/Particle/AMReX_ParticleLocator.H +++ b/Src/Particle/AMReX_ParticleLocator.H @@ -178,7 +178,7 @@ public: bool isValid (const BoxArray& ba) const noexcept { - if (m_defined) return BoxArray::SameRefs(m_ba, ba); + if (m_defined) { return BoxArray::SameRefs(m_ba, ba); } return false; } @@ -220,13 +220,13 @@ struct AmrAssignGrid for (int lev = lev_max; lev >= lev_min; --lev) { int grid = m_funcs[lev](p); - if (grid >= 0) return makeTuple(grid, lev); + if (grid >= 0) { return makeTuple(grid, lev); } } for (int lev = lev_min; lev >= lev_min; --lev) { int grid = m_funcs[lev](p, nGrow); - if (grid >= 0) return makeTuple(grid, lev); + if (grid >= 0) { return makeTuple(grid, lev); } } return makeTuple(-1, -1); @@ -301,11 +301,12 @@ public: [[nodiscard]] bool isValid (const Vector& a_ba) const { if ( !m_defined || (m_locators.empty()) || - (m_locators.size() != a_ba.size()) ) return false; + (m_locators.size() != a_ba.size()) ) { return false; } bool all_valid = true; int num_levels = m_locators.size(); - for (int lev = 0; lev < num_levels; ++lev) + for (int lev = 0; lev < num_levels; ++lev) { all_valid = all_valid && m_locators[lev].isValid(a_ba[lev]); + } return all_valid; } diff --git a/Src/Particle/AMReX_ParticleMPIUtil.cpp b/Src/Particle/AMReX_ParticleMPIUtil.cpp index 64e9737a95a..d9b9f73a29f 100644 --- a/Src/Particle/AMReX_ParticleMPIUtil.cpp +++ b/Src/Particle/AMReX_ParticleMPIUtil.cpp @@ -26,7 +26,7 @@ namespace amrex { Vector& Snds, Vector& Rcvs) { Long NumSnds = CountSnds(not_ours, Snds); - if (NumSnds == 0) return NumSnds; + if (NumSnds == 0) { return NumSnds; } BL_COMM_PROFILE(BLProfiler::Alltoall, sizeof(Long), ParallelContext::MyProcSub(), BLProfiler::BeforeCall()); diff --git a/Src/Particle/AMReX_ParticleUtil.H b/Src/Particle/AMReX_ParticleUtil.H index 0d7f9af776b..b0ea012c641 100644 --- a/Src/Particle/AMReX_ParticleUtil.H +++ b/Src/Particle/AMReX_ParticleUtil.H @@ -74,7 +74,7 @@ numParticlesOutOfRange (Iterator const& pti, IntVect nGrow) [=] AMREX_GPU_DEVICE (int i) -> ReduceTuple { auto p = make_particle{}(ptd,i); - if ((p.id() < 0)) return false; + if ((p.id() < 0)) { return false; } IntVect iv( AMREX_D_DECL(int(amrex::Math::floor((p.pos(0)-plo[0])*dxi[0])), int(amrex::Math::floor((p.pos(1)-plo[1])*dxi[1])), @@ -383,7 +383,7 @@ int getParticleGrid (P const& p, amrex::Array4 const& mask, amrex::GpuArray const& dxi, const Box& domain) noexcept { - if (p.id() < 0) return -1; + if (p.id() < 0) { return -1; } IntVect iv = getParticleCell(p, plo, dxi, domain); return mask(iv); } @@ -441,7 +441,7 @@ partitionParticlesByDest (PTile& ptile, const PLocator& ploc, const ParticleBuff int lev_min, int lev_max, int nGrow, bool remove_negative) { const int np = ptile.numParticles(); - if (np == 0) return 0; + if (np == 0) { return 0; } auto getPID = pmap.getPIDFunctor(); diff --git a/Src/Particle/AMReX_SparseBins.H b/Src/Particle/AMReX_SparseBins.H index 035828b1da6..6ec80a0a831 100644 --- a/Src/Particle/AMReX_SparseBins.H +++ b/Src/Particle/AMReX_SparseBins.H @@ -39,18 +39,18 @@ struct SparseBinIteratorFactory [[nodiscard]] AMREX_GPU_HOST_DEVICE index_type getIndex (const index_type bin_number) const noexcept { - if (m_num_bins == 1) return 0; + if (m_num_bins == 1) { return 0; } index_type lo = 0; index_type hi = m_num_bins - 1; while (lo < hi) { - if (m_bins_ptr[lo] == bin_number) return lo; - if (m_bins_ptr[hi] == bin_number) return hi; + if (m_bins_ptr[lo] == bin_number) { return lo; } + if (m_bins_ptr[hi] == bin_number) { return hi; } index_type mid = (lo + hi) / 2; index_type mid_value = m_bins_ptr[mid]; - if (mid_value == bin_number) return mid; + if (mid_value == bin_number) { return mid; } mid_value < bin_number ? lo = mid+1 : hi = mid; } diff --git a/Src/Particle/AMReX_TracerParticles.cpp b/Src/Particle/AMReX_TracerParticles.cpp index 5d290be43f2..60a85700e46 100644 --- a/Src/Particle/AMReX_TracerParticles.cpp +++ b/Src/Particle/AMReX_TracerParticles.cpp @@ -73,7 +73,7 @@ TracerParticleContainer::AdvectWithUmac (MultiFab* umac, int lev, Real dt) [=] AMREX_GPU_DEVICE (int i) { ParticleType& p = p_pbox[i]; - if (p.id() <= 0) return; + if (p.id() <= 0) { return; } ParticleReal v[AMREX_SPACEDIM]; mac_interpolate(p, plo, dxi, umacarr, v); if (ipass == 0) @@ -151,7 +151,7 @@ TracerParticleContainer::AdvectWithUcc (const MultiFab& Ucc, int lev, Real dt) [=] AMREX_GPU_DEVICE (int i) { ParticleType& p = p_pbox[i]; - if (p.id() <= 0) return; + if (p.id() <= 0) { return; } ParticleReal v[AMREX_SPACEDIM]; cic_interpolate(p, plo, dxi, uccarr, v); diff --git a/Tests/Amr/Advection_AmrCore/Source/AmrCoreAdv.cpp b/Tests/Amr/Advection_AmrCore/Source/AmrCoreAdv.cpp index ea60a0a4077..3e4d05fbe20 100644 --- a/Tests/Amr/Advection_AmrCore/Source/AmrCoreAdv.cpp +++ b/Tests/Amr/Advection_AmrCore/Source/AmrCoreAdv.cpp @@ -332,7 +332,7 @@ AmrCoreAdv::ErrorEst (int lev, TagBoxArray& tags, Real /*time*/, int /*ngrow*/) } } - if (lev >= phierr.size()) return; + if (lev >= phierr.size()) { return; } // const int clearval = TagBox::CLEAR; const int tagval = TagBox::SET; diff --git a/Tests/Amr/Advection_AmrLevel/Source/AmrLevelAdv.cpp b/Tests/Amr/Advection_AmrLevel/Source/AmrLevelAdv.cpp index ecf7aec9f73..502fa6e246f 100644 --- a/Tests/Amr/Advection_AmrLevel/Source/AmrLevelAdv.cpp +++ b/Tests/Amr/Advection_AmrLevel/Source/AmrLevelAdv.cpp @@ -737,7 +737,7 @@ AmrLevelAdv::read_params () { static bool done = false; - if (done) return; + if (done) { return; } done = true; @@ -793,14 +793,14 @@ AmrLevelAdv::reflux () void AmrLevelAdv::avgDown () { - if (level == parent->finestLevel()) return; + if (level == parent->finestLevel()) { return; } avgDown(Phi_Type); } void AmrLevelAdv::avgDown (int state_indx) { - if (level == parent->finestLevel()) return; + if (level == parent->finestLevel()) { return; } AmrLevelAdv& fine_lev = getLevel(level+1); MultiFab& S_fine = fine_lev.get_new_data(state_indx); diff --git a/Tests/EB/CNS/Source/CNS.cpp b/Tests/EB/CNS/Source/CNS.cpp index 3ab01b68dd0..24eb6056d0d 100644 --- a/Tests/EB/CNS/Source/CNS.cpp +++ b/Tests/EB/CNS/Source/CNS.cpp @@ -286,7 +286,7 @@ CNS::printTotal () const void CNS::post_init (Real) { - if (level > 0) return; + if (level > 0) { return; } for (int k = parent->finestLevel()-1; k >= 0; --k) { getLevel(k).avgDown(); } @@ -417,7 +417,7 @@ CNS::avgDown () { BL_PROFILE("CNS::avgDown()"); - if (level == parent->finestLevel()) return; + if (level == parent->finestLevel()) { return; } auto& fine_lev = getLevel(level+1); diff --git a/Tests/EB_CNS/Source/CNS.cpp b/Tests/EB_CNS/Source/CNS.cpp index 5bb3c4e2532..40882a4edb0 100644 --- a/Tests/EB_CNS/Source/CNS.cpp +++ b/Tests/EB_CNS/Source/CNS.cpp @@ -293,7 +293,7 @@ CNS::printTotal () const void CNS::post_init (Real) { - if (level > 0) return; + if (level > 0) { return; } for (int k = parent->finestLevel()-1; k >= 0; --k) { getLevel(k).avgDown(); } @@ -462,7 +462,7 @@ CNS::avgDown () { BL_PROFILE("CNS::avgDown()"); - if (level == parent->finestLevel()) return; + if (level == parent->finestLevel()) { return; } auto& fine_lev = getLevel(level+1); diff --git a/Tests/GPU/CNS/Source/CNS.cpp b/Tests/GPU/CNS/Source/CNS.cpp index 1a073c68c8a..25823b9b76d 100644 --- a/Tests/GPU/CNS/Source/CNS.cpp +++ b/Tests/GPU/CNS/Source/CNS.cpp @@ -284,7 +284,7 @@ CNS::printTotal () const void CNS::post_init (Real) { - if (level > 0) return; + if (level > 0) { return; } for (int k = parent->finestLevel()-1; k >= 0; --k) { getLevel(k).avgDown(); } @@ -401,7 +401,7 @@ CNS::avgDown () { BL_PROFILE("CNS::avgDown()"); - if (level == parent->finestLevel()) return; + if (level == parent->finestLevel()) { return; } auto& fine_lev = getLevel(level+1); diff --git a/Tools/Plotfile/fcompare.cpp b/Tools/Plotfile/fcompare.cpp index 7dc5ed361ad..6a7b95daf5a 100644 --- a/Tools/Plotfile/fcompare.cpp +++ b/Tools/Plotfile/fcompare.cpp @@ -366,7 +366,7 @@ int main_main() if (! all_variables_found) { amrex::Print() << " WARNING: not all variables present in both files\n"; - if (abort_if_not_all_found) return EXIT_FAILURE; + if (abort_if_not_all_found) { return EXIT_FAILURE; } } if (any_nans) { diff --git a/Tools/Postprocessing/C_Src/particle_compare.cpp b/Tools/Postprocessing/C_Src/particle_compare.cpp index 84ceeed914a..9967625cca6 100644 --- a/Tools/Postprocessing/C_Src/particle_compare.cpp +++ b/Tools/Postprocessing/C_Src/particle_compare.cpp @@ -302,8 +302,8 @@ int sort_particles_ascending(const void *p, const void *q) std::memcpy(&cpu1, iptr1, sizeof(int)); std::memcpy(&cpu2, iptr2, sizeof(int)); - if (cpu1 != cpu2) return (cpu1 - cpu2); - if (id1 != id2 ) return (id1 - id2 ); + if (cpu1 != cpu2) { return (cpu1 - cpu2); } + if (id1 != id2 ) { return (id1 - id2 ); } return 0; } @@ -312,7 +312,7 @@ void compare_particle_chunk(const ParticleHeader& header1, std::vector& norms, int level, int file_num, int np, int offset) { - if (np == 0) return; + if (np == 0) { return; } std::string read_file1 = getDataFileName(header1.par_file_name, level, file_num); std::string read_file2 = getDataFileName(header2.par_file_name, level, file_num);