diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 85ebd085467..05c068d4b13 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -182,7 +182,7 @@ jobs: # Build 1D libamrex with configure configure-1d: - name: GNU@7.5 C++17 Release [configure 1D] + name: GNU@7.5 Release [configure 1D] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -196,7 +196,21 @@ jobs: # Build 2D libamrex with configure configure-2d: - name: GNU@7.5 C++17 Release [configure 2D] + name: Clang@6.0 NOMPI Release [configure 2D] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Dependencies + run: .github/workflows/dependencies/dependencies_clang6.sh + - name: Build & Install + run: | + ./configure --dim 2 --with-fortran no --comp llvm --with-mpi no + make -j2 WARN_ALL=TRUE + make install + + # Build 3D libamrex with configure + configure-3d: + name: GNU@7.5 Release [configure 3D] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -204,6 +218,6 @@ jobs: run: .github/workflows/dependencies/dependencies.sh - name: Build & Install run: | - ./configure --dim 2 - make -j2 + ./configure --dim 3 --enable-eb yes --enable-xsdk-defaults yes + make -j2 WARN_ALL=TRUE make install diff --git a/Src/Amr/AMReX_Amr.H b/Src/Amr/AMReX_Amr.H index 6a7432c3ec7..ccc4d10ae13 100644 --- a/Src/Amr/AMReX_Amr.H +++ b/Src/Amr/AMReX_Amr.H @@ -374,14 +374,14 @@ protected: Real stop_time); // pure virtural function in AmrCore - virtual void MakeNewLevelFromScratch (int lev, Real time, const BoxArray& ba, const DistributionMapping& dm) override - { amrex::Abort("How did we get her!"); } - virtual void MakeNewLevelFromCoarse (int lev, Real time, const BoxArray& ba, const DistributionMapping& dm) override - { amrex::Abort("How did we get her!"); } - virtual void RemakeLevel (int lev, Real time, const BoxArray& ba, const DistributionMapping& dm) override - { amrex::Abort("How did we get her!"); } - virtual void ClearLevel (int lev) override - { amrex::Abort("How did we get her!"); } + virtual void MakeNewLevelFromScratch (int /*lev*/, Real /*time*/, const BoxArray& /*ba*/, const DistributionMapping& /*dm*/) override + { amrex::Abort("How did we get here!"); } + virtual void MakeNewLevelFromCoarse (int /*lev*/, Real /*time*/, const BoxArray& /*ba*/, const DistributionMapping& /*dm*/) override + { amrex::Abort("How did we get here!"); } + virtual void RemakeLevel (int /*lev*/, Real /*time*/, const BoxArray& /*ba*/, const DistributionMapping& /*dm*/) override + { amrex::Abort("How did we get here!"); } + virtual void ClearLevel (int /*lev*/) override + { amrex::Abort("How did we get here!"); } //! Whether to write a plotfile now bool writePlotNow () noexcept; diff --git a/Src/Amr/AMReX_Amr.cpp b/Src/Amr/AMReX_Amr.cpp index 042fe2184e4..cce56622e80 100644 --- a/Src/Amr/AMReX_Amr.cpp +++ b/Src/Amr/AMReX_Amr.cpp @@ -1273,7 +1273,7 @@ Amr::initialInit (Real strt_time, void Amr::InitializeInit(Real strt_time, - Real stop_time, + Real /*stop_time*/, const BoxArray* lev0_grids, const Vector* pmap) { @@ -2743,6 +2743,8 @@ Amr::defBaseLevel (Real strt_time, const BoxArray* lev0_grids, const Vector* pmap) { + amrex::ignore_unused(pmap); + BL_PROFILE("Amr::defBaseLevel()"); // Just initialize this here for the heck of it which_level_being_advanced = -1; diff --git a/Src/Amr/AMReX_AmrLevel.H b/Src/Amr/AMReX_AmrLevel.H index c2b6741068b..a5d24c8e6fe 100644 --- a/Src/Amr/AMReX_AmrLevel.H +++ b/Src/Amr/AMReX_AmrLevel.H @@ -102,9 +102,9 @@ public: * Unlike writePlotFile, this is NOT a pure virtual function * so implementation by derived classes is optional. */ - virtual void writeSmallPlotFile (const std::string& dir, - std::ostream& os, - VisMF::How how = VisMF::NFiles) {}; + virtual void writeSmallPlotFile (const std::string& /*dir*/, + std::ostream& /*os*/, + VisMF::How /*how*/ = VisMF::NFiles) {}; //! Write current state to checkpoint file. virtual void checkPoint (const std::string& dir, std::ostream& os, @@ -380,7 +380,7 @@ public: #ifdef AMREX_PARTICLES //! This function can be called from the parent - virtual void particle_redistribute (int lbase = 0, bool a_init = false) {;} + virtual void particle_redistribute (int /*lbase*/ = 0, bool /*a_init*/ = false) {;} #endif static void FillPatch (AmrLevel& amrlevel, diff --git a/Src/Amr/AMReX_AmrLevel.cpp b/Src/Amr/AMReX_AmrLevel.cpp index 37945bcacc2..9c1afb98510 100644 --- a/Src/Amr/AMReX_AmrLevel.cpp +++ b/Src/Amr/AMReX_AmrLevel.cpp @@ -53,12 +53,12 @@ AmrLevel::postCoarseTimeStep (Real time) } void -AmrLevel::set_preferred_boundary_values (MultiFab& S, - int state_index, - int scomp, - int dcomp, - int ncomp, - Real time) const +AmrLevel::set_preferred_boundary_values (MultiFab& /*S*/, + int /*state_index*/, + int /*scomp*/, + int /*dcomp*/, + int /*ncomp*/, + Real /*time*/) const {} DeriveList& @@ -68,8 +68,8 @@ AmrLevel::get_derive_lst () noexcept } void -AmrLevel::manual_tags_placement (TagBoxArray& tags, - const Vector& bf_lev) +AmrLevel::manual_tags_placement (TagBoxArray& /*tags*/, + const Vector& /*bf_lev*/) {} AmrLevel::AmrLevel () noexcept @@ -362,15 +362,15 @@ AmrLevel::writePlotFile (const std::string& dir, void -AmrLevel::writePlotFilePre (const std::string& dir, - std::ostream& os) +AmrLevel::writePlotFilePre (const std::string& /*dir*/, + std::ostream& /*os*/) { } void -AmrLevel::writePlotFilePost (const std::string& dir, - std::ostream& os) +AmrLevel::writePlotFilePost (const std::string& /*dir*/, + std::ostream& /*os*/) { } @@ -448,7 +448,7 @@ AmrLevel::restart (Amr& papa, } void -AmrLevel::set_state_in_checkpoint (Vector& state_in_checkpoint) +AmrLevel::set_state_in_checkpoint (Vector& /*state_in_checkpoint*/) { amrex::Error("Class derived AmrLevel has to handle this!"); } @@ -537,16 +537,16 @@ AmrLevel::checkPoint (const std::string& dir, void -AmrLevel::checkPointPre (const std::string& dir, - std::ostream& os) +AmrLevel::checkPointPre (const std::string& /*dir*/, + std::ostream& /*os*/) { BL_PROFILE("AmrLevel::checkPointPre()"); } void -AmrLevel::checkPointPost (const std::string& dir, - std::ostream& os) +AmrLevel::checkPointPost (const std::string& /*dir*/, + std::ostream& /*os*/) { BL_PROFILE("AmrLevel::checkPointPost()"); } diff --git a/Src/Amr/AMReX_StateDescriptor.cpp b/Src/Amr/AMReX_StateDescriptor.cpp index 3cd8cadbd3a..f73966f59b9 100644 --- a/Src/Amr/AMReX_StateDescriptor.cpp +++ b/Src/Amr/AMReX_StateDescriptor.cpp @@ -20,8 +20,8 @@ StateDescriptor::BndryFunc::clone () const StateDescriptor::BndryFunc::~BndryFunc () {} bool -StateDescriptor::bf_thread_safety (const int* lo,const int* hi, - const int* dom_lo, const int* dom_hi, +StateDescriptor::bf_thread_safety (const int* /*lo*/,const int* /*hi*/, + const int* /*dom_lo*/, const int* /*dom_hi*/, const int* bc, int ng) { bool thread_safe = true; diff --git a/Src/AmrCore/AMReX_FillPatchUtil.H b/Src/AmrCore/AMReX_FillPatchUtil.H index ccb3c47f213..751c5369f3d 100644 --- a/Src/AmrCore/AMReX_FillPatchUtil.H +++ b/Src/AmrCore/AMReX_FillPatchUtil.H @@ -26,7 +26,7 @@ namespace amrex template struct NullInterpHook { - void operator() (FAB& fab, const Box& bx, int icomp, int ncomp) const {} + void operator() (FAB& /*fab*/, const Box& /*bx*/, int /*icomp*/, int /*ncomp*/) const {} }; template diff --git a/Src/AmrCore/AMReX_Interpolater.cpp b/Src/AmrCore/AMReX_Interpolater.cpp index 6b57b4b1683..abc96e9beb3 100644 --- a/Src/AmrCore/AMReX_Interpolater.cpp +++ b/Src/AmrCore/AMReX_Interpolater.cpp @@ -259,7 +259,7 @@ CellBilinear::interp (const FArrayBox& crse, Vector const& /*bcr*/, int actual_comp, int actual_state, - RunOn runon) + RunOn /*runon*/) { BL_PROFILE("CellBilinear::interp()"); // @@ -471,8 +471,13 @@ CellQuadratic::interp (const FArrayBox& crse, Vector const& bcr, int actual_comp, int actual_state, - RunOn runon) + RunOn /*runon*/) { +#if (AMREX_SPACEDIM == 1) + amrex::ignore_unused(crse,crse_comp,fine,fine_comp,ncomp,fine_region, + ratio,crse_geom,fine_geom,bcr,actual_comp,actual_state); + amrex::Abort("1D CellQuadratic::interp not supported"); +#else BL_PROFILE("CellQuadratic::interp()"); BL_ASSERT(bcr.size() >= ncomp); // @@ -543,8 +548,6 @@ CellQuadratic::interp (const FArrayBox& crse, Vector bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); -#if (AMREX_SPACEDIM > 1) - amrex_cqinterp (fdat,AMREX_ARLIM(flo),AMREX_ARLIM(fhi), AMREX_ARLIM(fblo), AMREX_ARLIM(fbhi), &ncomp,AMREX_D_DECL(&ratioV[0],&ratioV[1],&ratioV[2]), @@ -638,8 +641,8 @@ CellConservativeProtected::interp (const FArrayBox& crse, const Geometry& crse_geom, const Geometry& fine_geom, Vector const& bcr, - int actual_comp, - int actual_state, + int /*actual_comp*/, + int /*actual_state*/, RunOn runon) { BL_PROFILE("CellConservativeProtected::interp()"); @@ -702,8 +705,14 @@ CellConservativeProtected::protect (const FArrayBox& crse, const Geometry& crse_geom, const Geometry& fine_geom, Vector& bcr, - RunOn runon) + RunOn /*runon*/) { +#if (AMREX_SPACEDIM > 1) + amrex::ignore_unused(crse,crse_comp,fine,fine_comp,fine_state, + state_comp,ncomp,fine_region,ratio, + crse_geom,fine_geom,bcr); + amrex::Abort("1D CellConservativeProtected::protect not supported"); +#else BL_PROFILE("CellConservativeProtected::protect()"); BL_ASSERT(bcr.size() >= ncomp); @@ -767,8 +776,6 @@ CellConservativeProtected::protect (const FArrayBox& crse, Vector bc = GetBCArray(bcr); const int* ratioV = ratio.getVect(); -#if (AMREX_SPACEDIM > 1) - amrex_protect_interp (fdat,AMREX_ARLIM(flo),AMREX_ARLIM(fhi), fblo, fbhi, cdat,AMREX_ARLIM(clo),AMREX_ARLIM(chi), @@ -822,7 +829,7 @@ CellConservativeQuartic::interp (const FArrayBox& crse, Vector const& bcr, int actual_comp, int actual_state, - RunOn runon) + RunOn /*runon*/) { BL_PROFILE("CellConservativeQuartic::interp()"); BL_ASSERT(bcr.size() >= ncomp); diff --git a/Src/AmrCore/AMReX_TagBox.cpp b/Src/AmrCore/AMReX_TagBox.cpp index efc2809e69d..456281dc8f5 100644 --- a/Src/AmrCore/AMReX_TagBox.cpp +++ b/Src/AmrCore/AMReX_TagBox.cpp @@ -89,6 +89,7 @@ TagBox::buffer (const IntVect& nbuff, const IntVect& nwid) noexcept const int* lo = domain.loVect(); TagType* d = dataPtr(); + amrex::ignore_unused(len); #define OFF(i,j,k,lo,len) AMREX_D_TERM(i-lo[0], +(j-lo[1])*len[0] , +(k-lo[2])*len[0]*len[1]) for (int k = klo; k <= khi; k++) diff --git a/Src/Base/AMReX.H b/Src/Base/AMReX.H index ef422b71f21..acf8747a737 100644 --- a/Src/Base/AMReX.H +++ b/Src/Base/AMReX.H @@ -89,6 +89,11 @@ namespace amrex void ExecOnFinalize (PTR_TO_VOID_FUNC); void ExecOnInitialize (PTR_TO_VOID_FUNC); + //! This shuts up the compiler about unused variables + template + AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE + void ignore_unused (const Ts&...) {} + //! Print out message to cerr and exit via amrex::Abort(). void Error (const std::string& msg); namespace detail { void Error_host_doit (const char * msg); } diff --git a/Src/Base/AMReX_Array4.H b/Src/Base/AMReX_Array4.H index e3022c5c9b7..3fd9ad9c62a 100644 --- a/Src/Base/AMReX_Array4.H +++ b/Src/Base/AMReX_Array4.H @@ -10,12 +10,12 @@ namespace amrex { struct Array4 { T* AMREX_RESTRICT p; - Long jstride; - Long kstride; - Long nstride; - Dim3 begin; - Dim3 end; // end is hi + 1 - int ncomp; + Long jstride = 0; + Long kstride = 0; + Long nstride = 0; + Dim3 begin{1,1,1}; + Dim3 end{0,0,0}; // end is hi + 1 + int ncomp=0; AMREX_GPU_HOST_DEVICE constexpr Array4 () noexcept : p(nullptr) {} diff --git a/Src/Base/AMReX_BLProfiler.H b/Src/Base/AMReX_BLProfiler.H index cb4eff409b2..e242751018e 100644 --- a/Src/Base/AMReX_BLProfiler.H +++ b/Src/Base/AMReX_BLProfiler.H @@ -525,17 +525,17 @@ namespace amrex { class BLProfiler { public: - explicit BLProfiler(const std::string &funcname) { } + explicit BLProfiler(const std::string &/*funcname*/) { } static void Initialize() { } static void InitParams() { } static void Finalize() { } - static void WriteStats(std::ostream &os) { } + static void WriteStats(std::ostream &/*os*/) { } static void WriteCommStats() { } void start() { } void stop() { } - static void InitParams(const Real ptl, const bool writeall, - const bool writefabs) { } - static void AddStep(const int snum) { } + static void InitParams(const Real /*ptl*/, const bool /*writeall*/, + const bool /*writefabs*/) { } + static void AddStep(const int /*snum*/) { } }; } diff --git a/Src/Base/AMReX_BLProfiler.cpp b/Src/Base/AMReX_BLProfiler.cpp index 8ba85b83477..78d226da272 100644 --- a/Src/Base/AMReX_BLProfiler.cpp +++ b/Src/Base/AMReX_BLProfiler.cpp @@ -1658,28 +1658,28 @@ namespace amrex { BL_FORT_PROC_DECL(BL_PROFFORTFUNCSTART_CPP,bl_proffortfuncstart_cpp) ( - const int istr[], const int *NSTR + const int /*istr*/[], const int * /*NSTR*/ ) { } BL_FORT_PROC_DECL(BL_PROFFORTFUNCSTOP_CPP,bl_proffortfuncstop_cpp) ( - const int istr[], const int *NSTR + const int /*istr*/[], const int * /*NSTR*/ ) { } BL_FORT_PROC_DECL(BL_PROFFORTFUNCSTART_CPP_INT,bl_proffortfuncstart_cpp_int) ( - int i + int /*i*/ ) { } BL_FORT_PROC_DECL(BL_PROFFORTFUNCSTOP_CPP_INT,bl_proffortfuncstop_cpp_int) ( - int i + int /*i*/ ) { } diff --git a/Src/Base/AMReX_BlockMutex.H b/Src/Base/AMReX_BlockMutex.H index 8339bfce8a0..a2f9d456e6c 100644 --- a/Src/Base/AMReX_BlockMutex.H +++ b/Src/Base/AMReX_BlockMutex.H @@ -11,7 +11,7 @@ struct BlockMutex { union state_t { - struct { int blockid; int count; }; + struct II { int blockid; int count; } data; unsigned long long ull; }; @@ -39,13 +39,13 @@ struct BlockMutex do { assumed = old; state_t val; - val.blockid = blockid; - if (assumed.blockid == blockid) { + val.data.blockid = blockid; + if (assumed.data.blockid == blockid) { // Already locked by another thread in this block. Need to ++count. - val.count = assumed.count + 1; + val.data.count = assumed.data.count + 1; } else { // Currently unlocked or locked by another block. Need to lock. - val.count = 1; + val.data.count = 1; assumed = FreeState(); } old.ull = atomicCAS((unsigned long long*)(m_state+i), assumed.ull, val.ull); @@ -63,13 +63,13 @@ struct BlockMutex do { assumed = old; state_t val; - if (assumed.count == 1) { + if (assumed.data.count == 1) { // Need to unlock val = FreeState(); } else { // --count, but do NOT unlock val = assumed; - --val.count; + --val.data.count; } old.ull = atomicCAS((unsigned long long*)(m_state+i), assumed.ull, val.ull); } while (assumed.ull != old.ull); diff --git a/Src/Base/AMReX_Box.cpp b/Src/Base/AMReX_Box.cpp index aa1314ba462..991583303d9 100644 --- a/Src/Base/AMReX_Box.cpp +++ b/Src/Base/AMReX_Box.cpp @@ -136,6 +136,8 @@ AllGatherBoxes (Vector& bxs) ParallelDescriptor::Bcast(recv_buffer.data(), count_tot, ParallelDescriptor::IOProcessorNumber()); bxs = std::move(recv_buffer); +#else + amrex::ignore_unused(bxs); #endif } diff --git a/Src/Base/AMReX_CArena.cpp b/Src/Base/AMReX_CArena.cpp index ce3e1bca307..f6bde9c0a62 100644 --- a/Src/Base/AMReX_CArena.cpp +++ b/Src/Base/AMReX_CArena.cpp @@ -121,8 +121,10 @@ CArena::free (void* vp) // `vp' had better be in the busy list. // auto busy_it = m_busylist.find(Node(vp,0,0)); - - BL_ASSERT(!(busy_it == m_busylist.end())); + if (busy_it == m_busylist.end()) { + amrex::Abort("CArena::free: unknown pointer"); + return; + } BL_ASSERT(m_freelist.find(*busy_it) == m_freelist.end()); m_actually_used -= busy_it->size(); diff --git a/Src/Base/AMReX_CoordSys.cpp b/Src/Base/AMReX_CoordSys.cpp index d23939c6e80..6fb8b53f16a 100644 --- a/Src/Base/AMReX_CoordSys.cpp +++ b/Src/Base/AMReX_CoordSys.cpp @@ -493,7 +493,7 @@ CoordSys::Volume (const Real xlo[AMREX_SPACEDIM], Real CoordSys::AreaLo (const IntVect& point, int dir) const noexcept { - amrex::ignore_unused(point); + amrex::ignore_unused(point,dir); #if (AMREX_SPACEDIM==2) Real xlo[AMREX_SPACEDIM]; switch (c_sys) @@ -529,7 +529,7 @@ CoordSys::AreaLo (const IntVect& point, int dir) const noexcept Real CoordSys::AreaHi (const IntVect& point, int dir) const noexcept { - amrex::ignore_unused(point); + amrex::ignore_unused(point,dir); #if (AMREX_SPACEDIM==2) Real xhi[AMREX_SPACEDIM]; switch (c_sys) diff --git a/Src/Base/AMReX_DistributionMapping.cpp b/Src/Base/AMReX_DistributionMapping.cpp index e6bbf1133f0..2d095157253 100644 --- a/Src/Base/AMReX_DistributionMapping.cpp +++ b/Src/Base/AMReX_DistributionMapping.cpp @@ -294,6 +294,7 @@ DistributionMapping::LeastUsedTeams (Vector & rteam, rteam.push_back(0); rworker.clear(); rworker.push_back(Vector(1,0)); + amrex::ignore_unused(nteams,nworkers); #endif } @@ -1471,6 +1472,8 @@ DistributionMapping::makeKnapSack (const LayoutData& rcost_local, r = DistributionMapping(pmap); } } +#else + amrex::ignore_unused(broadcastToAll); #endif return r; @@ -1713,6 +1716,8 @@ DistributionMapping::makeSFC (const LayoutData& rcost_local, r = DistributionMapping(pmap); } } +#else + amrex::ignore_unused(broadcastToAll); #endif return r; diff --git a/Src/Base/AMReX_Extension.H b/Src/Base/AMReX_Extension.H index 2ffe496db15..9d306fdb480 100644 --- a/Src/Base/AMReX_Extension.H +++ b/Src/Base/AMReX_Extension.H @@ -147,6 +147,15 @@ #include #endif +#if (__cplusplus >= 201703L) +#define AMREX_FALLTHROUGH [[fallthrough]] +#elif defined(__GNUC__) +#define AMREX_FALLTHROUGH [[gnu::fallthrough]] +#else +#define AMREX_FALLTHROUGH ((void)0) +#endif + + #endif /* !BL_LANG_FORT */ #endif diff --git a/Src/Base/AMReX_FACopyDescriptor.H b/Src/Base/AMReX_FACopyDescriptor.H index 1dce8057044..e03697ed251 100644 --- a/Src/Base/AMReX_FACopyDescriptor.H +++ b/Src/Base/AMReX_FACopyDescriptor.H @@ -563,13 +563,13 @@ FabArrayCopyDescriptor::CollectData () // for meta-data Vector md_sender, md_offset, md_icnts, md_bcnts; - int* md_recv_data; + int* md_recv_data = nullptr; Vector md_send_data; Vector md_recv_reqs, md_send_reqs; // for data Vector data_sender, data_offset; - value_type* recv_data; + value_type* recv_data = nullptr; Vector send_data; Vector data_recv_reqs, data_send_reqs; diff --git a/Src/Base/AMReX_FabArrayBase.cpp b/Src/Base/AMReX_FabArrayBase.cpp index 575aab62998..4ede01f1c1b 100644 --- a/Src/Base/AMReX_FabArrayBase.cpp +++ b/Src/Base/AMReX_FabArrayBase.cpp @@ -1678,6 +1678,8 @@ FabArrayBase::WaitForAsyncSends (int N_snds, BL_ASSERT(send_data.size() == N_snds); ParallelDescriptor::Waitall(send_reqs, stats); +#else + amrex::ignore_unused(N_snds,send_reqs,stats); #endif /*BL_USE_MPI*/ } diff --git a/Src/Base/AMReX_FabConv.cpp b/Src/Base/AMReX_FabConv.cpp index 49134ad7947..0f750aa6b28 100644 --- a/Src/Base/AMReX_FabConv.cpp +++ b/Src/Base/AMReX_FabConv.cpp @@ -239,6 +239,8 @@ RealDescriptor::newRealDescriptor (int iot, case FABio::FAB_DOUBLE: rd = new RealDescriptor(FPC::ieee_double, ord, 8); return rd; + default: + return rd; } } case FABio::FAB_NATIVE: diff --git a/Src/Base/AMReX_FilCC_1D_C.H b/Src/Base/AMReX_FilCC_1D_C.H index 77e12be9172..189debc6d78 100644 --- a/Src/Base/AMReX_FilCC_1D_C.H +++ b/Src/Base/AMReX_FilCC_1D_C.H @@ -12,9 +12,9 @@ inline void filcc_cell (const IntVect& iv, Array4 const& q, const int dcomp, const int numcomp, - GeometryData const& geom, const Real time, + GeometryData const& geom, const Real /*time*/, const BCRec* bcr, const int bcomp, - const int orig_comp) noexcept + const int /*orig_comp*/) noexcept { const int i = iv[0]; diff --git a/Src/Base/AMReX_FilCC_2D_C.H b/Src/Base/AMReX_FilCC_2D_C.H index 3a7508283b9..5aab33f7fc5 100644 --- a/Src/Base/AMReX_FilCC_2D_C.H +++ b/Src/Base/AMReX_FilCC_2D_C.H @@ -12,9 +12,9 @@ inline void filcc_cell (const IntVect& iv, Array4 const& q, const int dcomp, const int numcomp, - GeometryData const& geom, const Real time, + GeometryData const& geom, const Real /*time*/, const BCRec* bcr, const int bcomp, - const int orig_comp) noexcept + const int /*orig_comp*/) noexcept { const int i = iv[0]; const int j = iv[1]; diff --git a/Src/Base/AMReX_Machine.cpp b/Src/Base/AMReX_Machine.cpp index ada5b38aa0c..806d7921625 100644 --- a/Src/Base/AMReX_Machine.cpp +++ b/Src/Base/AMReX_Machine.cpp @@ -302,6 +302,7 @@ class Machine return result; #else + amrex::ignore_unused(flag_local_ranks); return Vector(nbh_rank_n, 0); #endif } @@ -548,21 +549,24 @@ class Machine min_avg_dist = avg_dist; } } - cur_node = std::move(*next_node); - next_node = nullptr; - candidates.erase(cur_node.id); - // add cur_node to result - result.push_back(cur_node.id); - total_rank_n += cur_node.rank_n; - total_pairs_dist += cur_node.sum_dist; + if (next_node) { + cur_node = std::move(*next_node); + next_node = nullptr; + candidates.erase(cur_node.id); - if (flag_verbose) { - Print() << " Added " << cur_node.id - << ": " << to_str(cur_node.coord) - << ", ranks: " << cur_node.rank_n - << ", total ranks: " << total_rank_n - << ", avg dist: " << min_avg_dist << std::endl; + // add cur_node to result + result.push_back(cur_node.id); + total_rank_n += cur_node.rank_n; + total_pairs_dist += cur_node.sum_dist; + + if (flag_verbose) { + Print() << " Added " << cur_node.id + << ": " << to_str(cur_node.coord) + << ", ranks: " << cur_node.rank_n + << ", total ranks: " << total_rank_n + << ", avg dist: " << min_avg_dist << std::endl; + } } } diff --git a/Src/Base/AMReX_MultiFab.cpp b/Src/Base/AMReX_MultiFab.cpp index defd1c1dc7c..a32b19a3692 100644 --- a/Src/Base/AMReX_MultiFab.cpp +++ b/Src/Base/AMReX_MultiFab.cpp @@ -861,6 +861,8 @@ indexFromValue (MultiFab const& mf, int comp, int nghost, Real value, MPI_Op mml MPI_Allreduce(&in, &out, 1, datatype, mmloc, comm); MPI_Bcast(&(loc[0]), AMREX_SPACEDIM, MPI_INT, out.rank, comm); } +#else + amrex::ignore_unused(mmloc); #endif return loc; diff --git a/Src/Base/AMReX_MultiFabUtil.cpp b/Src/Base/AMReX_MultiFabUtil.cpp index 9528cedae7b..f7f003aa37e 100644 --- a/Src/Base/AMReX_MultiFabUtil.cpp +++ b/Src/Base/AMReX_MultiFabUtil.cpp @@ -248,6 +248,8 @@ namespace amrex const Geometry& fgeom, const Geometry& cgeom, int scomp, int ncomp, const IntVect& ratio) { + amrex::ignore_unused(fgeom,cgeom); + BL_PROFILE("amrex::average_down_w_geom"); if (S_fine.is_nodal() || S_crse.is_nodal()) @@ -256,7 +258,6 @@ namespace amrex } #if (AMREX_SPACEDIM == 3) - amrex::ignore_unused(fgeom,cgeom); amrex::average_down(S_fine, S_crse, scomp, ncomp, ratio); return; #else diff --git a/Src/Base/AMReX_MultiFabUtil_1D_C.H b/Src/Base/AMReX_MultiFabUtil_1D_C.H index 5991fd8b0fa..4b234c3a9ec 100644 --- a/Src/Base/AMReX_MultiFabUtil_1D_C.H +++ b/Src/Base/AMReX_MultiFabUtil_1D_C.H @@ -157,7 +157,7 @@ inline void amrex_avgdown_faces (Box const& bx, Array4 const& crse, Array4 const& fine, int ccomp, int fcomp, int ncomp, - IntVect const& ratio, int idir) noexcept + IntVect const& ratio, int /*idir*/) noexcept { const auto clo = lbound(bx); const auto chi = ubound(bx); @@ -176,7 +176,7 @@ inline void amrex_avgdown_edges (Box const& bx, Array4 const& crse, Array4 const& fine, int ccomp, int fcomp, int ncomp, - IntVect const& ratio, int idir) noexcept + IntVect const& ratio, int /*idir*/) noexcept { const auto clo = lbound(bx); const auto chi = ubound(bx); diff --git a/Src/Base/AMReX_NFiles.cpp b/Src/Base/AMReX_NFiles.cpp index 6a893d3bc0a..0709dbc3141 100644 --- a/Src/Base/AMReX_NFiles.cpp +++ b/Src/Base/AMReX_NFiles.cpp @@ -310,6 +310,7 @@ bool NFilesIter::ReadyToWrite(bool appendFirst) { return false; #else + amrex::ignore_unused(appendFirst); if(finishedWriting) { return false; } diff --git a/Src/Base/AMReX_ParallelContext.cpp b/Src/Base/AMReX_ParallelContext.cpp index 83f8ba28337..2408430558d 100644 --- a/Src/Base/AMReX_ParallelContext.cpp +++ b/Src/Base/AMReX_ParallelContext.cpp @@ -73,6 +73,7 @@ Frame::local_to_global_rank (int* global, const int* local, std::size_t n) const for (std::size_t i = 0; i < n; ++i) global[i] = local[i]; } #else + amrex::ignore_unused(local); for (std::size_t i = 0; i < n; ++i) global[i] = 0; #endif } @@ -98,6 +99,7 @@ Frame::global_to_local_rank (int* local, const int* global, std::size_t n) const for (std::size_t i = 0; i < n; ++i) local[i] = global[i]; } #else + amrex::ignore_unused(global); for (std::size_t i = 0; i < n; ++i) local[i] = 0; #endif } diff --git a/Src/Base/AMReX_ParallelDescriptor.H b/Src/Base/AMReX_ParallelDescriptor.H index 569c8f67956..3f38524a441 100644 --- a/Src/Base/AMReX_ParallelDescriptor.H +++ b/Src/Base/AMReX_ParallelDescriptor.H @@ -138,6 +138,7 @@ while ( false ) MPI_Comm_rank(comm,&r); return r; #else + amrex::ignore_unused(comm); return 0; #endif } @@ -227,6 +228,7 @@ while ( false ) BL_MPI_REQUIRE(MPI_Comm_size(comm, &s)); return s; #else + amrex::ignore_unused(comm); return 1; #endif } @@ -1022,7 +1024,7 @@ ParallelDescriptor::GatherLayoutDataToVector (const LayoutData& sendbuf, } Vector disp(nprocs); - disp[0] = 0; + if (!disp.empty()) disp[0] = 0; std::partial_sum(recvcount.begin(), recvcount.end()-1, disp.begin()+1); Vector new_index_to_T(sendbuf.size()); @@ -1080,101 +1082,101 @@ namespace ParallelDescriptor { template Message -Asend(const T* buf, size_t n, int dst_pid, int tag) +Asend(const T* /*buf*/, size_t /*n*/, int /*dst_pid*/, int /*tag*/) { return Message(); } template Message -Asend(const T* buf, size_t n, int dst_pid, int tag, MPI_Comm comm) +Asend(const T* /*buf*/, size_t /*n*/, int /*dst_pid*/, int /*tag*/, MPI_Comm /*comm*/) { return Message(); } template Message -Asend(const std::vector& buf, int dst_pid, int tag) +Asend(const std::vector& /*buf*/, int /*dst_pid*/, int /*tag*/) { return Message(); } template Message -Send(const T* buf, size_t n, int dst_pid, int tag) +Send(const T* /*buf*/, size_t /*n*/, int /*dst_pid*/, int /*tag*/) { return Message(); } template Message -Send(const T* buf, size_t n, int dst_pid, int tag, MPI_Comm comm) +Send(const T* /*buf*/, size_t /*n*/, int /*dst_pid*/, int /*tag*/, MPI_Comm /*comm*/) { return Message(); } template Message -Send(const std::vector& buf, int dst_pid, int tag) +Send(const std::vector& /*buf*/, int /*dst_pid*/, int /*tag*/) { return Message(); } template Message -Arecv(T* buf, size_t n, int src_pid, int tag) +Arecv(T* /*buf*/, size_t /*n*/, int /*src_pid*/, int /*tag*/) { return Message(); } template Message -Arecv(T* buf, size_t n, int src_pid, int tag, MPI_Comm comm) +Arecv(T* /*buf*/, size_t /*n*/, int /*src_pid*/, int /*tag*/, MPI_Comm /*comm*/) { return Message(); } template Message -Arecv(std::vector& buf, int src_pid, int tag) +Arecv(std::vector& /*buf*/, int /*src_pid*/, int /*tag*/) { return Message(); } template Message -Recv(T* buf, size_t n, int src_pid, int tag) +Recv(T* /*buf*/, size_t /*n*/, int /*src_pid*/, int /*tag*/) { return Message(); } template Message -Recv(T* buf, size_t n, int src_pid, int tag, MPI_Comm comm) +Recv(T* /*buf*/, size_t /*n*/, int /*src_pid*/, int /*tag*/, MPI_Comm /*comm*/) { return Message(); } template Message -Recv(std::vector& buf, int src_pid, int tag) +Recv(std::vector& /*buf*/, int /*src_pid*/, int /*tag*/) { return Message(); } template void -Bcast(T* t, size_t n, int root) +Bcast(T* /*t*/, size_t /*n*/, int /*root*/) {} template void -Bcast(T* t, size_t n, int root, const MPI_Comm &comm) +Bcast(T* /*t*/, size_t /*n*/, int /*root*/, const MPI_Comm & /*comm*/) {} template void -Gather(const T* t, size_t n, T1* t1, size_t n1, int root) +Gather(const T* /*t*/, size_t /*n*/, T1* /*t1*/, size_t /*n1*/, int /*root*/) {} template @@ -1189,7 +1191,7 @@ Gather(const T& t, int root) template void GatherLayoutDataToVector (const LayoutData& sendbuf, - Vector& recvbuf, int root) + Vector& recvbuf, int /*root*/) { for (int i=0; i& sendbuf, template void -Scatter(T* t, size_t n, const T1* t1, size_t n1, int root) +Scatter(T* /*t*/, size_t /*n*/, const T1* /*t1*/, size_t /*n1*/, int /*root*/) {} } diff --git a/Src/Base/AMReX_ParallelDescriptor.cpp b/Src/Base/AMReX_ParallelDescriptor.cpp index f96188c684b..02093a9dac9 100644 --- a/Src/Base/AMReX_ParallelDescriptor.cpp +++ b/Src/Base/AMReX_ParallelDescriptor.cpp @@ -1761,8 +1761,8 @@ ParallelDescriptor::Bcast(void *buf, #else /*!BL_USE_MPI*/ void -ParallelDescriptor::StartParallel (int* argc, - char*** argv, +ParallelDescriptor::StartParallel (int* /*argc*/, + char*** /*argv*/, MPI_Comm) { m_comm = 0; @@ -1776,6 +1776,7 @@ ParallelDescriptor::Gather (Real* sendbuf, Real* recvbuf, int root) { + amrex::ignore_unused(root); BL_ASSERT(root == 0); BL_ASSERT(nsend > 0); BL_ASSERT(!(sendbuf == 0)); @@ -1811,10 +1812,10 @@ void ParallelDescriptor::Abort (int s, bool backtrace) const char* ParallelDescriptor::ErrorString (int) { return ""; } -void ParallelDescriptor::Barrier (const std::string &message) {} -void ParallelDescriptor::Barrier (const MPI_Comm &comm, const std::string &message) {} +void ParallelDescriptor::Barrier (const std::string &/*message*/) {} +void ParallelDescriptor::Barrier (const MPI_Comm &/*comm*/, const std::string &/*message*/) {} ParallelDescriptor::Message ParallelDescriptor::Abarrier () { return ParallelDescriptor::Message(); } -ParallelDescriptor::Message ParallelDescriptor::Abarrier (const MPI_Comm &comm) { return ParallelDescriptor::Message(); } +ParallelDescriptor::Message ParallelDescriptor::Abarrier (const MPI_Comm &/*comm*/) { return ParallelDescriptor::Message(); } void ParallelDescriptor::Test (MPI_Request&, int&, MPI_Status&) {} void ParallelDescriptor::IProbe (int, int, int&, MPI_Status&) {} @@ -1838,13 +1839,13 @@ void ParallelDescriptor::ReduceRealMax (Real*,int,int) {} void ParallelDescriptor::ReduceRealMin (Real*,int,int) {} void ParallelDescriptor::ReduceRealSum (Real*,int,int) {} -void ParallelDescriptor::ReduceRealSum (Vector >&& rvar) {} -void ParallelDescriptor::ReduceRealMax (Vector >&& rvar) {} -void ParallelDescriptor::ReduceRealMin (Vector >&& rvar) {} +void ParallelDescriptor::ReduceRealSum (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceRealMax (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceRealMin (Vector >&& /*rvar*/) {} -void ParallelDescriptor::ReduceRealSum (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceRealMax (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceRealMin (Vector >&& rvar, int cpu) {} +void ParallelDescriptor::ReduceRealSum (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceRealMax (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceRealMin (Vector >&& /*rvar*/, int /*cpu*/) {} void ParallelDescriptor::ReduceLongAnd (Long&) {} void ParallelDescriptor::ReduceLongSum (Long&) {} @@ -1866,15 +1867,15 @@ void ParallelDescriptor::ReduceLongSum (Long*,int,int) {} void ParallelDescriptor::ReduceLongMax (Long*,int,int) {} void ParallelDescriptor::ReduceLongMin (Long*,int,int) {} -void ParallelDescriptor::ReduceLongAnd (Vector >&& rvar) {} -void ParallelDescriptor::ReduceLongSum (Vector >&& rvar) {} -void ParallelDescriptor::ReduceLongMax (Vector >&& rvar) {} -void ParallelDescriptor::ReduceLongMin (Vector >&& rvar) {} +void ParallelDescriptor::ReduceLongAnd (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceLongSum (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceLongMax (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceLongMin (Vector >&& /*rvar*/) {} -void ParallelDescriptor::ReduceLongAnd (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceLongSum (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceLongMax (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceLongMin (Vector >&& rvar, int cpu) {} +void ParallelDescriptor::ReduceLongAnd (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceLongSum (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceLongMax (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceLongMin (Vector >&& /*rvar*/, int /*cpu*/) {} void ParallelDescriptor::ReduceIntSum (int&) {} void ParallelDescriptor::ReduceIntMax (int&) {} @@ -1892,13 +1893,13 @@ void ParallelDescriptor::ReduceIntSum (int*,int,int) {} void ParallelDescriptor::ReduceIntMax (int*,int,int) {} void ParallelDescriptor::ReduceIntMin (int*,int,int) {} -void ParallelDescriptor::ReduceIntSum (Vector >&& rvar) {} -void ParallelDescriptor::ReduceIntMax (Vector >&& rvar) {} -void ParallelDescriptor::ReduceIntMin (Vector >&& rvar) {} +void ParallelDescriptor::ReduceIntSum (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceIntMax (Vector >&& /*rvar*/) {} +void ParallelDescriptor::ReduceIntMin (Vector >&& /*rvar*/) {} -void ParallelDescriptor::ReduceIntSum (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceIntMax (Vector >&& rvar, int cpu) {} -void ParallelDescriptor::ReduceIntMin (Vector >&& rvar, int cpu) {} +void ParallelDescriptor::ReduceIntSum (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceIntMax (Vector >&& /*rvar*/, int /*cpu*/) {} +void ParallelDescriptor::ReduceIntMin (Vector >&& /*rvar*/, int /*cpu*/) {} void ParallelDescriptor::ReduceBoolAnd (bool&) {} void ParallelDescriptor::ReduceBoolOr (bool&) {} @@ -1915,26 +1916,26 @@ ParallelDescriptor::second () noexcept } void -ParallelDescriptor::Wait (MPI_Request& req, - MPI_Status& status) +ParallelDescriptor::Wait (MPI_Request& /*req*/, + MPI_Status& /*status*/) {} void -ParallelDescriptor::Waitall (Vector& reqs, - Vector& status) +ParallelDescriptor::Waitall (Vector& /*reqs*/, + Vector& /*status*/) {} void -ParallelDescriptor::Waitany (Vector& reqs, - int &index, - MPI_Status& status) +ParallelDescriptor::Waitany (Vector& /*reqs*/, + int &/*index*/, + MPI_Status& /*status*/) {} void -ParallelDescriptor::Waitsome (Vector& reqs, - int& completed, - Vector& indx, - Vector& status) +ParallelDescriptor::Waitsome (Vector& /*reqs*/, + int& /*completed*/, + Vector& /*indx*/, + Vector& /*status*/) {} #endif diff --git a/Src/Base/AMReX_ParallelReduce.H b/Src/Base/AMReX_ParallelReduce.H index 5ae621bf060..70e90d6ccdf 100644 --- a/Src/Base/AMReX_ParallelReduce.H +++ b/Src/Base/AMReX_ParallelReduce.H @@ -86,12 +86,12 @@ namespace detail { } #else - template void Reduce (ReduceOp op, T* v, int cnt, int root, MPI_Comm comm) {} - template void Reduce (ReduceOp op, T& v, int root, MPI_Comm comm) {} - template void Reduce (ReduceOp op, Vector > const & v, int root, MPI_Comm comm) {} + template void Reduce (ReduceOp /*op*/, T* /*v*/, int /*cnt*/, int /*root*/, MPI_Comm /*comm*/) {} + template void Reduce (ReduceOp /*op*/, T& /*v*/, int /*root*/, MPI_Comm /*comm*/) {} + template void Reduce (ReduceOp /*op*/, Vector > const & /*v*/, int /*root*/, MPI_Comm /*comm*/) {} - template void Gather (const T* v, int cnt, T* vs, int root, MPI_Comm comm) {} - template void Gather (const T& v, T * vs, int root, MPI_Comm comm) {} + template void Gather (const T* /*v*/, int /*cnt*/, T* /*vs*/, int /*root*/, MPI_Comm /*comm*/) {} + template void Gather (const T& /*v*/, T * /*vs*/, int /*root*/, MPI_Comm /*comm*/) {} #endif } diff --git a/Src/Base/AMReX_ParmParse.cpp b/Src/Base/AMReX_ParmParse.cpp index b3f0ea0e43a..f9d373a043f 100644 --- a/Src/Base/AMReX_ParmParse.cpp +++ b/Src/Base/AMReX_ParmParse.cpp @@ -593,6 +593,7 @@ bldTable (const char*& str, { amrex::Abort("ParmParse::bldTable() defn with no list"); } + AMREX_FALLTHROUGH; case pEOF: addDefn(cur_name,cur_list,tab); return; @@ -636,6 +637,7 @@ bldTable (const char*& str, // // Otherwise, fall through, this may be a string. // + AMREX_FALLTHROUGH; case pValue: if ( cur_name.empty() ) { diff --git a/Src/Base/AMReX_PhysBCFunct.H b/Src/Base/AMReX_PhysBCFunct.H index 130cdea50ce..0723b616fe9 100644 --- a/Src/Base/AMReX_PhysBCFunct.H +++ b/Src/Base/AMReX_PhysBCFunct.H @@ -413,6 +413,7 @@ GpuBndryFuncFab::ccdoit (Box const& bx, FArrayBox& dest, Box tmp = b & bx; amrex::For(tmp, [=] (int i, int j, int k) noexcept { + amrex::ignore_unused(j,k); IntVect const cell(AMREX_D_DECL(i,j,k)); filcc_cell(cell, fab, dcomp, numcomp, geomdata, time, bcr_p, 0, orig_comp); @@ -453,6 +454,7 @@ GpuBndryFuncFab::ccdoit (Box const& bx, FArrayBox& dest, Box tmp = b & bx; amrex::For(tmp, [=] (int i, int j, int k) noexcept { + amrex::ignore_unused(j,k); IntVect const cell(AMREX_D_DECL(i,j,k)); filcc_cell(cell, fab, dcomp, numcomp, geomdata, time, bcr_p, 0, orig_comp); diff --git a/Src/Base/AMReX_Reduce.H b/Src/Base/AMReX_Reduce.H index 80b6c5f9f43..2373c222e2e 100644 --- a/Src/Base/AMReX_Reduce.H +++ b/Src/Base/AMReX_Reduce.H @@ -677,7 +677,7 @@ private: template AMREX_FORCE_INLINE - static auto call_f (Box const& box, D & reduce_data, F const& f) + static auto call_f (Box const& box, D & /*reduce_data*/, F const& f) noexcept -> decltype(f(0,0,0)) { using ReduceTuple = typename D::Type; diff --git a/Src/Base/AMReX_Utility.H b/Src/Base/AMReX_Utility.H index 37bb756eec0..7c16363b5e0 100644 --- a/Src/Base/AMReX_Utility.H +++ b/Src/Base/AMReX_Utility.H @@ -31,11 +31,6 @@ namespace amrex * \brief Useful C++ Utility Functions */ - //! This shuts up the compiler about unused variables - template - AMREX_GPU_HOST_DEVICE - void ignore_unused (const Ts&...) {} - //! Return true if argument is a non-zero length string of digits. bool is_integer (const char* str); diff --git a/Src/Base/AMReX_VisMF.cpp b/Src/Base/AMReX_VisMF.cpp index 5ef005f4d08..53ca30e5f4b 100644 --- a/Src/Base/AMReX_VisMF.cpp +++ b/Src/Base/AMReX_VisMF.cpp @@ -707,6 +707,8 @@ void VisMF::Header::CalculateMinMax (const FabArray& mf, int procToWrite, MPI_Comm comm) { + amrex::ignore_unused(procToWrite,comm); + // BL_PROFILE("VisMF::CalculateMinMax"); m_min.resize(m_ba.size()); diff --git a/Src/Base/AMReX_iMultiFab.cpp b/Src/Base/AMReX_iMultiFab.cpp index f2750c0e2e7..4d929105dc4 100644 --- a/Src/Base/AMReX_iMultiFab.cpp +++ b/Src/Base/AMReX_iMultiFab.cpp @@ -389,6 +389,8 @@ indexFromValue (iMultiFab const& mf, int comp, int nghost, int value, MPI_Op mml MPI_Allreduce(&in, &out, 1, datatype, mmloc, comm); MPI_Bcast(&(loc[0]), AMREX_SPACEDIM, MPI_INT, out.rank, comm); } +#else + amrex::ignore_unused(mmloc); #endif return loc; diff --git a/Src/Boundary/AMReX_InterpBndryData.H b/Src/Boundary/AMReX_InterpBndryData.H index 3de0cd1bf52..e83cef673f5 100644 --- a/Src/Boundary/AMReX_InterpBndryData.H +++ b/Src/Boundary/AMReX_InterpBndryData.H @@ -94,8 +94,8 @@ public: * \param ratio * \param comp */ - virtual void setBndryConds (const BCRec& phys_bc, - const IntVect& ratio, + virtual void setBndryConds (const BCRec& /*phys_bc*/, + const IntVect& /*ratio*/, int /*comp*/ = 0) {} /** diff --git a/Src/Boundary/AMReX_InterpBndryData_1D_K.H b/Src/Boundary/AMReX_InterpBndryData_1D_K.H index a102f9392e2..224ba12f246 100644 --- a/Src/Boundary/AMReX_InterpBndryData_1D_K.H +++ b/Src/Boundary/AMReX_InterpBndryData_1D_K.H @@ -20,7 +20,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void interpbndrydata_x_o3 (int i, int /*j*/, int /*k*/, int n, Array4 const& bdry, int nb, Array4 const& crse, int nc, Dim3 const& r, - Array4 const& mask, int not_covered) noexcept + Array4 const& /*mask*/, int /*not_covered*/) noexcept { int ic = amrex::coarsen(i,r.x); bdry(i,0,0,n+nb) = crse(ic,0,0,n+nc); diff --git a/Src/Boundary/AMReX_YAFluxRegister_1D_K.H b/Src/Boundary/AMReX_YAFluxRegister_1D_K.H index a6e8a32c593..04f40382de8 100644 --- a/Src/Boundary/AMReX_YAFluxRegister_1D_K.H +++ b/Src/Boundary/AMReX_YAFluxRegister_1D_K.H @@ -33,7 +33,6 @@ void yafluxreg_fineadd (Box const& bx, Array4 const& d, Array4 Real dtdx, int nc, int dirside, Dim3 const& rr) noexcept { const auto lo = amrex::lbound(bx); - const auto hi = amrex::ubound(bx); switch (dirside) { case 0 : diff --git a/Src/EB/AMReX_EB2_2D_C.cpp b/Src/EB/AMReX_EB2_2D_C.cpp index f5b92555d37..96b3d0013ac 100644 --- a/Src/EB/AMReX_EB2_2D_C.cpp +++ b/Src/EB/AMReX_EB2_2D_C.cpp @@ -4,7 +4,7 @@ namespace amrex { namespace EB2 { namespace { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void set_eb_data (const int i, const int j, Array4 const& cell, +void set_eb_data (const int i, const int j, Array4 const& apx, Array4 const& apy, Array4 const& vfrac, Array4 const& vcent, Array4 const& barea, Array4 const& bcent, @@ -248,7 +248,7 @@ void build_cells (Box const& bx, Array4 const& cell, bnorm(i,j,0,1) = 0.0; } else { - set_eb_data(i,j,cell,apx,apy,vfrac,vcent,barea,bcent,bnorm); + set_eb_data(i,j,apx,apy,vfrac,vcent,barea,bcent,bnorm); // remove small cells if (vfrac(i,j,0) < small_volfrac) { @@ -279,12 +279,12 @@ void build_cells (Box const& bx, Array4 const& cell, if (cell(i,j,0).isRegular()) { cell(i,j,0).setSingleValued(); - set_eb_data(i,j,cell,apx,apy,vfrac,vcent,barea,bcent,bnorm); + set_eb_data(i,j,apx,apy,vfrac,vcent,barea,bcent,bnorm); } if (cell(i-1,j,0).isRegular()) { cell(i-1,j,0).setSingleValued(); - set_eb_data(i-1,j,cell,apx,apy,vfrac,vcent,barea,bcent,bnorm); + set_eb_data(i-1,j,apx,apy,vfrac,vcent,barea,bcent,bnorm); } } }} @@ -300,12 +300,12 @@ void build_cells (Box const& bx, Array4 const& cell, if (cell(i,j,0).isRegular()) { cell(i,j,0).setSingleValued(); - set_eb_data(i,j,cell,apx,apy,vfrac,vcent,barea,bcent,bnorm); + set_eb_data(i,j,apx,apy,vfrac,vcent,barea,bcent,bnorm); } if (cell(i,j-1,0).isRegular()) { cell(i,j-1,0).setSingleValued(); - set_eb_data(i,j-1,cell,apx,apy,vfrac,vcent,barea,bcent,bnorm); + set_eb_data(i,j-1,apx,apy,vfrac,vcent,barea,bcent,bnorm); } } }} diff --git a/Src/EB/AMReX_EB2_3D_C.cpp b/Src/EB/AMReX_EB2_3D_C.cpp index a72e1d17500..b0d01946187 100644 --- a/Src/EB/AMReX_EB2_3D_C.cpp +++ b/Src/EB/AMReX_EB2_3D_C.cpp @@ -5,7 +5,7 @@ namespace amrex { namespace EB2 { namespace { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set_eb_data (const int i, const int j, const int k, - Array4 const& cell, Array4 const& apx, + Array4 const& apx, Array4 const& apy, Array4 const& apz, Array4 const& fcx, Array4 const& fcy, Array4 const& fcz, Array4 const& m2x, @@ -640,7 +640,7 @@ void build_cells (Box const& bx, Array4 const& cell, barea(i,j,k) = 0.0; } else { - set_eb_data(i,j,k,cell,apx,apy,apz, + set_eb_data(i,j,k,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); @@ -695,14 +695,14 @@ void build_cells (Box const& bx, Array4 const& cell, if (cell(i ,j,k).isRegular()) { cell(i ,j,k).setSingleValued(); - set_eb_data(i,j,k,cell,apx,apy,apz, + set_eb_data(i,j,k,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); } if (cell(i-1,j,k).isRegular()) { cell(i-1,j,k).setSingleValued(); - set_eb_data(i-1,j,k,cell,apx,apy,apz, + set_eb_data(i-1,j,k,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); } @@ -721,14 +721,14 @@ void build_cells (Box const& bx, Array4 const& cell, if (cell(i,j ,k).isRegular()) { cell(i,j ,k).setSingleValued(); - set_eb_data(i,j,k,cell,apx,apy,apz, + set_eb_data(i,j,k,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); } if (cell(i,j-1,k).isRegular()) { cell(i,j-1,k).setSingleValued(); - set_eb_data(i,j-1,k,cell,apx,apy,apz, + set_eb_data(i,j-1,k,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); } @@ -748,14 +748,14 @@ void build_cells (Box const& bx, Array4 const& cell, if (cell(i,j,k ).isRegular()) { cell(i,j,k ).setSingleValued(); - set_eb_data(i,j,k,cell,apx,apy,apz, + set_eb_data(i,j,k,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); } if (cell(i,j,k-1).isRegular()) { cell(i,j,k-1).setSingleValued(); - set_eb_data(i,j,k-1,cell,apx,apy,apz, + set_eb_data(i,j,k-1,apx,apy,apz, fcx,fcy,fcz,m2x,m2y,m2z,vfrac,vcent, barea,bcent,bnorm); } diff --git a/Src/EB/AMReX_EB2_GeometryShop.H b/Src/EB/AMReX_EB2_GeometryShop.H index ed4831ab9b5..497f3bad992 100644 --- a/Src/EB/AMReX_EB2_GeometryShop.H +++ b/Src/EB/AMReX_EB2_GeometryShop.H @@ -253,6 +253,7 @@ public: reduce_op.eval(bx, reduce_data, [=] AMREX_GPU_DEVICE (int i, int j, int k) -> ReduceTuple { + amrex::ignore_unused(j,k); Real v = f(AMREX_D_DECL(problo[0]+i*dx[0], problo[1]+j*dx[1], problo[2]+k*dx[2])); diff --git a/Src/EB/AMReX_EB2_IF_AllRegular.H b/Src/EB/AMReX_EB2_IF_AllRegular.H index 6522fd06adc..33f398a9406 100644 --- a/Src/EB/AMReX_EB2_IF_AllRegular.H +++ b/Src/EB/AMReX_EB2_IF_AllRegular.H @@ -15,7 +15,7 @@ public: constexpr Real operator() (const RealArray&) const noexcept { return -1.0; } AMREX_GPU_HOST_DEVICE - constexpr Real operator() (AMREX_D_DECL(Real x, Real y, Real z)) const noexcept { return -1.0; } + constexpr Real operator() (AMREX_D_DECL(Real, Real, Real)) const noexcept { return -1.0; } }; }} diff --git a/Src/EB/AMReX_EB2_Level.H b/Src/EB/AMReX_EB2_Level.H index 7b21189574c..cdc7f319431 100644 --- a/Src/EB/AMReX_EB2_Level.H +++ b/Src/EB/AMReX_EB2_Level.H @@ -336,7 +336,7 @@ GShopLevel::GShopLevel (IndexSpace const* is, G const& gshop, const Geometry& template -GShopLevel::GShopLevel (IndexSpace const* is, int ilev, int max_grid_size, int /*ngrow*/, +GShopLevel::GShopLevel (IndexSpace const* is, int /*ilev*/, int max_grid_size, int /*ngrow*/, const Geometry& geom, GShopLevel& fineLevel) : Level(is, geom) { diff --git a/Src/EB/AMReX_EB2_Level.cpp b/Src/EB/AMReX_EB2_Level.cpp index 0ad24213c5d..0258354a895 100644 --- a/Src/EB/AMReX_EB2_Level.cpp +++ b/Src/EB/AMReX_EB2_Level.cpp @@ -294,6 +294,7 @@ Level::coarsenFromFine (Level& fineLevel, bool fill_boundary) amrex::LoopOnCpu(ndgbx, [=,&tile_error] (int i, int j, int k) noexcept { + amrex::ignore_unused(j,k); int ierr = coarsen_from_fine(AMREX_D_DECL(i,j,k), bx, gbx, AMREX_D_DECL(xbx,ybx,zbx), @@ -371,6 +372,7 @@ Level::coarsenFromFine (Level& fineLevel, bool fill_boundary) reduce_op.eval(ndgbx, reduce_data, [=] AMREX_GPU_DEVICE (int i, int j, int k) -> ReduceTuple { + amrex::ignore_unused(j,k); int ierr = coarsen_from_fine(AMREX_D_DECL(i,j,k), bx, gbx, AMREX_D_DECL(xbx,ybx,zbx), diff --git a/Src/EB/AMReX_EBFluxRegister.cpp b/Src/EB/AMReX_EBFluxRegister.cpp index 9de96423fc6..e2d499a09d4 100644 --- a/Src/EB/AMReX_EBFluxRegister.cpp +++ b/Src/EB/AMReX_EBFluxRegister.cpp @@ -229,7 +229,7 @@ EBFluxRegister::FineAdd (const MFIter& mfi, void EBFluxRegister::Reflux (MultiFab& crse_state, const amrex::MultiFab& crse_vfrac, - MultiFab& fine_state, const amrex::MultiFab& fine_vfrac) + MultiFab& fine_state, const amrex::MultiFab& /*fine_vfrac*/) { if (!m_cfp_mask.empty()) { diff --git a/Src/EB/AMReX_EBFluxRegister_2D_C.H b/Src/EB/AMReX_EBFluxRegister_2D_C.H index c1ed6c93ec0..fa828d41c92 100644 --- a/Src/EB/AMReX_EBFluxRegister_2D_C.H +++ b/Src/EB/AMReX_EBFluxRegister_2D_C.H @@ -193,7 +193,7 @@ void eb_rereflux_from_crse (int i, int j, int k, int n, Box const& bx, Array4 const& d, +void eb_rereflux_to_fine (int i, int j, int /*k*/, int n, Array4 const& d, Array4 const& s, Array4 const& msk, Dim3 ratio) { int ic = amrex::coarsen(i,ratio.x); diff --git a/Src/EB/AMReX_EBMultiFabUtil.cpp b/Src/EB/AMReX_EBMultiFabUtil.cpp index 400c15d8eab..706d8356b1f 100644 --- a/Src/EB/AMReX_EBMultiFabUtil.cpp +++ b/Src/EB/AMReX_EBMultiFabUtil.cpp @@ -903,7 +903,6 @@ EB_interp_CC_to_FaceCentroid (const MultiFab& cc, } else { - Array4 const& flagfab = flags.const_array(mfi); AMREX_D_TERM(Array4 const& apxfab = area[0]->const_array(mfi);, Array4 const& apyfab = area[1]->const_array(mfi);, Array4 const& apzfab = area[2]->const_array(mfi);); @@ -914,7 +913,6 @@ EB_interp_CC_to_FaceCentroid (const MultiFab& cc, AMREX_LAUNCH_HOST_DEVICE_LAMBDA ( vbx, thread_box, { eb_interp_cc2facecent(thread_box, ccfab, - flagfab, AMREX_D_DECL(apxfab,apyfab,apzfab), AMREX_D_DECL(fcx,fcy,fcz), AMREX_D_DECL(edg_x,edg_y,edg_z), @@ -1031,7 +1029,6 @@ EB_interp_CellCentroid_to_FaceCentroid (const MultiFab& phi_centroid, } else { - Array4 const& flagfab = flags.const_array(mfi); AMREX_D_TERM(Array4 const& apxfab = area[0]->const_array(mfi);, Array4 const& apyfab = area[1]->const_array(mfi);, Array4 const& apzfab = area[2]->const_array(mfi);); @@ -1046,7 +1043,6 @@ EB_interp_CellCentroid_to_FaceCentroid (const MultiFab& phi_centroid, AMREX_LAUNCH_HOST_DEVICE_LAMBDA ( vbx, thread_box, { eb_interp_centroid2facecent(thread_box, ccfab, - flagfab, AMREX_D_DECL(apxfab,apyfab,apzfab), cvol, cct, diff --git a/Src/EB/AMReX_EBMultiFabUtil_2D_C.H b/Src/EB/AMReX_EBMultiFabUtil_2D_C.H index 203598cd181..cd476cb5346 100644 --- a/Src/EB/AMReX_EBMultiFabUtil_2D_C.H +++ b/Src/EB/AMReX_EBMultiFabUtil_2D_C.H @@ -280,7 +280,6 @@ void eb_interp_cc2cent (Box const& box, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void eb_interp_cc2facecent (Box const& box, Array4 const& phi, - Array4 const& flag, Array4 const& apx, Array4 const& apy, Array4 const& fcx, Array4 const& fcy, @@ -383,7 +382,6 @@ void eb_interp_cc2facecent (Box const& box, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void eb_interp_centroid2facecent (Box const& box, Array4 const& phi, - Array4 const& flag, Array4 const& apx, Array4 const& apy, Array4 const& cvol, Array4 const& ccent, diff --git a/Src/EB/AMReX_EBMultiFabUtil_3D_C.H b/Src/EB/AMReX_EBMultiFabUtil_3D_C.H index b70a21cacb9..561794fbd5b 100644 --- a/Src/EB/AMReX_EBMultiFabUtil_3D_C.H +++ b/Src/EB/AMReX_EBMultiFabUtil_3D_C.H @@ -419,7 +419,6 @@ void eb_interp_cc2cent (Box const& box, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void eb_interp_cc2facecent (Box const& box, Array4 const& phi, - Array4 const& flag, Array4 const& apx, Array4 const& apy, Array4 const& apz, @@ -603,7 +602,6 @@ void eb_interp_cc2facecent (Box const& box, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void eb_interp_centroid2facecent (Box const& bx, Array4 const& phi, - Array4 const& flag, Array4 const& apx, Array4 const& apy, Array4 const& apz, diff --git a/Src/EB/AMReX_EB_LSCoreBase.cpp b/Src/EB/AMReX_EB_LSCoreBase.cpp index 338877d1f7e..cc3cbbdec36 100644 --- a/Src/EB/AMReX_EB_LSCoreBase.cpp +++ b/Src/EB/AMReX_EB_LSCoreBase.cpp @@ -188,7 +188,7 @@ void LSCoreBase::InitData (const Vector & m_phierr) { // Make a new level using provided BoxArray and DistributionMapping and fill // with interpolated coarse level data. Overrides the pure virtual function in // AmrCore -void LSCoreBase::MakeNewLevelFromCoarse ( int lev, Real time, const BoxArray & ba, +void LSCoreBase::MakeNewLevelFromCoarse ( int lev, Real /*time*/, const BoxArray & ba, const DistributionMapping & dm) { BL_PROFILE("LSCoreBase::MakeNewLevelFromCoarse()"); @@ -422,7 +422,7 @@ Box LSCoreBase::EBSearchBox( const Box & tilebox, const FArrayBox & ls_crse, // tag all cells for refinement // overrides the pure virtual function in AmrCore -void LSCoreBase::ErrorEst (int lev, TagBoxArray & tags, Real time, int ngrow) { +void LSCoreBase::ErrorEst (int lev, TagBoxArray & tags, Real /*time*/, int /*ngrow*/) { if (use_phierr) { LSCoreBase::FillLevelSetTags(lev, tags, phierr, level_set[lev], geom); @@ -510,7 +510,7 @@ void LSCoreBase::FillPatch (int lev, Real time, MultiFab& mf, int icomp, int nco // Fill an entire multifab by interpolating from the coarser level. This comes // into play when a new level of refinement appears -void LSCoreBase::FillCoarsePatch (int lev, Real time, MultiFab & mf, int icomp, int ncomp) { +void LSCoreBase::FillCoarsePatch (int lev, Real /*time*/, MultiFab & mf, int icomp, int ncomp) { BL_PROFILE("LSCoreBase::FillCoarsePatch()"); BL_ASSERT(lev > 0); @@ -631,7 +631,7 @@ void LSCoreBase::FillLevelSet( MultiFab & level_set, const MultiFab & ls_crse, // Get plotfile name -std::string LSCoreBase::PlotFileName (int lev) const { +std::string LSCoreBase::PlotFileName (int /*lev*/) const { // return amrex::Concatenate(plot_file, lev, 5); return plot_file; } diff --git a/Src/EB/AMReX_EB_levelset.cpp b/Src/EB/AMReX_EB_levelset.cpp index 83e1247ed19..32328e0587a 100644 --- a/Src/EB/AMReX_EB_levelset.cpp +++ b/Src/EB/AMReX_EB_levelset.cpp @@ -818,7 +818,7 @@ void LSFactory::fill_data (MultiFab & data, iMultiFab & valid, void LSFactory::intersect_data (MultiFab & data, iMultiFab & valid, const MultiFab & data_in, const iMultiFab & valid_in, - const Geometry & geom_ls) { + const Geometry & /*geom_ls*/) { BL_PROFILE("LSFactory::intersect_data()"); @@ -845,7 +845,7 @@ void LSFactory::intersect_data (MultiFab & data, iMultiFab & valid, void LSFactory::union_data (MultiFab & data, iMultiFab & valid, const MultiFab & data_in, const iMultiFab & valid_in, - const Geometry & geom_ls) { + const Geometry & /*geom_ls*/) { BL_PROFILE("LSFactory::union_data()"); diff --git a/Src/EB/AMReX_EB_utils.cpp b/Src/EB/AMReX_EB_utils.cpp index ea2fab1416a..fefe94f0104 100644 --- a/Src/EB/AMReX_EB_utils.cpp +++ b/Src/EB/AMReX_EB_utils.cpp @@ -72,7 +72,7 @@ namespace amrex { const int ncomp, const EBCellFlagFab& flags_fab, const MultiFab* volfrac, - Box& domain, + Box& /*domain*/, const Geometry & geom) { // @@ -93,9 +93,6 @@ namespace amrex { const Box dbox = geom.growPeriodicDomain(2); - const amrex::Dim3 dom_low = amrex::lbound(domain); - const amrex::Dim3 dom_high = amrex::ubound(domain); - // // Get array from arguments // diff --git a/Src/EB/AMReX_algoim.cpp b/Src/EB/AMReX_algoim.cpp index 795d803b882..7f95861a01f 100644 --- a/Src/EB/AMReX_algoim.cpp +++ b/Src/EB/AMReX_algoim.cpp @@ -15,6 +15,7 @@ void compute_integrals (MultiFab& intgmf, IntVect nghost) { #if (AMREX_SPACEDIM == 2) + amrex::ignore_unused(intgmf, nghost); amrex::Abort("amrex::algoim::compute_integrals is 3D only"); #else @@ -79,41 +80,41 @@ compute_integrals (MultiFab& intgmf, IntVect nghost) const QuadratureRule q = quadGen(phi); - intg(i,j,k,i_S_x ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x ) = q([] AMREX_GPU_DEVICE (Real x, Real /*y*/, Real /*z*/) noexcept { return x; }); - intg(i,j,k,i_S_y ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real y, Real /*z*/) noexcept { return y; }); - intg(i,j,k,i_S_z ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_z ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real /*y*/, Real z) noexcept { return z; }); - intg(i,j,k,i_S_x2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2 ) = q([] AMREX_GPU_DEVICE (Real x, Real /*y*/, Real /*z*/) noexcept { return x*x; }); - intg(i,j,k,i_S_y2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y2 ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real y, Real /*z*/) noexcept { return y*y; }); - intg(i,j,k,i_S_z2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_z2 ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real /*y*/, Real z) noexcept { return z*z; }); - intg(i,j,k,i_S_x_y ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_y ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real /*z*/) noexcept { return x*y; }); - intg(i,j,k,i_S_x_z ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_z ) = q([] AMREX_GPU_DEVICE (Real x, Real /*y*/, Real z) noexcept { return x*z; }); - intg(i,j,k,i_S_y_z ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y_z ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real y, Real z) noexcept { return y*z; }); - intg(i,j,k,i_S_x2_y ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_y ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real /*z*/) noexcept { return x*x*y; }); - intg(i,j,k,i_S_x2_z ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_z ) = q([] AMREX_GPU_DEVICE (Real x, Real /*y*/, Real z) noexcept { return x*x*z; }); - intg(i,j,k,i_S_x_y2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_y2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real /*z*/) noexcept { return x*y*y; }); - intg(i,j,k,i_S_y2_z ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y2_z ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real y, Real z) noexcept { return y*y*z; }); - intg(i,j,k,i_S_x_z2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_z2 ) = q([] AMREX_GPU_DEVICE (Real x, Real /*y*/, Real z) noexcept { return x*z*z; }); - intg(i,j,k,i_S_y_z2 ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y_z2 ) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real y, Real z) noexcept { return y*z*z; }); - intg(i,j,k,i_S_x2_y2) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_y2) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real /*z*/) noexcept { return x*x*y*y; }); - intg(i,j,k,i_S_x2_z2) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_z2) = q([] AMREX_GPU_DEVICE (Real x, Real /*y*/, Real z) noexcept { return x*x*z*z; }); - intg(i,j,k,i_S_y2_z2) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y2_z2) = q([] AMREX_GPU_DEVICE (Real /*x*/, Real y, Real z) noexcept { return y*y*z*z; }); intg(i,j,k,i_S_xyz ) = q([] AMREX_GPU_DEVICE (Real x, Real y, Real z) noexcept { return x*y*z; }); @@ -139,41 +140,41 @@ compute_integrals (MultiFab& intgmf, IntVect nghost) const QuadratureRule q = quadGen(phi); - intg(i,j,k,i_S_x ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x ) = q.eval([](Real x, Real /*y*/, Real /*z*/) noexcept { return x; }); - intg(i,j,k,i_S_y ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y ) = q.eval([](Real /*x*/, Real y, Real /*z*/) noexcept { return y; }); - intg(i,j,k,i_S_z ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_z ) = q.eval([](Real /*x*/, Real /*y*/, Real z) noexcept { return z; }); - intg(i,j,k,i_S_x2 ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2 ) = q.eval([](Real x, Real /*y*/, Real /*z*/) noexcept { return x*x; }); - intg(i,j,k,i_S_y2 ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y2 ) = q.eval([](Real /*x*/, Real y, Real /*z*/) noexcept { return y*y; }); - intg(i,j,k,i_S_z2 ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_z2 ) = q.eval([](Real /*x*/, Real /*y*/, Real z) noexcept { return z*z; }); - intg(i,j,k,i_S_x_y ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_y ) = q.eval([](Real x, Real y, Real /*z*/) noexcept { return x*y; }); - intg(i,j,k,i_S_x_z ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_z ) = q.eval([](Real x, Real /*y*/, Real z) noexcept { return x*z; }); - intg(i,j,k,i_S_y_z ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y_z ) = q.eval([](Real /*x*/, Real y, Real z) noexcept { return y*z; }); - intg(i,j,k,i_S_x2_y ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_y ) = q.eval([](Real x, Real y, Real /*z*/) noexcept { return x*x*y; }); - intg(i,j,k,i_S_x2_z ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_z ) = q.eval([](Real x, Real /*y*/, Real z) noexcept { return x*x*z; }); - intg(i,j,k,i_S_x_y2 ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_y2 ) = q.eval([](Real x, Real y, Real /*z*/) noexcept { return x*y*y; }); - intg(i,j,k,i_S_y2_z ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y2_z ) = q.eval([](Real /*x*/, Real y, Real z) noexcept { return y*y*z; }); - intg(i,j,k,i_S_x_z2 ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x_z2 ) = q.eval([](Real x, Real /*y*/, Real z) noexcept { return x*z*z; }); - intg(i,j,k,i_S_y_z2 ) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y_z2 ) = q.eval([](Real /*x*/, Real y, Real z) noexcept { return y*z*z; }); - intg(i,j,k,i_S_x2_y2) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_y2) = q.eval([](Real x, Real y, Real /*z*/) noexcept { return x*x*y*y; }); - intg(i,j,k,i_S_x2_z2) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_x2_z2) = q.eval([](Real x, Real /*y*/, Real z) noexcept { return x*x*z*z; }); - intg(i,j,k,i_S_y2_z2) = q.eval([](Real x, Real y, Real z) noexcept + intg(i,j,k,i_S_y2_z2) = q.eval([](Real /*x*/, Real y, Real z) noexcept { return y*y*z*z; }); intg(i,j,k,i_S_xyz ) = q.eval([](Real x, Real y, Real z) noexcept { return x*y*z; }); diff --git a/Src/EB/AMReX_distFcnElement.cpp b/Src/EB/AMReX_distFcnElement.cpp index a43b57df59c..dec3949b713 100644 --- a/Src/EB/AMReX_distFcnElement.cpp +++ b/Src/EB/AMReX_distFcnElement.cpp @@ -110,7 +110,7 @@ amrex::Real SplineDistFcnElement2d::cpside(amrex::RealVect pt, amrex::Real t; amrex::RealVect cp; amrex::Real dist; - amrex::Real x0, x1, y0, y1, Dx0, Dx1, Dy0, Dy1, tmin; + amrex::Real x0=0., x1=0., y0=0., y1=0., Dx0=0., Dx1=0., Dy0=0., Dy1=0., tmin=0.; int nsplines = Dx.size() - 1; for (int i=0; i const& dest = fab_a[dir]->array(); Array4 const& src = fine_flux.const_array(); if (dir == 0) { +#if (AMREX_SPACEDIM == 1) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { -#if (AMREX_SPACEDIM == 1) dest(i,0,0,n) = src(2*i,0,0,n)*sf; -#elif (AMREX_SPACEDIM == 2) + }); +#endif +#if (AMREX_SPACEDIM == 2) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { dest(i,j,0,n) = (src(2*i,2*j ,0,n) + src(2*i,2*j+1,0,n)) * (0.5*sf); -#elif (AMREX_SPACEDIM == 3) + }); +#endif +#if (AMREX_SPACEDIM == 3) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { dest(i,j,k,n) = (src(2*i,2*j ,2*k ,n) + src(2*i,2*j+1,2*k ,n) + src(2*i,2*j ,2*k+1,n) + src(2*i,2*j+1,2*k+1,n)) * (0.25*sf); -#endif }); +#endif } else if (dir == 1) { +#if (AMREX_SPACEDIM == 2) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { -#if (AMREX_SPACEDIM == 2) dest(i,j,0,n) = (src(2*i ,2*j,0,n) + src(2*i+1,2*j,0,n)) * (0.5*sf); -#elif (AMREX_SPACEDIM == 3) + }); +#endif +#if (AMREX_SPACEDIM == 3) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { dest(i,j,k,n) = (src(2*i ,2*j,2*k ,n) + src(2*i+1,2*j,2*k ,n) + src(2*i ,2*j,2*k+1,n) + src(2*i+1,2*j,2*k+1,n)) * (0.25*sf); -#endif }); +#endif } else { +#if (AMREX_SPACEDIM == 3) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { -#if (AMREX_SPACEDIM == 3) dest(i,j,k,n) = (src(2*i ,2*j ,2*k,n) + src(2*i+1,2*j ,2*k,n) + src(2*i ,2*j+1,2*k,n) + src(2*i+1,2*j+1,2*k,n)) * (0.25*sf); -#endif }); +#endif } } } @@ -244,43 +256,55 @@ void FlashFluxRegister::store (int fine_global_index, int dir, FArrayBox const& Array4 const& src = fine_flux.const_array(); Array4 const& area = fine_area.const_array(); if (dir == 0) { +#if (AMREX_SPACEDIM == 1) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { -#if (AMREX_SPACEDIM == 1) dest(i,0,0,n) = src(2*i,0,0,n)*area(2*i,0,0)*sf; -#elif (AMREX_SPACEDIM == 2) + }); +#endif +#if (AMREX_SPACEDIM == 2) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { dest(i,j,0,n) = (src(2*i,2*j ,0,n)*area(2*i,2*j ,0) + src(2*i,2*j+1,0,n)*area(2*i,2*j+1,0)) * sf; -#elif (AMREX_SPACEDIM == 3) + }); +#endif +#if (AMREX_SPACEDIM == 3) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { dest(i,j,k,n) = (src(2*i,2*j ,2*k ,n)*area(2*i,2*j ,2*k ) + src(2*i,2*j+1,2*k ,n)*area(2*i,2*j+1,2*k ) + src(2*i,2*j ,2*k+1,n)*area(2*i,2*j ,2*k+1) + src(2*i,2*j+1,2*k+1,n)*area(2*i,2*j+1,2*k+1)) * sf; -#endif }); +#endif } else if (dir == 1) { +#if (AMREX_SPACEDIM == 2) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { -#if (AMREX_SPACEDIM == 2) dest(i,j,0,n) = (src(2*i ,2*j,0,n)*area(2*i ,2*j,0) + src(2*i+1,2*j,0,n)*area(2*i+1,2*j,0)) * sf; -#elif (AMREX_SPACEDIM == 3) + }); +#endif +#if (AMREX_SPACEDIM == 3) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { dest(i,j,k,n) = (src(2*i ,2*j,2*k ,n)*area(2*i ,2*j,2*k ) + src(2*i+1,2*j,2*k ,n)*area(2*i+1,2*j,2*k ) + src(2*i ,2*j,2*k+1,n)*area(2*i ,2*j,2*k+1) + src(2*i+1,2*j,2*k+1,n)*area(2*i+1,2*j,2*k+1)) * sf; -#endif }); +#endif } else { +#if (AMREX_SPACEDIM == 3) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { -#if (AMREX_SPACEDIM == 3) dest(i,j,k,n) = (src(2*i ,2*j ,2*k,n)*area(2*i ,2*j ,2*k) + src(2*i+1,2*j ,2*k,n)*area(2*i+1,2*j ,2*k) + src(2*i ,2*j+1,2*k,n)*area(2*i ,2*j+1,2*k) + src(2*i+1,2*j+1,2*k,n)*area(2*i+1,2*j+1,2*k)) * sf; -#endif }); +#endif } } } @@ -319,59 +343,73 @@ void FlashFluxRegister::store (int fine_global_index, int dir, FArrayBox const& Array4 const& area = fine_area.const_array(); const int* ifd = d_ifd.data(); if (dir == 0) { +#if (AMREX_SPACEDIM == 1) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { if (ifd[n]) { -#if (AMREX_SPACEDIM == 1) dest(i,0,0,n) = src(2*i,0,0,n)*area(2*i,0,0)*sf; -#elif (AMREX_SPACEDIM == 2) + } else { + dest(i,0,0,n) = src(2*i,0,0,n)*sf; + } + }); +#endif +#if (AMREX_SPACEDIM == 2) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { + if (ifd[n]) { dest(i,j,0,n) = (src(2*i,2*j ,0,n)*area(2*i,2*j ,0) + src(2*i,2*j+1,0,n)*area(2*i,2*j+1,0)) * sf; -#elif (AMREX_SPACEDIM == 3) + } else { + dest(i,j,0,n) = (src(2*i,2*j ,0,n) + + src(2*i,2*j+1,0,n)) * sf; + } + }); +#endif +#if (AMREX_SPACEDIM == 3) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { + if (ifd[n]) { dest(i,j,k,n) = (src(2*i,2*j ,2*k ,n)*area(2*i,2*j ,2*k ) + src(2*i,2*j+1,2*k ,n)*area(2*i,2*j+1,2*k ) + src(2*i,2*j ,2*k+1,n)*area(2*i,2*j ,2*k+1) + src(2*i,2*j+1,2*k+1,n)*area(2*i,2*j+1,2*k+1)) * sf; -#endif } else { -#if (AMREX_SPACEDIM == 1) - dest(i,0,0,n) = src(2*i,0,0,n)*sf; -#elif (AMREX_SPACEDIM == 2) - dest(i,j,0,n) = (src(2*i,2*j ,0,n) + - src(2*i,2*j+1,0,n)) * sf; -#elif (AMREX_SPACEDIM == 3) dest(i,j,k,n) = (src(2*i,2*j ,2*k ,n) + src(2*i,2*j+1,2*k ,n) + src(2*i,2*j ,2*k+1,n) + src(2*i,2*j+1,2*k+1,n)) * sf; -#endif } }); +#endif } else if (dir == 1) { +#if (AMREX_SPACEDIM == 2) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, { if (ifd[n]) { -#if (AMREX_SPACEDIM == 2) dest(i,j,0,n) = (src(2*i ,2*j,0,n)*area(2*i ,2*j,0) + src(2*i+1,2*j,0,n)*area(2*i+1,2*j,0)) * sf; -#elif (AMREX_SPACEDIM == 3) + } else { + dest(i,j,0,n) = (src(2*i ,2*j,0,n) + + src(2*i+1,2*j,0,n)) * sf; + } + }); +#endif +#if (AMREX_SPACEDIM == 3) + AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, + { + if (ifd[n]) { dest(i,j,k,n) = (src(2*i ,2*j,2*k ,n)*area(2*i ,2*j,2*k ) + src(2*i+1,2*j,2*k ,n)*area(2*i+1,2*j,2*k ) + src(2*i ,2*j,2*k+1,n)*area(2*i ,2*j,2*k+1) + src(2*i+1,2*j,2*k+1,n)*area(2*i+1,2*j,2*k+1)) * sf; -#endif } else { -#if (AMREX_SPACEDIM == 2) - dest(i,j,0,n) = (src(2*i ,2*j,0,n) + - src(2*i+1,2*j,0,n)) * sf; -#elif (AMREX_SPACEDIM == 3) dest(i,j,k,n) = (src(2*i ,2*j,2*k ,n) + src(2*i+1,2*j,2*k ,n) + src(2*i ,2*j,2*k+1,n) + src(2*i+1,2*j,2*k+1,n)) * sf; -#endif } }); +#endif } else { #if (AMREX_SPACEDIM == 3) AMREX_HOST_DEVICE_PARALLEL_FOR_4D (b, ncomp, i, j, k, n, diff --git a/Src/F_Interfaces/Base/AMReX_FPhysBC.cpp b/Src/F_Interfaces/Base/AMReX_FPhysBC.cpp index ec9723cf71c..950970d4bad 100644 --- a/Src/F_Interfaces/Base/AMReX_FPhysBC.cpp +++ b/Src/F_Interfaces/Base/AMReX_FPhysBC.cpp @@ -4,7 +4,7 @@ using namespace amrex; void amrex::FPhysBC::operator() (MultiFab& mf, int scomp, int ncomp, IntVect const& /* */, - Real time, int bccomp) + Real time, int /*bccomp*/) { if (fill_physbc != nullptr) { fill_physbc(&mf, scomp+1, ncomp, time, geom); diff --git a/Src/F_Interfaces/Base/AMReX_boxarray_fi.cpp b/Src/F_Interfaces/Base/AMReX_boxarray_fi.cpp index 6f2d5556def..2895a9667c9 100644 --- a/Src/F_Interfaces/Base/AMReX_boxarray_fi.cpp +++ b/Src/F_Interfaces/Base/AMReX_boxarray_fi.cpp @@ -1,6 +1,7 @@ #include #include +#include using namespace amrex; @@ -15,6 +16,7 @@ extern "C" { void amrex_fi_new_boxarray_from_bxfarr (BoxArray*& ba, const int* bxs, const int nsides, const int ndims, const int nbxs) { + amrex::ignore_unused(nsides); AMREX_ASSERT(nsides == 2); AMREX_ASSERT(ndims >= AMREX_SPACEDIM); BoxList bl; diff --git a/Src/F_Interfaces/Base/AMReX_init_fi.cpp b/Src/F_Interfaces/Base/AMReX_init_fi.cpp index 19c18c6d243..d439744f177 100644 --- a/Src/F_Interfaces/Base/AMReX_init_fi.cpp +++ b/Src/F_Interfaces/Base/AMReX_init_fi.cpp @@ -30,6 +30,7 @@ extern "C" #ifdef BL_USE_MPI MPI_Comm ccomm = MPI_Comm_f2c(fcomm); #else + amrex::ignore_unused(fcomm); int ccomm = 0; #endif amrex::Initialize(argc, argv, arg_parmparse, ccomm, proc_parmparse); diff --git a/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 b/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 index ded3ca32ab3..597f8de6dd3 100644 --- a/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 +++ b/Src/F_Interfaces/Base/AMReX_parallel_mod.F90 @@ -113,6 +113,8 @@ subroutine amrex_parallel_finalize () call MPI_Finalize(ierr) call_mpi_finalize = .false. end if +#else + call_mpi_finalize = .false. #endif end subroutine amrex_parallel_finalize @@ -135,8 +137,8 @@ end function amrex_parallel_nprocs subroutine amrex_parallel_reduce_sum_is (i, rank) integer, intent(inout) :: i integer, intent(in), optional :: rank - integer :: tmp, ierr #ifdef BL_USE_MPI + integer :: tmp, ierr tmp = i if (present(rank)) then call MPI_Reduce(tmp, i, 1, MPI_INTEGER, MPI_SUM, rank, m_comm, ierr) @@ -150,8 +152,8 @@ subroutine amrex_parallel_reduce_sum_iv (i, n, rank) integer, intent(inout) :: i(*) integer, intent(in) :: n integer, intent(in), optional :: rank - integer :: tmp(n), ierr #ifdef BL_USE_MPI + integer :: tmp(n), ierr tmp = i(1:n) if (present(rank)) then call MPI_Reduce(tmp, i, n, MPI_INTEGER, MPI_SUM, rank, m_comm, ierr) @@ -164,9 +166,9 @@ end subroutine amrex_parallel_reduce_sum_iv subroutine amrex_parallel_reduce_sum_rs (r, rank) real(amrex_real), intent(inout) :: r integer, intent(in), optional :: rank +#ifdef BL_USE_MPI real(amrex_real) :: tmp integer :: ierr -#ifdef BL_USE_MPI tmp = r if (present(rank)) then call MPI_Reduce(tmp, r, 1, amrex_mpi_real, MPI_SUM, rank, m_comm, ierr) @@ -180,9 +182,9 @@ subroutine amrex_parallel_reduce_sum_rv (r, n, rank) real(amrex_real), intent(inout) :: r(*) integer, intent(in) :: n integer, intent(in), optional :: rank +#ifdef BL_USE_MPI real(amrex_real) :: tmp(n) integer :: ierr -#ifdef BL_USE_MPI tmp = r(1:n) if (present(rank)) then call MPI_Reduce(tmp, r, n, amrex_mpi_real, MPI_SUM, rank, m_comm, ierr) @@ -195,8 +197,8 @@ end subroutine amrex_parallel_reduce_sum_rv subroutine amrex_parallel_reduce_max_is (i, rank) integer, intent(inout) :: i integer, intent(in), optional :: rank - integer :: tmp, ierr #ifdef BL_USE_MPI + integer :: tmp, ierr tmp = i if (present(rank)) then call MPI_Reduce(tmp, i, 1, MPI_INTEGER, MPI_MAX, rank, m_comm, ierr) @@ -210,8 +212,8 @@ subroutine amrex_parallel_reduce_max_iv (i, n, rank) integer, intent(inout) :: i(*) integer, intent(in) :: n integer, intent(in), optional :: rank - integer :: tmp(n), ierr #ifdef BL_USE_MPI + integer :: tmp(n), ierr tmp = i(1:n) if (present(rank)) then call MPI_Reduce(tmp, i, n, MPI_INTEGER, MPI_MAX, rank, m_comm, ierr) @@ -224,9 +226,9 @@ end subroutine amrex_parallel_reduce_max_iv subroutine amrex_parallel_reduce_max_rs (r, rank) real(amrex_real), intent(inout) :: r integer, intent(in), optional :: rank +#ifdef BL_USE_MPI real(amrex_real) :: tmp integer :: ierr -#ifdef BL_USE_MPI tmp = r if (present(rank)) then call MPI_Reduce(tmp, r, 1, amrex_mpi_real, MPI_MAX, rank, m_comm, ierr) @@ -240,9 +242,9 @@ subroutine amrex_parallel_reduce_max_rv (r, n, rank) real(amrex_real), intent(inout) :: r(*) integer, intent(in) :: n integer, intent(in), optional :: rank +#ifdef BL_USE_MPI real(amrex_real) :: tmp(n) integer :: ierr -#ifdef BL_USE_MPI tmp = r(1:n) if (present(rank)) then call MPI_Reduce(tmp, r, n, amrex_mpi_real, MPI_MAX, rank, m_comm, ierr) @@ -255,8 +257,8 @@ end subroutine amrex_parallel_reduce_max_rv subroutine amrex_parallel_reduce_min_is (i, rank) integer, intent(inout) :: i integer, intent(in), optional :: rank - integer :: tmp, ierr #ifdef BL_USE_MPI + integer :: tmp, ierr tmp = i if (present(rank)) then call MPI_Reduce(tmp, i, 1, MPI_INTEGER, MPI_MIN, rank, m_comm, ierr) @@ -270,8 +272,8 @@ subroutine amrex_parallel_reduce_min_iv (i, n, rank) integer, intent(inout) :: i(*) integer, intent(in) :: n integer, intent(in), optional :: rank - integer :: tmp(n), ierr #ifdef BL_USE_MPI + integer :: tmp(n), ierr tmp = i(1:n) if (present(rank)) then call MPI_Reduce(tmp, i, n, MPI_INTEGER, MPI_MIN, rank, m_comm, ierr) @@ -284,9 +286,9 @@ end subroutine amrex_parallel_reduce_min_iv subroutine amrex_parallel_reduce_min_rs (r, rank) real(amrex_real), intent(inout) :: r integer, intent(in), optional :: rank +#ifdef BL_USE_MPI real(amrex_real) :: tmp integer :: ierr -#ifdef BL_USE_MPI tmp = r if (present(rank)) then call MPI_Reduce(tmp, r, 1, amrex_mpi_real, MPI_MIN, rank, m_comm, ierr) @@ -300,9 +302,9 @@ subroutine amrex_parallel_reduce_min_rv (r, n, rank) real(amrex_real), intent(inout) :: r(*) integer, intent(in) :: n integer, intent(in), optional :: rank +#ifdef BL_USE_MPI real(amrex_real) :: tmp(n) integer :: ierr -#ifdef BL_USE_MPI tmp = r(1:n) if (present(rank)) then call MPI_Reduce(tmp, r, n, amrex_mpi_real, MPI_MIN, rank, m_comm, ierr) diff --git a/Src/F_Interfaces/Octree/AMReX_octree_fi.cpp b/Src/F_Interfaces/Octree/AMReX_octree_fi.cpp index 14d7af7ab3b..a63dba9fb12 100644 --- a/Src/F_Interfaces/Octree/AMReX_octree_fi.cpp +++ b/Src/F_Interfaces/Octree/AMReX_octree_fi.cpp @@ -150,10 +150,12 @@ extern "C" { famrcore->octree_leaf_dmap[lev] = DistributionMapping(iproc); update_dummy_mf = true; } - famrcore->octree_leaf_dummy_mf[lev].reset - (new MultiFab(famrcore->octree_leaf_grids[lev], - famrcore->octree_leaf_dmap[lev], - 1,0,MFInfo().SetAlloc(false))); + if (update_dummy_mf) { + famrcore->octree_leaf_dummy_mf[lev].reset + (new MultiFab(famrcore->octree_leaf_grids[lev], + famrcore->octree_leaf_dmap[lev], + 1,0,MFInfo().SetAlloc(false))); + } } } } diff --git a/Src/F_Interfaces/Octree/AMReX_octree_mod.F90 b/Src/F_Interfaces/Octree/AMReX_octree_mod.F90 index bab4a56ea41..e6259a7a9c8 100644 --- a/Src/F_Interfaces/Octree/AMReX_octree_mod.F90 +++ b/Src/F_Interfaces/Octree/AMReX_octree_mod.F90 @@ -11,6 +11,8 @@ module amrex_octree_module public :: amrex_octree_init, amrex_octree_finalize, amrex_octree_iter_build, & amrex_octree_iter_destroy, amrex_octree_average_down_leaves + public :: amrex_octree_post_regrid + type, public :: amrex_octree_iter integer, private :: begin_index = 0 integer, private :: end_index = 0 ! exclusive diff --git a/Src/LinearSolvers/MLMG/AMReX_MLABecLap_2D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLABecLap_2D_K.H index b041478c6ec..3674fc45979 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLABecLap_2D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLABecLap_2D_K.H @@ -292,7 +292,7 @@ void abec_gsrb_with_line_solve ( // idir is the direction in which we will do the tridiagonal solve -- // it should be the direction in which the mesh spacing is much larger // than in the other directions - int idir = 1; + // int idir = 1; // This should be moved outside the kernel! if (dhy <= dhx) amrex::Abort("dhy is supposed to be much larger than dhx"); diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H b/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H index 83d0dbe5d4f..a2ea047ee04 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBABecLap.H @@ -94,7 +94,7 @@ public: virtual Array getBCoeffs (int amrlev, int mglev) const final override { return amrex::GetArrOfConstPtrs(m_b_coeffs[amrlev][mglev]); } - virtual std::unique_ptr makeNLinOp (int grid_size) const final override { + virtual std::unique_ptr makeNLinOp (int /*grid_size*/) const final override { amrex::Abort("MLABecLaplacian::makeNLinOp: Not implmented"); return std::unique_ptr{}; } diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.H b/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.H index f76fd3d5c83..36d33a12b44 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.H @@ -73,7 +73,7 @@ public: } virtual void prepareForSolve () final override; - virtual bool isSingular (int armlev) const final override { return false; } + virtual bool isSingular (int /*armlev*/) const final override { return false; } virtual bool isBottomSingular () const final override { return false; } virtual void apply (int amrlev, int mglev, MultiFab& out, MultiFab& in, BCMode bc_mode, diff --git a/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp b/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp index fd40decba02..911a7d8d552 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLEBTensorOp.cpp @@ -545,9 +545,6 @@ MLEBTensorOp::compFlux (int amrlev, const Array& fluxe auto area = (factory) ? factory->getAreaFrac() : Array{AMREX_D_DECL(nullptr,nullptr,nullptr)}; - const Geometry& geom = m_geom[amrlev][mglev]; - const auto dxinv = geom.InvCellSizeArray(); - Array& fluxmf = m_tauflux[amrlev][mglev]; Real bscalar = m_b_scalar; @@ -651,15 +648,12 @@ MLEBTensorOp::compVelGrad (int amrlev, const Array& fl auto factory = dynamic_cast(m_factory[amrlev][mglev].get()); const FabArray* flags = (factory) ? &(factory->getMultiEBCellFlagFab()) : nullptr; - auto area = (factory) ? factory->getAreaFrac() - : Array{AMREX_D_DECL(nullptr,nullptr,nullptr)}; const Geometry& geom = m_geom[amrlev][mglev]; const auto dxinv = geom.InvCellSizeArray(); const int dim_fluxes = AMREX_SPACEDIM*AMREX_SPACEDIM; - MFItInfo mfi_info; if (Gpu::notInLaunchRegion()) mfi_info.EnableTiling().SetDynamic(true); #ifdef _OPENMP diff --git a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H index 4411cd9ae72..7893d6e7ed9 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.H @@ -237,7 +237,7 @@ public: #ifdef AMREX_USE_EB virtual void getEBFluxes (const Vector& /*a_flux*/, - const Vector& a_sol) const { + const Vector& /*a_sol*/) const { amrex::Abort("MLLinOp::getEBFluxes: How did we get here?"); } #endif diff --git a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.cpp b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.cpp index 368926a9d17..bd5bed99c32 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLLinOp.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLLinOp.cpp @@ -73,7 +73,6 @@ namespace { }; std::unique_ptr comm_cache; -#endif Vector get_subgroup_ranks () { @@ -87,6 +86,7 @@ namespace { ParallelContext::local_to_global_rank(granks.data(), lranks.data(), rank_n); return granks; } +#endif } // static member function @@ -309,8 +309,8 @@ MLLinOp::defineGrids (const Vector& a_geom, while ( is_coarsenable_x or is_coarsenable_y or is_coarsenable_z ) #endif { - int r0 = (is_coarsenable_x) ? mg_coarsen_ratio : 1; #if (AMREX_SPACEDIM >= 2) + int r0 = (is_coarsenable_x) ? mg_coarsen_ratio : 1; int r1 = (is_coarsenable_y) ? mg_coarsen_ratio : 1; rr_vec[0] = r0; rr_vec[1] = r1; @@ -475,9 +475,11 @@ MLLinOp::defineGrids (const Vector& a_geom, IntVect rr_0(AMREX_D_DECL(rr,1,1)); bool is_coarsenable_x = ( a_geom[0].Domain().coarsenable(rr_0, mg_domain_min_width) and a_grids[0].coarsenable(rr_0, mg_box_min_width)); +#if (AMREX_SPACEDIM >= 2) IntVect rr_1(AMREX_D_DECL(1,rr,1)); bool is_coarsenable_y = ( a_geom[0].Domain().coarsenable(rr_1, mg_domain_min_width) and a_grids[0].coarsenable(rr_1, mg_box_min_width)); +#endif #if (AMREX_SPACEDIM == 3) IntVect rr_2(AMREX_D_DECL(1,1,rr)); bool is_coarsenable_z = ( a_geom[0].Domain().coarsenable(rr_2, mg_domain_min_width) and @@ -798,6 +800,7 @@ MLLinOp::makeSubCommunicator (const DistributionMapping& dm) return newcomm; #else + amrex::ignore_unused(dm); return m_default_comm; #endif } diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_1D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_1D_K.H index 61c086bd584..90a145ac44e 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_1D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_1D_K.H @@ -4,8 +4,8 @@ namespace amrex { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_set_nodal_mask (int i, int j, int k, Array4 const& nmsk, - Array4 const& cmsk) noexcept +void mlndlap_set_nodal_mask (int /*i*/, int /*j*/, int /*k*/, Array4 const& /*nmsk*/, + Array4 const& /*cmsk*/) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE @@ -23,12 +23,12 @@ void mlndlap_set_dot_mask (Box const& bx, Array4 const& dmsk, {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_zero_fine (int i, int j, int k, Array4 const& phi, +void mlndlap_zero_fine (int /*i*/, int /*j*/, int /*k*/, Array4 const& phi, Array4 const& msk, int fine_flag) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_avgdown_coeff_x (int i, int j, int k, Array4 const& crse, +void mlndlap_avgdown_coeff_x (int /*i*/, int /*j*/, int /*k*/, Array4 const& crse, Array4 const& fine) noexcept {} @@ -39,13 +39,13 @@ inline void mlndlap_bc_doit (Box const& vbx, Array4 const& a, Box const& doma {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_adotx_ha (int i, int j, int k, Array4 const& y, Array4 const& x, +void mlndlap_adotx_ha (int /*i*/, int /*j*/, int /*k*/, Array4 const& y, Array4 const& x, Array4 const& sx, Array4 const& msk, GpuArray const& dxinv) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_adotx_aa (int i, int j, int k, Array4 const& y, Array4 const& x, +void mlndlap_adotx_aa (int /*i*/, int /*j*/, int /*k*/, Array4 const& y, Array4 const& x, Array4 const& sig, Array4 const& msk, GpuArray const& dxinv) noexcept {} @@ -92,63 +92,63 @@ void mlndlap_gauss_seidel_with_line_solve_aa(Box const& bx, Array4 const& AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_restriction (int i, int j, int k, Array4 const& crse, +void mlndlap_restriction (int /*i*/, int /*j*/, int /*k*/, Array4 const& crse, Array4 const& fine, Array4 const& msk) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_semi_restriction (int i, int j, int k, Array4 const& crse, +void mlndlap_semi_restriction (int /*i*/, int /*j*/, int /*k*/, Array4 const& crse, Array4 const& fine, Array4 const& msk, int idir) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_interpadd_aa (int i, int j, int k, Array4 const& fine, +void mlndlap_interpadd_aa (int /*i*/, int /*j*/, int /*k*/, Array4 const& fine, Array4 const& crse, Array4 const& sig, Array4 const& msk) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_semi_interpadd_aa (int i, int j, int k, Array4 const& fine, +void mlndlap_semi_interpadd_aa (int /*i*/, int /*j*/, int /*k*/, Array4 const& fine, Array4 const& crse, Array4 const& sig, Array4 const& msk, int idir) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_interpadd_ha (int i, int j, int k, Array4 const& fine, +void mlndlap_interpadd_ha (int /*i*/, int /*j*/, int /*k*/, Array4 const& fine, Array4 const& crse, Array4 const& sigx, Array4 const& msk) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_divu (int i, int j, int k, Array4 const& rhs, Array4 const& vel, +void mlndlap_divu (int /*i*/, int /*j*/, int /*k*/, Array4 const& rhs, Array4 const& vel, Array4 const& msk, GpuArray const& dxinv) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -Real mlndlap_rhcc (int i, int j, int k, Array4 const& rhcc, +Real mlndlap_rhcc (int /*i*/, int /*j*/, int /*k*/, Array4 const& rhcc, Array4 const& msk) noexcept { return 0._rt; } AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_mknewu (int i, int j, int k, Array4 const& u, Array4 const& p, +void mlndlap_mknewu (int /*i*/, int /*j*/, int /*k*/, Array4 const& u, Array4 const& p, Array4 const& sig, GpuArray const& dxinv) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_divu_compute_fine_contrib (int i, int j, int k, Box const& fvbx, +void mlndlap_divu_compute_fine_contrib (int /*i*/, int /*j*/, int /*k*/, Box const& fvbx, Array4 const& frh, Array4 const& vel, GpuArray const& dxinv) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_divu_add_fine_contrib (int i, int j, int k, Box const& fvbx, +void mlndlap_divu_add_fine_contrib (int /*i*/, int /*j*/, int /*k*/, Box const& fvbx, Array4 const& rhs, Array4 const& frh, Array4 const& msk) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_rhcc_fine_contrib (int i, int j, int k, Box const& fvbx, +void mlndlap_rhcc_fine_contrib (int /*i*/, int /*j*/, int /*k*/, Box const& fvbx, Array4 const& rhs, Array4 const& cc, Array4 const& msk) noexcept {} @@ -165,7 +165,7 @@ void mlndlap_divu_cf_contrib (int i, int j, int, Array4 const& rhs, {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_crse_resid (int i, int j, int k, Array4 const& resid, +void mlndlap_crse_resid (int /*i*/, int /*j*/, int /*k*/, Array4 const& resid, Array4 const& rhs, Array4 const& msk, Box const& nddom, GpuArray const& bclo, GpuArray const& bchi, @@ -173,18 +173,18 @@ void mlndlap_crse_resid (int i, int j, int k, Array4 const& resid, {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_res_fine_Ax (int i, int j, int k, Box const& fvbx, Array4 const& Ax, +void mlndlap_res_fine_Ax (int /*i*/, int /*j*/, int /*k*/, Box const& fvbx, Array4 const& Ax, Array4 const& x, Array4 const& sig, GpuArray const& dxinv) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_res_fine_contrib (int i, int j, int k, Array4 const& f, +void mlndlap_res_fine_contrib (int /*i*/, int /*j*/, int /*k*/, Array4 const& f, Array4 const& Ax, Array4 const& msk) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_res_cf_contrib (int i, int j, int k, Array4 const& res, +void mlndlap_res_cf_contrib (int /*i*/, int /*j*/, int /*k*/, Array4 const& res, Array4 const& phi, Array4 const& rhs, Array4 const& sig, Array4 const& dmsk, Array4 const& ndmsk, Array4 const& ccmsk, @@ -202,16 +202,16 @@ void mlndlap_set_stencil (Box const& bx, Array4 const& sten, {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_set_stencil_s0 (int i, int j, int k, Array4 const& sten) noexcept +void mlndlap_set_stencil_s0 (int /*i*/, int /*j*/, int /*k*/, Array4 const& sten) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_stencil_rap (int i, int j, int k, Array4 const& csten, +void mlndlap_stencil_rap (int /*i*/, int /*j*/, int /*k*/, Array4 const& csten, Array4 const& fsten) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_adotx_sten (int i, int j, int k, Array4 const& y, Array4 const& x, +void mlndlap_adotx_sten (int /*i*/, int /*j*/, int /*k*/, Array4 const& y, Array4 const& x, Array4 const& sten, Array4 const& msk) noexcept {} @@ -223,13 +223,13 @@ void mlndlap_gauss_seidel_sten (Box const& bx, Array4 const& sol, {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_interpadd_rap (int i, int j, int k, Array4 const& fine, +void mlndlap_interpadd_rap (int /*i*/, int /*j*/, int /*k*/, Array4 const& fine, Array4 const& crse, Array4 const& sten, Array4 const& msk) noexcept {} AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_restriction_rap (int i, int j, int k, Array4 const& crse, +void mlndlap_restriction_rap (int /*i*/, int /*j*/, int /*k*/, Array4 const& crse, Array4 const& fine, Array4 const& sten, Array4 const& msk) noexcept {} diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H index 5e9156996f8..a7f052e2790 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeLap_2D_K.H @@ -904,7 +904,7 @@ void mlndlap_divu_compute_fine_contrib (int i, int j, int, Box const& fvbx, } AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_divu_add_fine_contrib (int i, int j, int k, Box const& fvbx, +void mlndlap_divu_add_fine_contrib (int i, int j, int /*k*/, Box const& fvbx, Array4 const& rhs, Array4 const& frh, Array4 const& msk) noexcept { @@ -1231,12 +1231,14 @@ void mlndlap_stencil_rap (int i, int j, int, Array4 const& csten, { constexpr int k = 0; +#if 0 auto interp_from_mm_to = [&fsten] (int i_, int j_) -> Real { Real wxm = amrex::Math::abs(fsten(i_-1,j_ ,0,1))/(amrex::Math::abs(fsten(i_-1,j_-1,0,3))+amrex::Math::abs(fsten(i_-1,j_ ,0,3))+eps); Real wym = amrex::Math::abs(fsten(i_ ,j_-1,0,2))/(amrex::Math::abs(fsten(i_-1,j_-1,0,3))+amrex::Math::abs(fsten(i_ ,j_-1,0,3))+eps); Real wmm = amrex::Math::abs(fsten(i_-1,j_-1,0,3)) * (1._rt + wxm + wym); return wmm * fsten(i_,j_,0,4); }; +#endif auto interp_from_mp_to = [&fsten] (int i_, int j_) -> Real { Real wxm = amrex::Math::abs(fsten(i_-1,j_ ,0,1))/(amrex::Math::abs(fsten(i_-1,j_-1,0,3))+amrex::Math::abs(fsten(i_-1,j_ ,0,3))+eps); @@ -1275,9 +1277,11 @@ void mlndlap_stencil_rap (int i, int j, int, Array4 const& csten, return amrex::Math::abs(fsten(i_,j_,0,2))/(amrex::Math::abs(fsten(i_,j_-1,0,2))+amrex::Math::abs(fsten(i_,j_,0,2))+eps); }; +#if 0 auto Amm = [&fsten] (int i_, int j_) -> Real { return fsten(i_-1,j_-1,0,3); }; +#endif auto A0m = [&fsten] (int i_, int j_) -> Real { return fsten(i_,j_-1,0,2); @@ -1311,12 +1315,14 @@ void mlndlap_stencil_rap (int i, int j, int, Array4 const& csten, return fsten(i_,j_,0,3); }; +#if 0 auto restrict_from_mm_to = [&fsten] (int ii_, int jj_) -> Real { Real wxp = amrex::Math::abs(fsten(ii_-1,jj_-1,0,1))/(amrex::Math::abs(fsten(ii_-1,jj_-2,0,3))+amrex::Math::abs(fsten(ii_-1,jj_-1,0,3))+eps); Real wyp = amrex::Math::abs(fsten(ii_-1,jj_-1,0,2))/(amrex::Math::abs(fsten(ii_-2,jj_-1,0,3))+amrex::Math::abs(fsten(ii_-1,jj_-1,0,3))+eps); Real wpp = amrex::Math::abs(fsten(ii_-1,jj_-1,0,3))*(1._rt+wxp+wyp); return wpp * fsten(ii_-1,jj_-1,0,4); }; +#endif auto restrict_from_0m_to = [&fsten] (int ii_, int jj_) -> Real { return amrex::Math::abs(fsten(ii_,jj_-1,0,2))/(amrex::Math::abs(fsten(ii_,jj_-2,0,2))+amrex::Math::abs(fsten(ii_,jj_-1,0,2))+eps); @@ -1534,7 +1540,7 @@ void mlndlap_interpadd_rap (int i, int j, int, Array4 const& fine, } AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE -void mlndlap_restriction_rap (int i, int j, int k, Array4 const& crse, +void mlndlap_restriction_rap (int i, int j, int /*k*/, Array4 const& crse, Array4 const& fine, Array4 const& sten, Array4 const& msk) noexcept { diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_1D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_1D_K.H index 197ea3e504c..a0d9dbf331d 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_1D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_1D_K.H @@ -10,7 +10,7 @@ void mlndtslap_interpadd (int i, int, int, Array4 const& fine, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndtslap_adotx (Box const& b, Array4 const& y, Array4 const& x, - Array4 const& msk, GpuArray const& s, + GpuArray const& s, GpuArray const& dxinv) noexcept {} diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_2D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_2D_K.H index 1b059ef51fc..ec096d66eea 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_2D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_2D_K.H @@ -6,24 +6,24 @@ namespace amrex { namespace { AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE - Real ts_interp_line_x (Array4 const& crse, int i, int j, int ic, int jc) noexcept + Real ts_interp_line_x (Array4 const& crse, int ic, int jc) noexcept { return (crse(ic,jc,0)+crse(ic+1,jc,0))*0.5_rt; } AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE - Real ts_interp_line_y (Array4 const& crse, int i, int j, int ic, int jc) noexcept + Real ts_interp_line_y (Array4 const& crse, int ic, int jc) noexcept { return (crse(ic,jc,0)+crse(ic,jc+1,0))*0.5_rt; } AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE - Real ts_interp_face_xy (Array4 const& crse, int i, int j, int ic, int jc) noexcept + Real ts_interp_face_xy (Array4 const& crse, int ic, int jc) noexcept { - return (ts_interp_line_y(crse,i-1,j ,ic ,jc ) + - ts_interp_line_y(crse,i+1,j ,ic+1,jc ) + - ts_interp_line_x(crse,i ,j-1,ic ,jc ) + - ts_interp_line_x(crse,i ,j+1,ic ,jc+1)) * 0.25_rt; + return (ts_interp_line_y(crse,ic ,jc ) + + ts_interp_line_y(crse,ic+1,jc ) + + ts_interp_line_x(crse,ic ,jc ) + + ts_interp_line_x(crse,ic ,jc+1)) * 0.25_rt; } } @@ -38,13 +38,13 @@ void mlndtslap_interpadd (int i, int j, int, Array4 const& fine, bool j_is_odd = (jc*2 != j); if (i_is_odd and j_is_odd) { // Node on a X-Y face - fine(i,j,0) += ts_interp_face_xy(crse,i,j,ic,jc); + fine(i,j,0) += ts_interp_face_xy(crse,ic,jc); } else if (i_is_odd) { // Node on X line - fine(i,j,0) += ts_interp_line_x(crse,i,j,ic,jc); + fine(i,j,0) += ts_interp_line_x(crse,ic,jc); } else if (j_is_odd) { // Node on Y line - fine(i,j,0) += ts_interp_line_y(crse,i,j,ic,jc); + fine(i,j,0) += ts_interp_line_y(crse,ic,jc); } else { // Node coincident with coarse node fine(i,j,0) += crse(ic,jc,0); @@ -54,7 +54,7 @@ void mlndtslap_interpadd (int i, int j, int, Array4 const& fine, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndtslap_adotx (Box const& b, Array4 const& y, Array4 const& x, - Array4 const& msk, GpuArray const& s, + GpuArray const& s, GpuArray const& dxinv) noexcept { const Real h00 = dxinv[0]*dxinv[0]; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_3D_K.H b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_3D_K.H index 5bf56b7c3ff..1349cb048ae 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_3D_K.H +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLap_3D_K.H @@ -103,7 +103,7 @@ void mlndtslap_interpadd (int i, int j, int k, Array4 const& fine, AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void mlndtslap_adotx (Box const& b, Array4 const& y, Array4 const& x, - Array4 const& /*msk*/, GpuArray const& s, + GpuArray const& s, GpuArray const& dxinv) noexcept { const Real h00 = dxinv[0]*dxinv[0]; diff --git a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLaplacian.cpp b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLaplacian.cpp index 4d60fe8375c..c1a7141499f 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLaplacian.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLNodeTensorLaplacian.cpp @@ -164,7 +164,6 @@ MLNodeTensorLaplacian::Fapply (int amrlev, int mglev, MultiFab& out, const Multi BL_PROFILE("MLNodeTensorLaplacian::Fapply()"); const auto dxinv = m_geom[amrlev][mglev].InvCellSizeArray(); - const iMultiFab& dmsk = *m_dirichlet_mask[amrlev][mglev]; const auto s = m_sigma; #ifdef _OPENMP @@ -175,11 +174,10 @@ MLNodeTensorLaplacian::Fapply (int amrlev, int mglev, MultiFab& out, const Multi const Box& bx = mfi.tilebox(); Array4 const& xarr = in.const_array(mfi); Array4 const& yarr = out.array(mfi); - Array4 const& dmskarr = dmsk.const_array(mfi); AMREX_LAUNCH_HOST_DEVICE_LAMBDA ( bx, tbx, { - mlndtslap_adotx(tbx,yarr,xarr,dmskarr,s,dxinv); + mlndtslap_adotx(tbx,yarr,xarr,s,dxinv); }); } } diff --git a/Src/LinearSolvers/MLMG/AMReX_MLPoisson.cpp b/Src/LinearSolvers/MLMG/AMReX_MLPoisson.cpp index eea976bbbae..5ad48f59131 100644 --- a/Src/LinearSolvers/MLMG/AMReX_MLPoisson.cpp +++ b/Src/LinearSolvers/MLMG/AMReX_MLPoisson.cpp @@ -469,6 +469,9 @@ MLPoisson::makeNLinOp (int grid_size) const std::unique_ptr r{new MLALaplacian({geom}, {ba}, {dm}, minfo)}; MLALaplacian* nop = dynamic_cast(r.get()); + if (!nop) { + return std::unique_ptr{}; + } nop->m_parent = this; diff --git a/Src/LinearSolvers/Projections/AMReX_MacProjector.cpp b/Src/LinearSolvers/Projections/AMReX_MacProjector.cpp index 14fe2ad9015..88a451116da 100644 --- a/Src/LinearSolvers/Projections/AMReX_MacProjector.cpp +++ b/Src/LinearSolvers/Projections/AMReX_MacProjector.cpp @@ -23,7 +23,7 @@ MacProjector::MacProjector (const Vector >& a_um m_umac_loc(a_umac_loc), m_divu_loc(a_divu_loc) { - amrex::ignore_unused(m_divu_loc); + amrex::ignore_unused(m_divu_loc,a_beta_loc,a_phi_loc); int nlevs = a_umac.size(); Vector ba(nlevs); Vector dm(nlevs); diff --git a/Src/LinearSolvers/Projections/AMReX_NodalProjector.cpp b/Src/LinearSolvers/Projections/AMReX_NodalProjector.cpp index dc472822e3e..db0773d5738 100644 --- a/Src/LinearSolvers/Projections/AMReX_NodalProjector.cpp +++ b/Src/LinearSolvers/Projections/AMReX_NodalProjector.cpp @@ -182,8 +182,7 @@ NodalProjector::setDomainBC ( std::array a_bc_lo, m_bc_hi=a_bc_hi; m_linop->setDomainBC(m_bc_lo,m_bc_hi); m_need_bcs = false; -}; - +} void NodalProjector::setCustomRHS (const amrex::Vector a_rhs) diff --git a/Src/Particle/AMReX_ParticleCommunication.cpp b/Src/Particle/AMReX_ParticleCommunication.cpp index 60a1c015f42..35403f681f1 100644 --- a/Src/Particle/AMReX_ParticleCommunication.cpp +++ b/Src/Particle/AMReX_ParticleCommunication.cpp @@ -196,7 +196,8 @@ void ParticleCopyPlan::buildMPIStart (const ParticleBufferMap& map, Long psize) m_snd_pad_correction_d.resize(m_snd_pad_correction_h.size()); Gpu::copy(Gpu::hostToDevice, m_snd_pad_correction_h.begin(), m_snd_pad_correction_h.end(), m_snd_pad_correction_d.begin()); - +#else + amrex::ignore_unused(map,psize); #endif } @@ -307,6 +308,8 @@ void ParticleCopyPlan::doHandShakeLocal (const Vector& Snds, Vector& { ParallelDescriptor::Waitall(rreqs, stats); } +#else + amrex::ignore_unused(Snds,Rcvs); #endif } @@ -328,6 +331,8 @@ void ParticleCopyPlan::doHandShakeAllToAll (const Vector& Snds, Vector& Snds, Vector const auto Who = stats[i].MPI_SOURCE; Rcvs[Who] = num_bytes_rcv[i]; } +#else + amrex::ignore_unused(Snds,Rcvs); #endif } @@ -381,5 +388,7 @@ void amrex::communicateParticlesFinish (const ParticleCopyPlan& plan) { ParallelDescriptor::Waitall(plan.m_particle_rreqs, plan.m_particle_stats); } +#else + amrex::ignore_unused(plan); #endif } diff --git a/Src/Particle/AMReX_ParticleContainerI.H b/Src/Particle/AMReX_ParticleContainerI.H index 63879e4d5ad..45f0968cb50 100644 --- a/Src/Particle/AMReX_ParticleContainerI.H +++ b/Src/Particle/AMReX_ParticleContainerI.H @@ -1928,7 +1928,9 @@ RedistributeMPI (std::map >& not_ours, BL_PROFILE_VAR_STOP(blp_copy); } -#endif /*AMREX_USE_MPI*/ +#else + amrex::ignore_unused(not_ours,lev_min,lev_max,nGrow,local); +#endif } template diff --git a/Src/Particle/AMReX_ParticleIO.H b/Src/Particle/AMReX_ParticleIO.H index c73d6edbbbb..e06cc0b952c 100644 --- a/Src/Particle/AMReX_ParticleIO.H +++ b/Src/Particle/AMReX_ParticleIO.H @@ -33,7 +33,7 @@ template void ParticleContainer ::Checkpoint (const std::string& dir, - const std::string& name, bool is_checkpoint, + const std::string& name, bool /*is_checkpoint*/, const Vector& real_comp_names, const Vector& int_comp_names) const { @@ -690,7 +690,7 @@ ParticleContainer template void ParticleContainer -::Restart (const std::string& dir, const std::string& file, bool is_checkpoint) +::Restart (const std::string& dir, const std::string& file, bool /*is_checkpoint*/) { Restart(dir, file); }