From c5653522dbe019c46282029aae5059e491685587 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Mon, 18 Nov 2024 16:17:52 -0700 Subject: [PATCH] Use ubuntu-24.04 in CI (#437) Also fix some warnings. --- .clang-tidy | 3 +- .github/workflows/ci.yml | 106 +++++++++--------- .github/workflows/cleanup-cache-postpr.yml | 2 +- .github/workflows/cleanup-cache.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/post-pr.yml | 2 +- .../EB_EnclosedFlame/pelelmex_prob.cpp | 1 - .../EB_FlowPastCylinder/pelelmex_prob.H | 5 +- Exec/RegTests/EB_ODEQty/pelelmex_prob.H | 4 + Exec/RegTests/EB_PipeFlow/pelelmex_prob.H | 4 + Exec/RegTests/EnclosedFlame/pelelmex_prob.cpp | 1 - Exec/RegTests/FlameSheet/pelelmex_prob.cpp | 1 - Exec/RegTests/PeriodicCases/pelelmex_prob.H | 6 + Exec/RegTests/SprayTest/pelelmex_prob.cpp | 1 - Source/PeleLMeX_EB.cpp | 2 +- Source/PeleLMeX_FlowController.cpp | 3 + Source/PeleLMeX_Plot.cpp | 3 - Source/PeleLMeX_Regrid.cpp | 2 + Source/PeleLMeX_Soot.cpp | 4 +- Source/PeleLMeX_Temporals.cpp | 12 +- Source/PeleLMeX_Utils.cpp | 4 +- Tests/CMakeLists.txt | 15 ++- 22 files changed, 105 insertions(+), 80 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index f0010b68f..fe56c6aff 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,6 +2,7 @@ Checks: 'bugprone-*, -bugprone-easily-swappable-parameters, -bugprone-implicit-widening-of-multiplication-result, + -bugprone-multi-level-implicit-pointer-conversion, -bugprone-exception-escape, clang-diagnostic-*, clang-analyzer-*, @@ -21,10 +22,10 @@ Checks: 'bugprone-*, -readability-function-cognitive-complexity, -readability-convert-member-functions-to-static, -readability-make-member-function-const, + -readability-avoid-nested-conditional-operator, -readability-function-size' WarningsAsErrors: '' HeaderFilterRegex: 'PeleLMeX\/Source|PeleLMeX\/Exec|PeleLMeX\/Submodules\/PelePhysics\/Source|PeleLMeX\/Submodules\/PelePhysics\/Mechanism' -AnalyzeTemporaryDtors: false FormatStyle: none User: user CheckOptions: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02c8c94fd..a667afd01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ concurrency: jobs: Formatting: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -26,7 +26,7 @@ jobs: clangFormatVersion: 18 CPU-GNUmake: needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -72,7 +72,7 @@ jobs: - name: FlameSheet debug report working-directory: ./Exec/RegTests/FlameSheet run: | - egrep "warning:|error:" build-output.txt \ + egrep "Warning:|Error:|warning:|error:" build-output.txt \ | egrep -v "Submodules/amrex|Submodules/sundials|Submodules/AMReX-Hydro|GNUmakefile|ThirdParty" \ | egrep -v "ld: warning:" | sort | uniq \ | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > warnings.txt @@ -84,7 +84,7 @@ jobs: runs-on: ${{matrix.os}} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-24.04, macos-latest] build_type: [Release, Debug] enable_eb: [EB-OFF, EB-ON] include: @@ -93,7 +93,7 @@ jobs: comp: llvm procs: $(sysctl -n hw.ncpu) ccache_cache: /Users/runner/Library/Caches/ccache - - os: ubuntu-latest + - os: ubuntu-24.04 install_deps: sudo apt-get update && sudo apt-get install mpich libmpich-dev comp: gnu procs: $(nproc) @@ -102,7 +102,7 @@ jobs: ctest_args: -LE no-ci ccache_size: 100M - build_type: Debug - ctest_args: -LE no-ci + ctest_args: -R covo ccache_size: 500M - enable_eb: EB-OFF use_eb: "OFF" @@ -184,7 +184,7 @@ jobs: - name: Report run: | echo "::add-matcher::.github/problem-matchers/gcc.json" - egrep "warning:|error:" ${{runner.workspace}}/build-output.txt \ + egrep "Warning:|Error:|warning:|error:" ${{runner.workspace}}/build-output.txt \ | egrep -v "Submodules/amrex|Submodules/sundials|Submodules/AMReX-Hydro" \ | egrep -v "ld: warning:" | egrep -v "lto-wrapper: warning:" | sort | uniq \ | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings.txt @@ -196,19 +196,13 @@ jobs: (for DIM in 2 3; do \ printf "\n-------- Testing ${DIM}D --------\n"; \ cd ${{runner.workspace}}/build-${DIM}d-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}}; \ - ctest -j ${{env.NPROCS}} ${{matrix.ctest_args}} --output-on-failure; \ + ctest ${{matrix.ctest_args}} --output-on-failure; \ if [ $? -ne 0 ]; then exit 1; fi \ done) GPU-Nvidia: name: GPU-CUDA needs: [Formatting, CPU-GNUmake] - runs-on: ubuntu-20.04 - strategy: - matrix: - cuda_ver: [11.4] - include: - - cuda_ver: "11.4" - cuda_pkg: 11-4 + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -224,16 +218,15 @@ jobs: - name: Dependencies run: | ${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh - curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb - sudo dpkg -i cuda-keyring_1.0-1_all.deb + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb + sudo dpkg -i cuda-keyring_1.1-1_all.deb sudo apt-get update - sudo apt-get install -y \ - cuda-command-line-tools-${{matrix.cuda_pkg}} \ - cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} \ - cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} \ - libcurand-dev-${{matrix.cuda_pkg}} cuda-cupti-dev-${{matrix.cuda_pkg}} \ - libcusolver-dev-${{matrix.cuda_pkg}} libcusparse-dev-${{matrix.cuda_pkg}} \ - libcublas-dev-${{matrix.cuda_pkg}} + sudo apt-get install -y cuda-command-line-tools-12-6 \ + cuda-compiler-12-6 cuda-minimal-build-12-6 \ + cuda-nvml-dev-12-6 cuda-nvtx-12-6 \ + libcurand-dev-12-6 cuda-cupti-dev-12-6 \ + libcusolver-dev-12-6 libcusparse-dev-12-6 \ + libcublas-dev-12-6 libcurand-dev-12-6 libnvjitlink-12-6 - name: Install Ccache run: | wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz @@ -248,22 +241,22 @@ jobs: ccache-${{github.workflow}}-${{github.job}}-git- - name: Configure run: | - export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH} - export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH} - cmake -Bbuild-${{matrix.cuda_pkg}} \ + export PATH=/usr/local/nvidia/bin:/usr/local/cuda-12.6/bin:${PATH} + export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-12.6/lib:${LD_LIBRARY_PATH} + cmake -Bbuild-cuda \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ -DPELE_ENABLE_MPI:BOOL=OFF \ -DPELE_ENABLE_CUDA:BOOL=ON \ -DAMReX_CUDA_ERROR_CAPTURE_THIS:BOOL=ON \ - -DCMAKE_CUDA_ARCHITECTURES:STRING=70 \ + -DCMAKE_CUDA_ARCHITECTURES:STRING=80 \ -DCMAKE_CUDA_COMPILER_LAUNCHER:STRING=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ ${{github.workspace}} - name: Build run: | ccache -z - cmake --build build-${{matrix.cuda_pkg}} --parallel ${{env.NPROCS}} + cmake --build build-cuda --parallel ${{env.NPROCS}} - name: Ccache Report run: | ccache -s @@ -271,7 +264,7 @@ jobs: GPU-AMD: name: GPU-HIP needs: [Formatting, CPU-GNUmake] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -287,14 +280,13 @@ jobs: - name: Dependencies run: | ${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh - curl -O https://repo.radeon.com/rocm/rocm.gpg.key - sudo apt-key add rocm.gpg.key - echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.6.1 ubuntu main' \ - | sudo tee /etc/apt/sources.list.d/rocm.list - echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \ - | sudo tee -a /etc/profile.d/rocm.sh + sudo mkdir --parents --mode=0755 /etc/apt/keyrings + wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null + echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.2.1 noble main" | sudo tee --append /etc/apt/sources.list.d/rocm.list + echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 + echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' | sudo tee -a /etc/profile.d/rocm.sh sudo apt-get update - sudo apt-get install -y rocm-dev rocrand-dev rocprim-dev + sudo apt-get install -y rocm-dev rocrand-dev rocprim-dev hiprand-dev - name: Install Ccache run: | wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz @@ -313,6 +305,8 @@ jobs: which clang which clang++ which hipcc + hipcc --version + hipconfig --full cmake -B${{runner.workspace}}/build-hip \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ @@ -341,7 +335,7 @@ jobs: GPU-Intel: name: GPU-SYCL needs: [Formatting, CPU-GNUmake] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -360,8 +354,7 @@ jobs: ${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - echo "deb https://apt.repos.intel.com/oneapi all main" \ - | sudo tee /etc/apt/sources.list.d/oneAPI.list + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list sudo apt-get update sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp=2024.2.1-1079 intel-oneapi-mkl-devel=2024.2.2-15 - name: Install Ccache @@ -405,7 +398,7 @@ jobs: du -hs ~/.cache/ccache Lint-clang-tidy: needs: Formatting - runs-on: macos-13 + runs-on: ubuntu-24.04 strategy: matrix: enable_eb: [EB-OFF, EB-ON] @@ -418,28 +411,34 @@ jobs: steps: - name: Setup run: | - echo "NPROCS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + echo "NPROCS=$(nproc)" >> $GITHUB_ENV echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV - echo "CCACHE_MAXSIZE=80M" >> $GITHUB_ENV + echo "CCACHE_EXTRAFILES=${{github.workspace}}/.clang-tidy" >> $GITHUB_ENV + echo "CCACHE_MAXSIZE=50M" >> $GITHUB_ENV + echo "CTCACHE_DIR=~/.cache/ctcache" >> $GITHUB_ENV - name: Clone uses: actions/checkout@v4 with: submodules: recursive - name: Install Ccache run: | - brew install ccache + wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz + sudo curl https://raw.githubusercontent.com/matus-chochlik/ctcache/7fd516e91c17779cbc6fc18bd119313d9532dd90/clang-tidy-cache -Lo /usr/bin/clang-tidy-cache + tar xvf ccache-4.8-linux-x86_64.tar.xz + sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ + sudo chmod +x /usr/bin/clang-tidy-cache + mkdir -p ~/.cache/ctcache - name: Set Up Ccache uses: actions/cache@v4 with: - path: /Users/runner/Library/Caches/ccache + path: ~/.cache key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.enable_eb}}-git-${{github.sha}} restore-keys: | ccache-${{github.workflow}}-${{github.job}}-${{matrix.enable_eb}}-git- - name: Configure run: | - export PATH=$(brew --prefix llvm@15)/bin:${PATH} cmake -B${{runner.workspace}}/build-clang-tidy \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ @@ -455,16 +454,19 @@ jobs: working-directory: ${{runner.workspace}}/build-clang-tidy run: | #set -eu -o pipefail - export PATH=$(brew --prefix llvm@15)/bin:${PATH} cmake --build . --parallel ${{env.NPROCS}} 2>&1 | tee -a clang-tidy-full-report.txt - egrep "warning:|error:" clang-tidy-full-report.txt \ + egrep "Warning:|Error:|warning:|error:" clang-tidy-full-report.txt \ | egrep -v "Submodules/amrex|Submodules/sundials|Submodules/AMReX-Hydro" \ | egrep -v "ld: warning:" | sort | uniq \ | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > clang-tidy-warnings.txt - name: Ccache Report run: | + ls ~/.cache + ls ~/.cache/ccache + du -hs ~/.cache/ccache + ls ~/.cache/ctcache + du -hs ~/.cache/ctcache ccache -s - du -hs /Users/runner/Library/Caches/ccache - name: Full report working-directory: ${{runner.workspace}}/build-clang-tidy run: cat clang-tidy-full-report.txt @@ -477,7 +479,7 @@ jobs: exit ${return} Lint-codeql: needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -524,7 +526,7 @@ jobs: sarif_file: sarif-results/cpp.sarif Lint-codespell: needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -543,7 +545,7 @@ jobs: run: codespell Save-PR-Number: if: github.event_name == 'pull_request' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Save PR number env: diff --git a/.github/workflows/cleanup-cache-postpr.yml b/.github/workflows/cleanup-cache-postpr.yml index 5dc32a685..6a30a57d9 100644 --- a/.github/workflows/cleanup-cache-postpr.yml +++ b/.github/workflows/cleanup-cache-postpr.yml @@ -9,7 +9,7 @@ on: jobs: CleanUpCcacheCachePostPR: name: Clean Up Ccahe Cache Post PR - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: actions: write contents: read diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml index eca78d4cb..952d95097 100644 --- a/.github/workflows/cleanup-cache.yml +++ b/.github/workflows/cleanup-cache.yml @@ -9,7 +9,7 @@ on: jobs: CleanUpCcacheCache: name: Clean Up Ccache Cache for ${{ github.event.workflow_run.name }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: actions: write contents: read diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0bd55d965..b410f79d1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,7 @@ on: jobs: Docs: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - name: Python diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml index 2768ef376..8dbeb26f1 100644 --- a/.github/workflows/post-pr.yml +++ b/.github/workflows/post-pr.yml @@ -6,7 +6,7 @@ on: jobs: cleanup: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Save PR number env: diff --git a/Exec/RegTests/EB_EnclosedFlame/pelelmex_prob.cpp b/Exec/RegTests/EB_EnclosedFlame/pelelmex_prob.cpp index 5aa66db39..8883d1b77 100644 --- a/Exec/RegTests/EB_EnclosedFlame/pelelmex_prob.cpp +++ b/Exec/RegTests/EB_EnclosedFlame/pelelmex_prob.cpp @@ -6,7 +6,6 @@ PeleLM::readProbParm() { amrex::ParmParse pp("prob"); - std::string type; pp.query("P_mean", PeleLM::prob_parm->P_mean); pp.query("standoff", PeleLM::prob_parm->standoff); pp.query("pertmag", PeleLM::prob_parm->pertmag); diff --git a/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.H b/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.H index 48565e631..2203d8750 100644 --- a/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.H +++ b/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.H @@ -59,6 +59,8 @@ pelelmex_initdata( , state(i, j, k, VELY) = -prob_parm.meanFlowMag; , state(i, j, k, VELZ) = 0.0); break; + default: + break; } if (!(is_incompressible == 0)) { @@ -99,7 +101,6 @@ bcnormal( ProbParm const& prob_parm, pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/) { - // amrex::GpuArray pmf_vals = {0.0}; amrex::Real massfrac[NUM_SPECIES] = {0.0}; auto eos = pele::physics::PhysicsType::eos(); @@ -117,6 +118,8 @@ bcnormal( AMREX_D_TERM(s_ext[VELZ] = prob_parm.meanFlowMag;, s_ext[VELX] = 0.0; , s_ext[VELY] = 0.0); break; + default: + break; } massfrac[O2_ID] = 0.333; diff --git a/Exec/RegTests/EB_ODEQty/pelelmex_prob.H b/Exec/RegTests/EB_ODEQty/pelelmex_prob.H index 79de0f3fd..70058e742 100644 --- a/Exec/RegTests/EB_ODEQty/pelelmex_prob.H +++ b/Exec/RegTests/EB_ODEQty/pelelmex_prob.H @@ -59,6 +59,8 @@ pelelmex_initdata( , state(i, j, k, VELY) = -prob_parm.meanFlowMag; , state(i, j, k, VELZ) = 0.0); break; + default: + break; } if (!(is_incompressible == 0)) { @@ -153,6 +155,8 @@ bcnormal( AMREX_D_TERM(s_ext[VELZ] = prob_parm.meanFlowMag;, s_ext[VELX] = 0.0; , s_ext[VELY] = 0.0); break; + default: + break; } massfrac[O2_ID] = 0.333; diff --git a/Exec/RegTests/EB_PipeFlow/pelelmex_prob.H b/Exec/RegTests/EB_PipeFlow/pelelmex_prob.H index 7e7e548a8..e53562294 100644 --- a/Exec/RegTests/EB_PipeFlow/pelelmex_prob.H +++ b/Exec/RegTests/EB_PipeFlow/pelelmex_prob.H @@ -77,6 +77,8 @@ pelelmex_initdata( , state(i, j, k, VELY) = -prob_parm.meanFlowMag; , state(i, j, k, VELZ) = 0.0); break; + default: + break; } } else if (prob_parm.flowType == 2) { const amrex::Real dpdx = 709.79; // Pa/m @@ -184,6 +186,8 @@ bcnormal( AMREX_D_TERM(s_ext[VELZ] = prob_parm.meanFlowMag;, s_ext[VELX] = 0.0; , s_ext[VELY] = 0.0); break; + default: + break; } massfrac[O2_ID] = 0.333; diff --git a/Exec/RegTests/EnclosedFlame/pelelmex_prob.cpp b/Exec/RegTests/EnclosedFlame/pelelmex_prob.cpp index 369041db9..9f484370f 100644 --- a/Exec/RegTests/EnclosedFlame/pelelmex_prob.cpp +++ b/Exec/RegTests/EnclosedFlame/pelelmex_prob.cpp @@ -6,7 +6,6 @@ PeleLM::readProbParm() { amrex::ParmParse pp("prob"); - std::string type; pp.query("P_mean", PeleLM::prob_parm->P_mean); pp.query("standoff", PeleLM::prob_parm->standoff); pp.query("pertmag", PeleLM::prob_parm->pertmag); diff --git a/Exec/RegTests/FlameSheet/pelelmex_prob.cpp b/Exec/RegTests/FlameSheet/pelelmex_prob.cpp index 779cd18d2..12845aca2 100644 --- a/Exec/RegTests/FlameSheet/pelelmex_prob.cpp +++ b/Exec/RegTests/FlameSheet/pelelmex_prob.cpp @@ -6,7 +6,6 @@ PeleLM::readProbParm() { amrex::ParmParse pp("prob"); - std::string type; pp.query("P_mean", PeleLM::prob_parm->P_mean); pp.query("standoff", PeleLM::prob_parm->standoff); pp.query("pertmag", PeleLM::prob_parm->pertmag); diff --git a/Exec/RegTests/PeriodicCases/pelelmex_prob.H b/Exec/RegTests/PeriodicCases/pelelmex_prob.H index e7d736d4d..c8d842882 100644 --- a/Exec/RegTests/PeriodicCases/pelelmex_prob.H +++ b/Exec/RegTests/PeriodicCases/pelelmex_prob.H @@ -86,6 +86,8 @@ pelelmex_initdata( , state(i, j, k, VELY) = -prob_parm.meanFlowMag + v_vort; , state(i, j, k, VELZ) = 0.0); break; + default: + break; } if (is_incompressible != 0) { @@ -124,6 +126,8 @@ pelelmex_initdata( , state(i, j, k, VELY) = -prob_parm.meanFlowMag; , state(i, j, k, VELZ) = 0.0); break; + default: + break; } if (is_incompressible != 0) { @@ -176,6 +180,8 @@ pelelmex_initdata( , state(i, j, k, VELY) = -prob_parm.meanFlowMag; , state(i, j, k, VELZ) = 0.0); break; + default: + break; } if (is_incompressible != 0) { diff --git a/Exec/RegTests/SprayTest/pelelmex_prob.cpp b/Exec/RegTests/SprayTest/pelelmex_prob.cpp index c92a4e331..482f8d5d4 100644 --- a/Exec/RegTests/SprayTest/pelelmex_prob.cpp +++ b/Exec/RegTests/SprayTest/pelelmex_prob.cpp @@ -6,7 +6,6 @@ PeleLM::readProbParm() { amrex::ParmParse pp("prob"); - std::string type; pp.query("P_mean", PeleLM::prob_parm->P_mean); pp.query("init_T", PeleLM::prob_parm->T0); pp.query("init_vel", PeleLM::prob_parm->vel); diff --git a/Source/PeleLMeX_EB.cpp b/Source/PeleLMeX_EB.cpp index 890c72818..f5e7a85be 100644 --- a/Source/PeleLMeX_EB.cpp +++ b/Source/PeleLMeX_EB.cpp @@ -672,7 +672,7 @@ PeleLM::getRestartEBMaxLevel() const std::string fileCharPtrString(fileCharPtr.dataPtr()); std::istringstream is(fileCharPtrString, std::istringstream::in); - std::string line, word; + std::string line; // Title line std::getline(is, line); diff --git a/Source/PeleLMeX_FlowController.cpp b/Source/PeleLMeX_FlowController.cpp index dbae2a77b..8e6d07f0c 100644 --- a/Source/PeleLMeX_FlowController.cpp +++ b/Source/PeleLMeX_FlowController.cpp @@ -184,8 +184,11 @@ PeleLM::activeControl(int is_restart) // ------------------------------------------- // Update m_ctrl_* Vectors if not restarting if (is_restart == 0) { +#pragma GCC diagnostic ignored "-Wnull-dereference" m_ctrl_time_pts.insert(m_ctrl_time_pts.begin(), m_cur_time); +#pragma GCC diagnostic ignored "-Wnull-dereference" m_ctrl_velo_pts.insert(m_ctrl_velo_pts.begin(), m_ctrl_V_in); +#pragma GCC diagnostic ignored "-Wnull-dereference" m_ctrl_cntl_pts.insert(m_ctrl_cntl_pts.begin(), coft); if (m_ctrl_time_pts.size() > m_ctrl_NavgPts) { // Pop_back only if it's // filled diff --git a/Source/PeleLMeX_Plot.cpp b/Source/PeleLMeX_Plot.cpp index a6634b4d6..b8bc6c99c 100644 --- a/Source/PeleLMeX_Plot.cpp +++ b/Source/PeleLMeX_Plot.cpp @@ -1052,9 +1052,6 @@ PeleLM::initLevelDataFromPlt(int a_lev, const std::string& a_dataPltFile) void PeleLM::WriteJobInfo(const std::string& path) const { - std::string OtherLine = std::string(78, '-') + "\n"; - std::string SkipSpace = std::string(8, ' '); - if (ParallelDescriptor::IOProcessor()) { // job_info file with details about the run std::ofstream jobInfoFile; diff --git a/Source/PeleLMeX_Regrid.cpp b/Source/PeleLMeX_Regrid.cpp index c4d3fb2ba..dbe506d69 100644 --- a/Source/PeleLMeX_Regrid.cpp +++ b/Source/PeleLMeX_Regrid.cpp @@ -80,6 +80,7 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial) ParallelDescriptor::IOProcessorNumber()) { pmap = test_dmap.ProcessorMap(); } else { +#pragma GCC diagnostic ignored "-Wnull-dereference" pmap.resize(static_cast(grids[0].size())); } ParallelDescriptor::Bcast( @@ -245,6 +246,7 @@ PeleLM::regrid(int lbase, amrex::Real time, bool initial) ParallelDescriptor::IOProcessorNumber()) { pmap = test_dmap.ProcessorMap(); } else { +#pragma GCC diagnostic ignored "-Wnull-dereference" pmap.resize(static_cast(new_ba.size())); } ParallelDescriptor::Bcast( diff --git a/Source/PeleLMeX_Soot.cpp b/Source/PeleLMeX_Soot.cpp index e61b978fc..04e96d9fc 100644 --- a/Source/PeleLMeX_Soot.cpp +++ b/Source/PeleLMeX_Soot.cpp @@ -81,7 +81,7 @@ PeleLM::clipSootMoments() } // TODO: This isn't working yet -#if 0 +/* void PeleLM::addSootDerivePlotVars(PeleLMDeriveList& derive_lst) { @@ -97,5 +97,5 @@ PeleLM::addSootDerivePlotVars(PeleLMDeriveList& derive_lst) "soot_large_particles", IndexType::TheCellType(), large_part_names.size(), large_part_names, soot_largeparticledata, PeleLMDeriveRec::TheSameBox); } -#endif +*/ #endif diff --git a/Source/PeleLMeX_Temporals.cpp b/Source/PeleLMeX_Temporals.cpp index 35a9a5f2d..c33ab4201 100644 --- a/Source/PeleLMeX_Temporals.cpp +++ b/Source/PeleLMeX_Temporals.cpp @@ -60,8 +60,8 @@ void PeleLM::speciesBalancePatch() { tmppatchmfrFile << m_nstep << "," << m_cur_time; // Time info - for (int n = 0; n < m_bPatches.size(); n++) { - BPatch::BpatchDataContainer* bphost = m_bPatches[n]->getHostDataPtr(); + for (const auto& m_bPatche : m_bPatches) { + BPatch::BpatchDataContainer* bphost = m_bPatche->getHostDataPtr(); for (int i = 0; i < bphost->num_species; i++) { tmppatchmfrFile << "," << bphost->speciesFlux[i]; } @@ -570,9 +570,9 @@ PeleLM::addRhoYFluxesPatch( #endif // Loop through all patches - for (int n = 0; n < m_bPatches.size(); n++) { + for (const auto& m_bPatche : m_bPatches) { - BPatch* patch = m_bPatches[n].get(); + BPatch* patch = m_bPatche.get(); BPatch::BpatchDataContainer const* bpdevice = patch->getDeviceData(); BPatch::BpatchDataContainer const* bphost = patch->getHostDataPtr(); const int idim = bphost->m_boundary_dir; @@ -766,8 +766,8 @@ PeleLM::openTempFile() std::ios::out | std::ios::app | std::ios_base::binary); tmppatchmfrFile.precision(12); tmppatchmfrFile << "iter,time"; - for (int n = 0; n < m_bPatches.size(); n++) { - BPatch* patch = m_bPatches[n].get(); + for (const auto& m_bPatche : m_bPatches) { + BPatch* patch = m_bPatche.get(); BPatch::BpatchDataContainer bphost = patch->getHostData(); for (int i = 0; i < bphost.num_species; i++) { tmppatchmfrFile << "," diff --git a/Source/PeleLMeX_Utils.cpp b/Source/PeleLMeX_Utils.cpp index 707c00492..75417e523 100644 --- a/Source/PeleLMeX_Utils.cpp +++ b/Source/PeleLMeX_Utils.cpp @@ -12,9 +12,6 @@ using namespace amrex; void writeBuildInfo() { - std::string OtherLine = std::string(78, '-') + "\n"; - std::string SkipSpace = std::string(8, ' '); - // build information std::cout << PrettyLine; std::cout << " PeleLMeX Build Information\n"; @@ -868,6 +865,7 @@ PeleLM::loadBalanceChemLev(int a_lev) ParallelDescriptor::MyProc() == ParallelDescriptor::IOProcessorNumber()) { pmap = test_dmap.ProcessorMap(); } else { +#pragma GCC diagnostic ignored "-Wnull-dereference" pmap.resize(static_cast(m_baChem[a_lev]->size())); } ParallelDescriptor::Bcast( diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 330b644c6..463e80efa 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -55,7 +55,10 @@ macro(setup_test) file(COPY ${CURRENT_TEST_SOURCE_DIR}/${TEST_NAME}.inp DESTINATION "${CURRENT_TEST_BINARY_DIR}/") file(COPY ${TEST_FILES} DESTINATION "${CURRENT_TEST_BINARY_DIR}/") # Set some default runtime options for all tests - set(RUNTIME_OPTIONS "amr.plot_file=plt amr.plot_int=-1 amr.check_int=-1 amrex.the_arena_is_managed=0 amrex.abort_on_unused_inputs=1") + set(RUNTIME_OPTIONS "amrex.abort_on_unused_inputs=1 amrex.the_arena_is_managed=0 amr.plot_per=-1 amr.check_per=-1 amr.plot_int=-1 amr.check_int=-1") + if(PELE_ENABLE_FCOMPARE_FOR_TESTS) + set(RUNTIME_OPTIONS "${RUNTIME_OPTIONS} amr.plot_file=plt amr.plot_int=10") + endif() if(PELE_ENABLE_FPE_TRAP_FOR_TESTS AND (NOT APPLE)) set(RUNTIME_OPTIONS "${RUNTIME_OPTIONS} amrex.signal_handling=1 amrex.fpe_trap_invalid=1 amrex.fpe_trap_zero=1 amrex.fpe_trap_overflow=1") else() @@ -101,6 +104,12 @@ function(add_test_rv TEST_NAME TEST_EXE_DIR) set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT 18000 PROCESSORS ${PELE_NP} WORKING_DIRECTORY "${CURRENT_TEST_BINARY_DIR}/" LABELS "regression;verification" ATTACHED_FILES_ON_FAIL "${CURRENT_TEST_BINARY_DIR}/${TEST_NAME}.log") endfunction(add_test_rv) +# Regression tests with mass conservation excluded from CI +function(add_test_rev TEST_NAME TEST_EXE_DIR) + add_test_rv(${TEST_NAME} ${TEST_EXE_DIR}) + set_tests_properties(${TEST_NAME} PROPERTIES LABELS "regression;verification;no-ci") +endfunction(add_test_rev) + # Regression tests excluded from CI function(add_test_re TEST_NAME TEST_EXE_DIR) add_test_r(${TEST_NAME} ${TEST_EXE_DIR}) @@ -211,8 +220,8 @@ endfunction(add_test_spray) if(NOT PELE_ENABLE_EB) add_test_r(flamesheet-drm19-${PELE_DIM}d FlameSheet) - add_test_rv(covo-${PELE_DIM}d PeriodicCases) add_test_r(hotbubble-${PELE_DIM}d HotBubble) + add_test_rv(covo-${PELE_DIM}d PeriodicCases) add_test_rv(enclosedflame-${PELE_DIM}d EnclosedFlame) if(PELE_ENABLE_RADIATION) add_test_r(soot-rad-${PELE_DIM}d SootRadTest) @@ -226,4 +235,4 @@ if(NOT PELE_ENABLE_EB) endif() else() add_test_r(eb-odeqty-${PELE_DIM}d EB_ODEQty) -endif() \ No newline at end of file +endif()