diff --git a/.github/workflows/ascent.yml b/.github/workflows/ascent.yml index 74421cebac3..dbcb4c614ab 100644 --- a/.github/workflows/ascent.yml +++ b/.github/workflows/ascent.yml @@ -9,7 +9,7 @@ concurrency: jobs: ascent: name: Ascent - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 if: github.event.pull_request.draft == false env: CXX: g++ diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml index bbbc08723e4..5966110cc08 100644 --- a/.github/workflows/clang.yml +++ b/.github/workflows/clang.yml @@ -13,15 +13,15 @@ jobs: # Build and install libamrex as AMReX CMake project # Note: this is an intentional "minimal" build that does not enable (many) options library_clang: - name: Clang@7.0 C++17 SP NOMPI Debug [lib] - runs-on: ubuntu-20.04 + name: Clang@18 C++17 SP NOMPI Debug [lib] + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_clang.sh 7 + .github/workflows/dependencies/dependencies_clang.sh 18 .github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache @@ -54,8 +54,8 @@ jobs: -DAMReX_PLOTFILE_TOOLS=ON \ -DAMReX_PRECISION=SINGLE \ -DAMReX_PARTICLES_PRECISION=SINGLE \ - -DCMAKE_C_COMPILER=$(which clang-7) \ - -DCMAKE_CXX_COMPILER=$(which clang++-7) \ + -DCMAKE_C_COMPILER=$(which clang-18) \ + -DCMAKE_CXX_COMPILER=$(which clang++-18) \ -DCMAKE_Fortran_COMPILER=$(which gfortran) \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache make -j 4 diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 4b23db20e9e..62ec457c813 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -10,17 +10,17 @@ jobs: check_changes: uses: ./.github/workflows/check_changes.yml - # Build libamrex and all tests with CUDA 11.2 - tests-cuda11: - name: CUDA@11.2 GNU@9.3.0 C++17 Release [tests] - runs-on: ubuntu-20.04 + # Build libamrex and all tests with CUDA 12.6 + tests-cuda12: + name: CUDA@12.6 C++17 Release [tests] + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_nvcc.sh 11.2 + .github/workflows/dependencies/dependencies_nvcc.sh 12.6 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache uses: actions/cache@v4 @@ -121,7 +121,7 @@ jobs: # Build libamrex and all tests with NVHPC (recent supported) tests-nvhpc-nvcc: name: NVHPC NVCC/NVC++ C++17 Release [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -185,15 +185,15 @@ jobs: # Build 3D libamrex cuda build with configure configure-3d-cuda: - name: CUDA@11.2 GNU@9.3.0 [configure 3D] - runs-on: ubuntu-20.04 + name: CUDA@12.6 [configure 3D] + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_nvcc.sh 11.2 + .github/workflows/dependencies/dependencies_nvcc.sh 12.6 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache uses: actions/cache@v4 diff --git a/.github/workflows/dependencies/dependencies_hip.sh b/.github/workflows/dependencies/dependencies_hip.sh index 527379e7e83..4475034f50f 100755 --- a/.github/workflows/dependencies/dependencies_hip.sh +++ b/.github/workflows/dependencies/dependencies_hip.sh @@ -33,7 +33,9 @@ sudo apt-key add rocm.gpg.key source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ... -echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" \ +VERSION=${1-6.3.2} + +echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${VERSION} ${UBUNTU_CODENAME} 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 @@ -53,16 +55,17 @@ sudo apt-get install -y --no-install-recommends \ libnuma-dev \ libopenmpi-dev \ openmpi-bin \ - rocm-dev \ - roctracer-dev \ - rocprofiler-dev \ - rocrand-dev \ - rocfft-dev \ - rocprim-dev \ - rocsparse-dev + rocm-dev${VERSION} \ + roctracer-dev${VERSION} \ + rocprofiler-dev${VERSION} \ + rocrand-dev${VERSION} \ + rocfft-dev${VERSION} \ + rocprim-dev${VERSION} \ + rocsparse-dev${VERSION} \ + hiprand-dev${VERSION} # hiprand-dev is a new package that does not exist in old versions -sudo apt-get install -y --no-install-recommends hiprand-dev || true +#sudo apt-get install -y --no-install-recommends hiprand-dev${VERSION} || true # activate # diff --git a/.github/workflows/dependencies/dependencies_nvcc.sh b/.github/workflows/dependencies/dependencies_nvcc.sh index 14bae699d7e..7c7d75f274e 100755 --- a/.github/workflows/dependencies/dependencies_nvcc.sh +++ b/.github/workflows/dependencies/dependencies_nvcc.sh @@ -38,4 +38,7 @@ sudo apt-get install -y \ libcufft-dev-$VERSION_DASHED \ libcurand-dev-$VERSION_DASHED \ libcusparse-dev-$VERSION_DASHED + +sudo apt-get install -y --no-install-recommends libnvjitlink-dev-$VERSION_DASHED || true + sudo ln -s cuda-$VERSION_DOTTED /usr/local/cuda diff --git a/.github/workflows/gcc.yml b/.github/workflows/gcc.yml index 3b9bddac8fb..3249c6eacd5 100644 --- a/.github/workflows/gcc.yml +++ b/.github/workflows/gcc.yml @@ -16,15 +16,15 @@ jobs: # Build and install libamrex as AMReX CMake project # Note: this is an intentional "minimal" build that does not enable (many) options library: - name: GNU@8.4 C++17 Release [lib] - runs-on: ubuntu-20.04 + name: GNU@14 C++17 Release [lib] + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_gcc.sh 8 + .github/workflows/dependencies/dependencies_gcc.sh 14 .github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache @@ -35,7 +35,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install - env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} + env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs -Wno-array-bounds"} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -52,9 +52,9 @@ jobs: -DAMReX_PLOTFILE_TOOLS=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \ - -DCMAKE_C_COMPILER=$(which gcc-8) \ - -DCMAKE_CXX_COMPILER=$(which g++-8) \ - -DCMAKE_Fortran_COMPILER=$(which gfortran-8) \ + -DCMAKE_C_COMPILER=$(which gcc-14) \ + -DCMAKE_CXX_COMPILER=$(which g++-14) \ + -DCMAKE_Fortran_COMPILER=$(which gfortran-14) \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache make -j 4 make install @@ -127,7 +127,7 @@ jobs: tests_build_2D: name: GNU@9.3 C++17 2D Debug Fortran [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -178,7 +178,7 @@ jobs: tests_build_1D: name: GNU@9.3 C++17 1D Debug Fortran [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -231,7 +231,7 @@ jobs: # Build libamrex and all tests tests_cxx20: name: GNU@10.1 C++20 OMP [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -292,15 +292,15 @@ jobs: # Build libamrex and all tests w/o MPI tests-nonmpi: - name: GNU@8.4 C++17 NOMPI [tests] - runs-on: ubuntu-20.04 + name: GNU@14 C++17 NOMPI [tests] + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_gcc.sh 8 + .github/workflows/dependencies/dependencies_gcc.sh 14 .github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 17 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache @@ -311,7 +311,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install - env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} + env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs -Wno-array-bounds"} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -335,9 +335,9 @@ jobs: -DAMReX_ENABLE_TESTS=ON \ -DAMReX_FORTRAN=ON \ -DAMReX_MPI=OFF \ - -DCMAKE_C_COMPILER=$(which gcc-8) \ - -DCMAKE_CXX_COMPILER=$(which g++-8) \ - -DCMAKE_Fortran_COMPILER=$(which gfortran-8) \ + -DCMAKE_C_COMPILER=$(which gcc-14) \ + -DCMAKE_CXX_COMPILER=$(which g++-14) \ + -DCMAKE_Fortran_COMPILER=$(which gfortran-14) \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache make -j 4 @@ -417,7 +417,7 @@ jobs: # Build 1D libamrex with configure configure-1d: name: GNU@9.3 Release [configure 1D] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -501,7 +501,7 @@ jobs: # Build 3D libamrex with single precision and tiny profiler configure-3d-single-tprof: name: GNU@9.3 Release [configure 3D] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -544,7 +544,7 @@ jobs: # Build 3D libamrex debug omp build with configure configure-3d-omp-debug: name: GNU@9.3 OMP Debug [configure 3D] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -586,7 +586,7 @@ jobs: # Build Tools/Plotfile plotfile-tools: name: GNU Plotfile Tools [tools] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -679,7 +679,7 @@ jobs: test_hdf5: name: GNU@9.3 HDF5 I/O Test [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' env: diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index 7f88fe55572..148e8803497 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -12,14 +12,14 @@ jobs: tests-hip: name: HIP ROCm Flang C++17 [tests] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_hip.sh + .github/workflows/dependencies/dependencies_hip.sh 6.3.2 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache uses: actions/cache@v4 @@ -46,11 +46,6 @@ jobs: which clang++ which flang - # "mpic++ --showme" forgets open-pal in Ubuntu 20.04 + OpenMPI 4.0.3 - # https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/1941786 - # https://github.com/open-mpi/ompi/issues/9317 - export LDFLAGS="-lopen-pal" - cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DAMReX_FFT=ON \ @@ -73,14 +68,14 @@ jobs: tests-hip-wrapper: name: HIP ROCm GFortran@9.3 C++17 [tests-hipcc] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_hip.sh + .github/workflows/dependencies/dependencies_hip.sh 6.3.2 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache uses: actions/cache@v4 @@ -104,11 +99,6 @@ jobs: source /etc/profile.d/rocm.sh hipcc --version - # "mpic++ --showme" forgets open-pal in Ubuntu 20.04 + OpenMPI 4.0.3 - # https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/1941786 - # https://github.com/open-mpi/ompi/issues/9317 - export LDFLAGS="-lopen-pal" - cmake -S . -B build_full_legacywrapper \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DAMReX_FFT=ON \ @@ -133,7 +123,7 @@ jobs: # Build 2D libamrex hip build with configure configure-2d-single-hip: name: HIP EB [configure 2D] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: @@ -168,7 +158,7 @@ jobs: # Build 3D EB hip with gnu make hip-3d-eb-gmake: name: HIP EB 3D GMake - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: diff --git a/.github/workflows/hypre.yml b/.github/workflows/hypre.yml index a2b97771302..bbae84723c4 100644 --- a/.github/workflows/hypre.yml +++ b/.github/workflows/hypre.yml @@ -11,25 +11,25 @@ jobs: uses: ./.github/workflows/check_changes.yml compile-hypre-cuda-eb-2d: - name: CUDA EB 2D Hypre@2.26.0 - runs-on: ubuntu-20.04 + name: CUDA EB 2D Hypre@2.32.0 + runs-on: ubuntu-22.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' env: - AMREX_HYPRE_HOME: ${HOME}/.cache/hypre-2.26.0-cuda + AMREX_HYPRE_HOME: ${HOME}/.cache/hypre-2.32.0-cuda steps: - uses: actions/checkout@v4 - name: Dependencies run: | - .github/workflows/dependencies/dependencies_nvcc.sh 11.2 - sudo apt-get install -y libcublas-dev-11-2 libcusparse-dev-11-2 + .github/workflows/dependencies/dependencies_nvcc.sh 12.0 + sudo apt-get install -y libcublas-dev-12.0 .github/workflows/dependencies/dependencies_ccache.sh - name: Set Up Cache uses: actions/cache@v4 with: path: | ~/.cache/ccache - ~/.cache/hypre-2.26.0-cuda + ~/.cache/hypre-2.32.0-cuda key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- @@ -37,9 +37,9 @@ jobs: run: | if [ ! -d "${{ env.AMREX_HYPRE_HOME }}" ] then - wget -q https://github.com/hypre-space/hypre/archive/refs/tags/v2.26.0.tar.gz - tar xfz v2.26.0.tar.gz - cd hypre-2.26.0/src + wget -q https://github.com/hypre-space/hypre/archive/refs/tags/v2.32.0.tar.gz + tar xfz v2.32.0.tar.gz + cd hypre-2.32.0/src ./configure --with-cxxstandard=17 --with-cuda --enable-unified-memory \ --with-cuda-home=/usr/local/cuda --with-gpu-arch="80" \ --prefix=${{ env.AMREX_HYPRE_HOME }} diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index d923ff9f579..267e33d8fad 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -159,7 +159,7 @@ jobs: no-tests-oneapi-sycl-amd: name: oneAPI SYCL for AMD GPUs - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' steps: diff --git a/.github/workflows/sensei.yml b/.github/workflows/sensei.yml index d1fcbaea67f..b6cee539ad9 100644 --- a/.github/workflows/sensei.yml +++ b/.github/workflows/sensei.yml @@ -14,7 +14,7 @@ jobs: test_sensei: name: SENSEI Adaptor [test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 needs: check_changes if: needs.check_changes.outputs.has_non_docs_changes == 'true' env: diff --git a/Src/Base/AMReX_GpuLaunchGlobal.H b/Src/Base/AMReX_GpuLaunchGlobal.H index 333a1ba1db9..315af59085b 100644 --- a/Src/Base/AMReX_GpuLaunchGlobal.H +++ b/Src/Base/AMReX_GpuLaunchGlobal.H @@ -4,6 +4,11 @@ #include +#if defined(AMREX_USE_CUDA) && defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + namespace amrex { #if defined(AMREX_USE_CUDA) || defined(AMREX_USE_HIP) @@ -22,4 +27,8 @@ namespace amrex { } +#if defined(AMREX_USE_CUDA) && defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + #endif diff --git a/Src/FFT/AMReX_FFT_R2C.H b/Src/FFT/AMReX_FFT_R2C.H index 36db327d905..fa071fea6d0 100644 --- a/Src/FFT/AMReX_FFT_R2C.H +++ b/Src/FFT/AMReX_FFT_R2C.H @@ -530,7 +530,7 @@ R2C::R2C (Box const& domain, Info const& info) } template -R2C::~R2C () +R2C::~R2C () { if (m_fft_bwd_x.plan != m_fft_fwd_x.plan) { m_fft_bwd_x.destroy(); diff --git a/Src/Particle/AMReX_DenseBins.H b/Src/Particle/AMReX_DenseBins.H index ec5aebd6a20..743673b8b19 100644 --- a/Src/Particle/AMReX_DenseBins.H +++ b/Src/Particle/AMReX_DenseBins.H @@ -332,6 +332,8 @@ public: { BL_PROFILE("DenseBins::buildOpenMP"); + if (nbins <= 0) { return; } + m_items = v; m_bins.resize(nitems); diff --git a/Src/Particle/AMReX_TracerParticles.cpp b/Src/Particle/AMReX_TracerParticles.cpp index 849fb086a87..f43d2ef826a 100644 --- a/Src/Particle/AMReX_TracerParticles.cpp +++ b/Src/Particle/AMReX_TracerParticles.cpp @@ -282,7 +282,6 @@ TracerParticleContainer::Timestamp (const std::string& basename, const FArrayBox& fab = mf[grid]; auto uccarr = fab.array(); - amrex::Array4* uccarr_ptr = &uccarr; #ifdef AMREX_USE_GPU std::unique_ptr hostfab; { @@ -291,8 +290,7 @@ TracerParticleContainer::Timestamp (const std::string& basename, Gpu::dtoh_memcpy_async(hostfab->dataPtr(), fab.dataPtr(), fab.size()*sizeof(Real)); Gpu::streamSynchronize(); - auto hostarr = hostfab->const_array(); - uccarr_ptr = &hostarr; + uccarr = hostfab->const_array(); } #endif @@ -322,7 +320,7 @@ TracerParticleContainer::Timestamp (const std::string& basename, if (M > 0) { - cic_interpolate(p, plo, dxi, *uccarr_ptr, vals.data(), M); + cic_interpolate(p, plo, dxi, uccarr, vals.data(), M); for (int i = 0; i < M; i++) { diff --git a/Tests/LinearSolvers/ABecLap_SP/initProb_K.H b/Tests/LinearSolvers/ABecLap_SP/initProb_K.H index 02414bc5439..d593cb2cbce 100644 --- a/Tests/LinearSolvers/ABecLap_SP/initProb_K.H +++ b/Tests/LinearSolvers/ABecLap_SP/initProb_K.H @@ -76,9 +76,9 @@ void actual_init_bcoef (int i, int j, int k, if (domain.contains(i,j,k)) { sol(i,j,k) = 0.0; } else { - AMREX_D_TERM(x = std::clamp(x, prob_lo[0], prob_hi[0]);, - y = std::clamp(y, prob_lo[1], prob_hi[1]);, - z = std::clamp(z, prob_lo[2], prob_hi[2]);); + AMREX_D_TERM(x = amrex::Clamp(x, prob_lo[0], prob_hi[0]);, + y = amrex::Clamp(y, prob_lo[1], prob_hi[1]);, + z = amrex::Clamp(z, prob_lo[2], prob_hi[2]);); sol(i,j,k) = std::cos(tpi*x) * std::cos(tpi*y) * std::cos(tpi*z) + .25 * std::cos(fpi*x) * std::cos(fpi*y) * std::cos(fpi*z); } diff --git a/Tests/LinearSolvers/ABecLaplacian_C/initProb_K.H b/Tests/LinearSolvers/ABecLaplacian_C/initProb_K.H index 8d98aa10789..3dba4a77124 100644 --- a/Tests/LinearSolvers/ABecLaplacian_C/initProb_K.H +++ b/Tests/LinearSolvers/ABecLaplacian_C/initProb_K.H @@ -134,12 +134,12 @@ void actual_init_abeclap (int i, int j, int k, + a * (std::cos(tpi*x) * std::cos(tpi*y) * std::cos(tpi*z) + 0.25 * std::cos(fpi*x) * std::cos(fpi*y) * std::cos(fpi*z)); } else { - amrex::Real xb = std::clamp(x, prob_lo[0], prob_hi[0]); - amrex::Real yb = std::clamp(y, prob_lo[1], prob_hi[1]); + amrex::Real xb = amrex::Clamp(x, prob_lo[0], prob_hi[0]); + amrex::Real yb = amrex::Clamp(y, prob_lo[1], prob_hi[1]); #if (AMREX_SPACEDIM == 2) amrex::Real zb = 0.0; #else - amrex::Real zb = std::clamp(z, prob_lo[2], prob_hi[2]); + amrex::Real zb = amrex::Clamp(z, prob_lo[2], prob_hi[2]); #endif // provide Dirichlet BC sol(i,j,k) = std::cos(tpi*xb) * std::cos(tpi*yb) * std::cos(tpi*zb) diff --git a/Tools/Plotfile/AMReX_PPMUtil.cpp b/Tools/Plotfile/AMReX_PPMUtil.cpp index b5d612debca..2d8e29d82f4 100644 --- a/Tools/Plotfile/AMReX_PPMUtil.cpp +++ b/Tools/Plotfile/AMReX_PPMUtil.cpp @@ -20,6 +20,7 @@ int loadPalette (const std::string& filename, FILE* fp = std::fopen(filename.c_str(), "rb"); if (!fp) { amrex::Abort("loadPalette: cannot open "+filename); + return 0; } std::fseek(fp, 0, SEEK_END);