From 21b69c411c5371ca441c389b65ef37829c81ffea Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 16 May 2024 08:55:30 -0400 Subject: [PATCH 1/4] add a compiler warning CI --- .github/workflows/compiler-warnings.yml | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/compiler-warnings.yml diff --git a/.github/workflows/compiler-warnings.yml b/.github/workflows/compiler-warnings.yml new file mode 100644 index 000000000..d6d167100 --- /dev/null +++ b/.github/workflows/compiler-warnings.yml @@ -0,0 +1,39 @@ +name: "compiler warnings" + +on: [pull_request] + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + compiler_warnings: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get submodules + run: | + git submodule update --init + cd external/Microphysics + git fetch; git checkout development + cd ../amrex + git fetch; git checkout development + cd ../.. + + - name: Install dependencies + run: | + sudo apt-get update -y -qq + sudo apt-get -qq -y install curl g++>=9.3.0 + + - name: Compile wdconvect + run: | + cd Exec/science/wdconvect + make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 4 + + - name: Compile reacting_bubble + run: | + cd Exec/test_problems/reacting_bubble + make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE DIM=2 WARN_ALL=TRUE WARN_ERROR=TRUE -j 4 From 6257c48fd4754b45a094344e313e92d409f23de1 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 16 May 2024 09:05:49 -0400 Subject: [PATCH 2/4] fix some compiler warnings --- Exec/test_problems/reacting_bubble/MaestroInitData.cpp | 6 ++++++ Exec/test_problems/reacting_bubble/MaestroTagging.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Exec/test_problems/reacting_bubble/MaestroInitData.cpp b/Exec/test_problems/reacting_bubble/MaestroInitData.cpp index 5a4ba91db..a65903aa9 100644 --- a/Exec/test_problems/reacting_bubble/MaestroInitData.cpp +++ b/Exec/test_problems/reacting_bubble/MaestroInitData.cpp @@ -14,6 +14,9 @@ void Perturb(const Real p0_init, const Real* s0, Real* perturbations, // initializes data on a specific level void Maestro::InitLevelData(const int lev, const Real time, const MFIter& mfi, const Array4 scal, const Array4 vel) { + + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::InitLevelData()", InitLevelData); @@ -91,6 +94,9 @@ void Maestro::InitLevelData(const int lev, const Real time, const MFIter& mfi, void Maestro::InitLevelDataSphr(const int lev, const Real time, MultiFab& scal, MultiFab& vel) { + + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::InitLevelDataSphr()", InitLevelDataSphr); diff --git a/Exec/test_problems/reacting_bubble/MaestroTagging.cpp b/Exec/test_problems/reacting_bubble/MaestroTagging.cpp index a67b17140..8961b737e 100644 --- a/Exec/test_problems/reacting_bubble/MaestroTagging.cpp +++ b/Exec/test_problems/reacting_bubble/MaestroTagging.cpp @@ -23,6 +23,9 @@ void Maestro::RetagArray(const Box& bx, const int lev) { void Maestro::TagBoxes(TagBoxArray& tags, const MFIter& mfi, const int lev, const Real time) { + + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::TagBoxes()", TagBoxes); @@ -45,6 +48,9 @@ void Maestro::TagBoxes(TagBoxArray& tags, const MFIter& mfi, const int lev, void Maestro::StateError(TagBoxArray& tags, const MultiFab& state_mf, const MFIter& mfi, const int lev, const Real time) { + + amrex::ignore_unused(time); + // timer for profiling BL_PROFILE_VAR("Maestro::StateError()", StateError); From ba405dba1bda69618474e0b1ee240109afddf4c1 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 15:14:24 -0400 Subject: [PATCH 3/4] fix another --- Exec/test_problems/reacting_bubble/MaestroInitData.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Exec/test_problems/reacting_bubble/MaestroInitData.cpp b/Exec/test_problems/reacting_bubble/MaestroInitData.cpp index a65903aa9..829d2a8ff 100644 --- a/Exec/test_problems/reacting_bubble/MaestroInitData.cpp +++ b/Exec/test_problems/reacting_bubble/MaestroInitData.cpp @@ -288,6 +288,8 @@ void Perturb(const Real p0_init, const Real* s0, Real* perturbations, const Real x, const Real y, const Real z) { Real t0 = s0[Temp]; + amrex::ignore_unused(z); + #if (AMREX_SPACEDIM == 2) Real x1 = 5.0e7; From 92141da19b80dc4f5bf130dcb60696c3072db5ee Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Fri, 17 May 2024 16:30:58 -0400 Subject: [PATCH 4/4] ifdef out OMP --- Source/MaestroDiag.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/MaestroDiag.cpp b/Source/MaestroDiag.cpp index fa9d40b1c..eb4cc82bc 100644 --- a/Source/MaestroDiag.cpp +++ b/Source/MaestroDiag.cpp @@ -184,7 +184,9 @@ void Maestro::DiagFile(const int step, const Real t_in, if (spherical) { #if (AMREX_SPACEDIM == 3) // is it one of the 8 zones surrounding the center? +#ifdef _OPENMP #pragma omp critical +#endif if (std::abs(x - center[0]) < dx[0] && std::abs(y - center[1]) < dx[1] && std::abs(z - center[2]) < dx[2]) { @@ -213,7 +215,9 @@ void Maestro::DiagFile(const int step, const Real t_in, amrex::Math::powi<2>(u(i, j, k, 2) + 0.5 * (w0macz(i, j, k) + w0macz(i, j, k + 1)))); // max T, location, and velocity at that location (including w0) +#ifdef _OPENMP #pragma omp critical +#endif if (scal(i, j, k, Temp) > T_max_local) { T_max_local = scal(i, j, k, Temp); coord_Tmax_local[0] = x; @@ -228,7 +232,9 @@ void Maestro::DiagFile(const int step, const Real t_in, } // max enuc +#ifdef _OPENMP #pragma omp critical +#endif if (rho_Hnuc_arr(i, j, k) / scal(i, j, k, Rho) > enuc_max_local) { enuc_max_local = rho_Hnuc_arr(i, j, k) / scal(i, j, k, Rho); coord_enucmax_local[0] = x; @@ -255,7 +261,9 @@ void Maestro::DiagFile(const int step, const Real t_in, #endif // max T, location, and velocity at that location (including w0) +#ifdef _OPENMP #pragma omp critical +#endif if (scal(i, j, k, Temp) > T_max_local) { T_max_local = scal(i, j, k, Temp); coord_Tmax_local[0] = x; @@ -275,7 +283,9 @@ void Maestro::DiagFile(const int step, const Real t_in, } // max enuc +#ifdef _OPENMP #pragma omp critical +#endif if (rho_Hnuc_arr(i, j, k) / scal(i, j, k, Rho) > enuc_max_local) { enuc_max_local = rho_Hnuc_arr(i, j, k) / scal(i, j, k, Rho); coord_enucmax_local[0] = x;