From 2af34a0d814072cd11a54f91d845da9e40313fa8 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Sat, 9 Nov 2024 18:45:11 -0700 Subject: [PATCH] Update CI to ubuntu-24.04 (#1338) --- .clang-tidy | 8 +-- .github/workflows/ci.yml | 52 ++++++++----------- .../icns/source_terms/ABLMesoForcingMom.cpp | 4 +- amr-wind/incflo.cpp | 3 +- amr-wind/setup/init.cpp | 10 ++-- .../utilities/sampling/FreeSurfaceSampler.H | 2 +- amr-wind/utilities/sampling/LineSampler.H | 2 +- amr-wind/utilities/sampling/PlaneSampler.H | 2 +- amr-wind/utilities/sampling/ProbeSampler.H | 2 +- amr-wind/utilities/sampling/ProbeSampler.cpp | 8 +-- amr-wind/utilities/sampling/RadarSampler.H | 2 +- .../utilities/sampling/SamplingContainer.cpp | 3 +- amr-wind/utilities/sampling/VolumeSampler.H | 2 +- amr-wind/wind_energy/ABLAnelastic.cpp | 2 +- amr-wind/wind_energy/ABLBoundaryPlane.cpp | 1 - amr-wind/wind_energy/actuator/ActSrcLineOp.H | 5 +- .../wind_energy/actuator/disk/ActSrcDiskOp.H | 6 +-- .../actuator/turbine/ActSrcDiskOp_Turbine.H | 5 +- unit_tests/aw_test_utils/test_utils.H | 3 +- .../test_icns_gravityforcing.cpp | 10 ++-- unit_tests/multiphase/test_momflux.cpp | 2 +- unit_tests/multiphase/test_vof_BCs.cpp | 2 +- unit_tests/multiphase/test_vof_cons.cpp | 2 +- .../ocean_waves/test_relaxation_zones.cpp | 2 +- .../projection/test_pressure_offset.cpp | 4 +- .../utilities/test_linear_interpolation.cpp | 3 +- unit_tests/wind_energy/test_abl_terrain.cpp | 4 +- 27 files changed, 74 insertions(+), 77 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index a2c6e6920e..0ed592f171 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -12,17 +12,19 @@ Checks: 'bugprone-*, performance-*, -performance-avoid-endl, -performance-inefficient-string-concatenation, + -performance-enum-size, portability-*, readability-*, -readability-magic-numbers, -readability-isolate-declaration, -readability-avoid-const-params-in-decls, -readability-identifier-length, - -readability-function-cognitive-complexity' + -readability-function-cognitive-complexity, + -readability-redundant-inline-specifier, + -readability-avoid-nested-conditional-operator' WarningsAsErrors: '' HeaderFilterRegex: '.*' HeaderFileExtensions: ['', "H", 'h', 'hh', 'hpp', 'hxx'] -AnalyzeTemporaryDtors: false FormatStyle: none User: user CheckOptions: @@ -71,7 +73,7 @@ CheckOptions: - { key: readability-identifier-naming.VariableCase, value: lower_case } - { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } - { key: readability-identifier-naming.ClassIgnoredRegexp, value: "incflo"} - - { key: readability-identifier-naming.FunctionIgnoredRegexp, value: "(Godunov_|setVal|ComputeDt|ComputePrescribeDt|ApplyPredictor|ApplyCorrector|ApplyPrescribeStep|ApplyProjection|UpdateGradP|ReadCheckpointFile|Factory|ReadParameters|InitialProjection|InitialIterations|PrintMax|CheckForNans|InitData|Evolve|buildInfoGet|FAST_).*"} + - { key: readability-identifier-naming.FunctionIgnoredRegexp, value: "(CheckAndSetUpDryRun|Godunov_|setVal|ComputeDt|ComputePrescribeDt|ApplyPredictor|ApplyCorrector|ApplyPrescribeStep|ApplyProjection|UpdateGradP|ReadCheckpointFile|Factory|ReadParameters|InitialProjection|InitialIterations|PrintMax|CheckForNans|InitData|Evolve|buildInfoGet|FAST_).*"} - { key: readability-identifier-naming.GlobalConstantIgnoredRegexp, value: "^.*"} - { key: readability-identifier-naming.NamespaceIgnoredRegexp, value: "Hydro"} - { key: readability-identifier-naming.StructIgnoredRegexp, value: "(SC_DX|OpFM).*"} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c04af5991d..6f6b8f37a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: runs-on: ${{matrix.os}} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-24.04, macos-latest] build_type: [Release, Debug] openmp_flag: [OpenMP, NoOpenMP] include: @@ -37,7 +37,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 install -y mpich libmpich-dev comp: gnu procs: $(nproc) @@ -110,7 +110,7 @@ jobs: working-directory: ${{runner.workspace}}/build-ci-${{matrix.build_type}}-${{matrix.openmp_flag}} run: | echo "::add-matcher::.github/problem-matchers/gcc.json" - egrep "warning:|error:" build-output.txt | egrep -v "submods" \ + egrep "Warning:|Error:|warning:|error:" build-output.txt | egrep -v "submods" \ | egrep -v "ld: warning:" | egrep -v "lto-wrapper: warning:" | sort | uniq \ | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > build-output-warnings.txt cat build-output-warnings.txt @@ -122,13 +122,7 @@ jobs: GPU-Nvidia: name: GPU-CUDA needs: Formatting - 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 @@ -156,26 +150,26 @@ jobs: - name: Prepare CUDA environment run: | ${{github.workspace}}/submods/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}} + 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 - name: Configure and build 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 -B build-${{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 -B build-cuda \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DAMR_WIND_ENABLE_MPI:BOOL=OFF \ -DAMR_WIND_ENABLE_CUDA:BOOL=ON \ -DAMReX_CUDA_ERROR_CAPTURE_THIS:BOOL=ON \ -DCMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION:BOOL=ON \ - -DCMAKE_CUDA_ARCHITECTURES=70 \ + -DCMAKE_CUDA_ARCHITECTURES=80 \ -DCMAKE_CUDA_COMPILER_LAUNCHER:STRING=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ ${{github.workspace}} ccache -z - cmake --build build-${{matrix.cuda_pkg}} --parallel ${{env.NPROCS}} + cmake --build build-cuda --parallel ${{env.NPROCS}} - name: Ccache Report run: | ccache -s @@ -184,7 +178,7 @@ jobs: GPU-AMD: name: GPU-HIP needs: Formatting - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -214,10 +208,8 @@ jobs: ${{github.workspace}}/submods/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.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 - curl -O https://repo.radeon.com/rocm/rocm.gpg.key - sudo apt-key add rocm.gpg.key - source /etc/os-release - echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" | sudo tee /etc/apt/sources.list.d/rocm.list + 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 --no-install-recommends build-essential rocm-dev rocrand-dev rocprim-dev hiprand-dev @@ -251,7 +243,7 @@ jobs: GPU-Intel: name: GPU-SYCL needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -341,7 +333,7 @@ jobs: # exit $(tail -n 1 cppcheck-ci-report.txt | awk '{print $2}') Lint-clang-tidy: needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -390,7 +382,7 @@ jobs: working-directory: ${{runner.workspace}}/build-clang-tidy run: | cmake --build . --parallel ${{env.NPROCS}} 2>&1 | tee -a clang-tidy-full-report.txt - cat clang-tidy-full-report.txt | grep "warning:" | grep -v "submods" | sort | uniq | \ + cat clang-tidy-full-report.txt | egrep "Warning:|Error:|warning:|error:" | grep -v "submods" | sort | uniq | \ awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > clang-tidy-ci-report.txt - name: Ccache Report run: | @@ -411,7 +403,7 @@ jobs: exit $(tail -n 1 clang-tidy-ci-report.txt | awk '{print $2}') Lint-codeql: needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Clone uses: actions/checkout@v4 @@ -459,7 +451,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 @@ -478,7 +470,7 @@ jobs: run: codespell Docker: needs: Formatting - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: ecpe4s/exawind-snapshot env: @@ -509,7 +501,7 @@ jobs: " 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/amr-wind/equation_systems/icns/source_terms/ABLMesoForcingMom.cpp b/amr-wind/equation_systems/icns/source_terms/ABLMesoForcingMom.cpp index 2b0924ba84..c851270f2a 100644 --- a/amr-wind/equation_systems/icns/source_terms/ABLMesoForcingMom.cpp +++ b/amr-wind/equation_systems/icns/source_terms/ABLMesoForcingMom.cpp @@ -205,8 +205,8 @@ void ABLMesoForcingMom::mean_velocity_heights( amr_wind::interp::linear(meso_ht, time_interpolated_v, vavg_lc[i]); error_U[i] = height_interpolated_u - vavg.line_average()[static_cast(numcomp * i)]; - error_V[i] = height_interpolated_v - - vavg.line_average()[static_cast(numcomp * i + 1)]; + error_V[i] = + height_interpolated_v - vavg.line_average()[(numcomp * i + 1)]; } if (amrex::toLower(m_forcing_scheme) == "indirect") { diff --git a/amr-wind/incflo.cpp b/amr-wind/incflo.cpp index ae4f995423..aae0088c07 100644 --- a/amr-wind/incflo.cpp +++ b/amr-wind/incflo.cpp @@ -286,8 +286,9 @@ void incflo::Evolve() // Advance to time t + dt for (int fixed_point_iteration = 0; fixed_point_iteration < m_fixed_point_iterations; - ++fixed_point_iteration) + ++fixed_point_iteration) { do_advance(fixed_point_iteration); + } amrex::Print() << std::endl; amrex::Real time2 = amrex::ParallelDescriptor::second(); diff --git a/amr-wind/setup/init.cpp b/amr-wind/setup/init.cpp index f4baec5098..4ca025b540 100644 --- a/amr-wind/setup/init.cpp +++ b/amr-wind/setup/init.cpp @@ -23,15 +23,15 @@ void incflo::CheckAndSetUpDryRun() // Disable additional computations associated with initialization { ParmParse pp("incflo"); - pp.add("initial_iterations", (int)0); - pp.add("do_initial_proj", (bool)false); + pp.add("initial_iterations", 0); + pp.add("do_initial_proj", false); } // Zero time steps, write plotfile and not checkpoint { ParmParse pp("time"); - pp.add("max_step", (int)0); - pp.add("plot_interval", (int)1); - pp.add("checkpoint_inteval", (int)-1); + pp.add("max_step", 0); + pp.add("plot_interval", 1); + pp.add("checkpoint_inteval", (-1)); } // Give prefix to plotfile { diff --git a/amr-wind/utilities/sampling/FreeSurfaceSampler.H b/amr-wind/utilities/sampling/FreeSurfaceSampler.H index 9789401623..699ddfaf4f 100644 --- a/amr-wind/utilities/sampling/FreeSurfaceSampler.H +++ b/amr-wind/utilities/sampling/FreeSurfaceSampler.H @@ -33,7 +33,7 @@ public: void output_locations(SampleLocType& sample_locs) const override { - return sampling_locations(sample_locs); + sampling_locations(sample_locs); } //! Find heights associated with 2D sample locations diff --git a/amr-wind/utilities/sampling/LineSampler.H b/amr-wind/utilities/sampling/LineSampler.H index 418d88fcb2..b7a528d4b3 100644 --- a/amr-wind/utilities/sampling/LineSampler.H +++ b/amr-wind/utilities/sampling/LineSampler.H @@ -41,7 +41,7 @@ public: void output_locations(SampleLocType& sample_locs) const override { - return sampling_locations(sample_locs); + sampling_locations(sample_locs); } void diff --git a/amr-wind/utilities/sampling/PlaneSampler.H b/amr-wind/utilities/sampling/PlaneSampler.H index 3850ad440a..27b4736dd2 100644 --- a/amr-wind/utilities/sampling/PlaneSampler.H +++ b/amr-wind/utilities/sampling/PlaneSampler.H @@ -52,7 +52,7 @@ public: void output_locations(SampleLocType& sample_locs) const override { - return sampling_locations(sample_locs); + sampling_locations(sample_locs); } void diff --git a/amr-wind/utilities/sampling/ProbeSampler.H b/amr-wind/utilities/sampling/ProbeSampler.H index 348da9f36b..df770030be 100644 --- a/amr-wind/utilities/sampling/ProbeSampler.H +++ b/amr-wind/utilities/sampling/ProbeSampler.H @@ -39,7 +39,7 @@ public: void output_locations(SampleLocType& sample_locs) const override { - return sampling_locations(sample_locs); + sampling_locations(sample_locs); } void diff --git a/amr-wind/utilities/sampling/ProbeSampler.cpp b/amr-wind/utilities/sampling/ProbeSampler.cpp index d8a25e0221..2695edeba2 100644 --- a/amr-wind/utilities/sampling/ProbeSampler.cpp +++ b/amr-wind/utilities/sampling/ProbeSampler.cpp @@ -21,7 +21,7 @@ void ProbeSampler::initialize(const std::string& key) } pp.queryarr("offsets", m_poffsets); - if (m_poffsets.size() > 0) { + if (!m_poffsets.empty()) { pp.getarr("offset_vector", m_offset_vector); AMREX_ALWAYS_ASSERT( static_cast(m_offset_vector.size()) == AMREX_SPACEDIM); @@ -44,13 +44,13 @@ void ProbeSampler::initialize(const std::string& key) AMREX_ALWAYS_ASSERT(probes_file.locations().size() == npts_file); // Incorporate offsets int idx = 0; - m_npts = m_poffsets.size() * npts_file; + m_npts = static_cast(m_poffsets.size()) * npts_file; const auto& locs_file = probes_file.locations(); - for (int n = 0; n < m_poffsets.size(); ++n) { + for (double m_poffset : m_poffsets) { for (int i = 0; i < npts_file; ++i) { amrex::RealVect loc; for (int d = 0; d < AMREX_SPACEDIM; ++d) { - loc[d] = locs_file[i][d] + m_poffsets[n] * m_offset_vector[d]; + loc[d] = locs_file[i][d] + m_poffset * m_offset_vector[d]; } m_probes.push_back(loc, idx); ++idx; diff --git a/amr-wind/utilities/sampling/RadarSampler.H b/amr-wind/utilities/sampling/RadarSampler.H index d31681aa1a..663cd231ca 100644 --- a/amr-wind/utilities/sampling/RadarSampler.H +++ b/amr-wind/utilities/sampling/RadarSampler.H @@ -59,7 +59,7 @@ public: void cone_axis_locations(SampleLocType& /*sample_locs*/) const; void output_locations(SampleLocType& sample_locs) const override { - return cone_axis_locations(sample_locs); + cone_axis_locations(sample_locs); } void post_sample_actions() override; diff --git a/amr-wind/utilities/sampling/SamplingContainer.cpp b/amr-wind/utilities/sampling/SamplingContainer.cpp index 49e10751e0..36e235ab7e 100644 --- a/amr-wind/utilities/sampling/SamplingContainer.cpp +++ b/amr-wind/utilities/sampling/SamplingContainer.cpp @@ -118,7 +118,8 @@ void SamplingContainer::initialize_particles( for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) { pp.pos(idim) = loc[idim]; } - pp.idata(IIx::uid) = p_dids[ip] + uid_offset; + pp.idata(IIx::uid) = + static_cast(p_dids[ip] + uid_offset); pp.idata(IIx::sid) = probe_id; pp.idata(IIx::nid) = static_cast(p_dids[ip]); }); diff --git a/amr-wind/utilities/sampling/VolumeSampler.H b/amr-wind/utilities/sampling/VolumeSampler.H index b2892553c2..8ef32b5272 100644 --- a/amr-wind/utilities/sampling/VolumeSampler.H +++ b/amr-wind/utilities/sampling/VolumeSampler.H @@ -42,7 +42,7 @@ public: void output_locations(SampleLocType& sample_locs) const override { - return sampling_locations(sample_locs); + sampling_locations(sample_locs); } void diff --git a/amr-wind/wind_energy/ABLAnelastic.cpp b/amr-wind/wind_energy/ABLAnelastic.cpp index 7c27713e05..82291ab182 100644 --- a/amr-wind/wind_energy/ABLAnelastic.cpp +++ b/amr-wind/wind_energy/ABLAnelastic.cpp @@ -22,7 +22,7 @@ ABLAnelastic::ABLAnelastic(CFDSim& sim) : m_sim(sim) { // ensure use of perturbational pressure form amrex::ParmParse pp("ICNS"); - pp.add("use_perturb_pressure", (bool)true); + pp.add("use_perturb_pressure", true); } if (conserv != 1) { amrex::Abort("ABLAnelastic is not supported for icns_conserv != 1"); diff --git a/amr-wind/wind_energy/ABLBoundaryPlane.cpp b/amr-wind/wind_energy/ABLBoundaryPlane.cpp index 6db51638dd..2aa43c8287 100644 --- a/amr-wind/wind_energy/ABLBoundaryPlane.cpp +++ b/amr-wind/wind_energy/ABLBoundaryPlane.cpp @@ -1076,7 +1076,6 @@ int ABLBoundaryPlane::boundary_native_file_levels() int nlevels = 0; const std::string chkname = m_filename + amrex::Concatenate("/bndry_output", m_in_timesteps[0]); - const std::string level_prefix = "Level_"; for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { const std::string levname = amrex::LevelFullPath(lev, chkname); if (amrex::FileExists(levname)) { diff --git a/amr-wind/wind_energy/actuator/ActSrcLineOp.H b/amr-wind/wind_energy/actuator/ActSrcLineOp.H index 0c4f08393e..015fd8ad0a 100644 --- a/amr-wind/wind_energy/actuator/ActSrcLineOp.H +++ b/amr-wind/wind_energy/actuator/ActSrcLineOp.H @@ -87,8 +87,9 @@ template void ActSrcOp::operator()( const int lev, const amrex::MFIter& mfi, const amrex::Geometry& geom) { - const std::string fname = ActTrait::identifier() + ActSrcLine::identifier(); - BL_PROFILE("amr-wind::ActSrcOp<" + fname + ">"); + BL_PROFILE( + "amr-wind::ActSrcOp<" + ActTrait::identifier() + + ActSrcLine::identifier() + ">"); const auto& bx = mfi.tilebox(); diff --git a/amr-wind/wind_energy/actuator/disk/ActSrcDiskOp.H b/amr-wind/wind_energy/actuator/disk/ActSrcDiskOp.H index 77144fe144..c387e14a1f 100644 --- a/amr-wind/wind_energy/actuator/disk/ActSrcDiskOp.H +++ b/amr-wind/wind_energy/actuator/disk/ActSrcDiskOp.H @@ -58,9 +58,9 @@ void ActSrcOp< std::enable_if_t>>:: operator()(const int lev, const amrex::MFIter& mfi, const amrex::Geometry& geom) { - // cppcheck-suppress unreadVariable - const std::string fname = ActTrait::identifier() + ActSrcDisk::identifier(); - BL_PROFILE("amr-wind::ActSrcOp<" + fname + ">"); + BL_PROFILE( + "amr-wind::ActSrcOp<" + ActTrait::identifier() + + ActSrcDisk::identifier() + ">"); m_spreading(*this, lev, mfi, geom); } diff --git a/amr-wind/wind_energy/actuator/turbine/ActSrcDiskOp_Turbine.H b/amr-wind/wind_energy/actuator/turbine/ActSrcDiskOp_Turbine.H index 1704abc7d6..e3cb4139da 100644 --- a/amr-wind/wind_energy/actuator/turbine/ActSrcDiskOp_Turbine.H +++ b/amr-wind/wind_energy/actuator/turbine/ActSrcDiskOp_Turbine.H @@ -79,8 +79,9 @@ void ActSrcOp< std::enable_if_t>>:: operator()(const int lev, const amrex::MFIter& mfi, const amrex::Geometry& geom) { - const std::string fname = ActTrait::identifier() + ActSrcDisk::identifier(); - BL_PROFILE("amr-wind::ActSrcOp<" + fname + ">"); + BL_PROFILE( + "amr-wind::ActSrcOp<" + ActTrait::identifier() + + ActSrcDisk::identifier() + ">"); const auto& bx = mfi.tilebox(); diff --git a/unit_tests/aw_test_utils/test_utils.H b/unit_tests/aw_test_utils/test_utils.H index a2af7acf54..8e0435e687 100644 --- a/unit_tests/aw_test_utils/test_utils.H +++ b/unit_tests/aw_test_utils/test_utils.H @@ -194,8 +194,7 @@ inline amrex::Real field_probe( const int k, const int icomp = 0) { - amrex::Real value = - field_probe_impl(field, lev, i, j, k, icomp); + auto value = field_probe_impl(field, lev, i, j, k, icomp); amrex::ParallelDescriptor::ReduceRealSum(value); return value; } diff --git a/unit_tests/equation_systems/test_icns_gravityforcing.cpp b/unit_tests/equation_systems/test_icns_gravityforcing.cpp index 91aaae2e57..d57bebb517 100644 --- a/unit_tests/equation_systems/test_icns_gravityforcing.cpp +++ b/unit_tests/equation_systems/test_icns_gravityforcing.cpp @@ -111,7 +111,7 @@ class GravityForcingTest : public AmrexTest } { amrex::ParmParse pp("incflo"); - pp.add("use_godunov", (int)1); + pp.add("use_godunov", 1); } { amrex::ParmParse pp("ICNS"); @@ -133,7 +133,7 @@ TEST_F(GravityForcingTest, full_term_u) populate_parameters(); { amrex::ParmParse pp("ICNS"); - pp.add("use_perturb_pressure", (bool)false); + pp.add("use_perturb_pressure", false); } // Modify gravity to make sure it works { @@ -153,7 +153,7 @@ TEST_F(GravityForcingTest, full_term_rhou) populate_parameters(); { amrex::ParmParse pp("ICNS"); - pp.add("use_perturb_pressure", (bool)false); + pp.add("use_perturb_pressure", false); } // Modify gravity to make sure it works { @@ -180,7 +180,7 @@ TEST_F(GravityForcingTest, perturb_const) populate_parameters(); { amrex::ParmParse pp("ICNS"); - pp.add("use_perturb_pressure", (bool)true); + pp.add("use_perturb_pressure", true); } // Modify gravity to make sure it works { @@ -200,7 +200,7 @@ TEST_F(GravityForcingTest, perturb_field) populate_parameters(); { amrex::ParmParse pp("ICNS"); - pp.add("use_perturb_pressure", (bool)true); + pp.add("use_perturb_pressure", true); } // Expected average gravity term amrex::Real Fg = gz; diff --git a/unit_tests/multiphase/test_momflux.cpp b/unit_tests/multiphase/test_momflux.cpp index bf37babbcf..9dcd1cb46d 100644 --- a/unit_tests/multiphase/test_momflux.cpp +++ b/unit_tests/multiphase/test_momflux.cpp @@ -143,7 +143,7 @@ class MassMomFluxOpTest : public MeshTest amrex::ParmParse pp("incflo"); amrex::Vector physics{"MultiPhase"}; pp.addarr("physics", physics); - pp.add("use_godunov", (int)1); + pp.add("use_godunov", 1); pp.add("godunov_type", (std::string) "weno"); } { diff --git a/unit_tests/multiphase/test_vof_BCs.cpp b/unit_tests/multiphase/test_vof_BCs.cpp index 8311eefbe3..598c6b4564 100644 --- a/unit_tests/multiphase/test_vof_BCs.cpp +++ b/unit_tests/multiphase/test_vof_BCs.cpp @@ -155,7 +155,7 @@ class VOFBCTest : public MeshTest amrex::ParmParse pp("incflo"); amrex::Vector physics{"MultiPhase"}; pp.addarr("physics", physics); - pp.add("use_godunov", (int)1); + pp.add("use_godunov", 1); pp.add("godunov_type", (std::string) "weno"); } { diff --git a/unit_tests/multiphase/test_vof_cons.cpp b/unit_tests/multiphase/test_vof_cons.cpp index 3f1884e2c4..8173aac561 100644 --- a/unit_tests/multiphase/test_vof_cons.cpp +++ b/unit_tests/multiphase/test_vof_cons.cpp @@ -122,7 +122,7 @@ class VOFConsTest : public MeshTest amrex::ParmParse pp("incflo"); amrex::Vector physics{"MultiPhase"}; pp.addarr("physics", physics); - pp.add("use_godunov", (int)1); + pp.add("use_godunov", 1); } { amrex::ParmParse pp("time"); diff --git a/unit_tests/ocean_waves/test_relaxation_zones.cpp b/unit_tests/ocean_waves/test_relaxation_zones.cpp index b9f669b1ce..51575e1b9f 100644 --- a/unit_tests/ocean_waves/test_relaxation_zones.cpp +++ b/unit_tests/ocean_waves/test_relaxation_zones.cpp @@ -53,7 +53,7 @@ class OceanWavesOpTest : public MeshTest amrex::ParmParse pp("incflo"); amrex::Vector phystr{"MultiPhase", "OceanWaves"}; pp.addarr("physics", phystr); - pp.add("use_godunov", (int)1); + pp.add("use_godunov", 1); } } }; diff --git a/unit_tests/projection/test_pressure_offset.cpp b/unit_tests/projection/test_pressure_offset.cpp index 06b02b74d4..66fe46c0b0 100644 --- a/unit_tests/projection/test_pressure_offset.cpp +++ b/unit_tests/projection/test_pressure_offset.cpp @@ -137,7 +137,7 @@ class ProjPerturb : public AmrexTest } { amrex::ParmParse pp("incflo"); - pp.add("use_godunov", (int)1); + pp.add("use_godunov", 1); } // Boundary conditions @@ -184,7 +184,7 @@ TEST_F(ProjPerturb, full_p_perturb) populate_parameters(); { amrex::ParmParse pp("ICNS"); - pp.add("reconstruct_true_pressure", (bool)true); + pp.add("reconstruct_true_pressure", true); } // Test with gravity term omitted, then added as reference pressure diff --git a/unit_tests/utilities/test_linear_interpolation.cpp b/unit_tests/utilities/test_linear_interpolation.cpp index 663d551f51..08877afef5 100644 --- a/unit_tests/utilities/test_linear_interpolation.cpp +++ b/unit_tests/utilities/test_linear_interpolation.cpp @@ -153,7 +153,8 @@ TEST(LinearInterpolation, lin_interp_single_multicomponent) namespace interp = amr_wind::interp; const int ncomp = 3; - std::vector xvec(10), yvec(ncomp * 10); + std::vector xvec(10); + std::vector yvec(static_cast(ncomp * 10)); std::iota(xvec.begin(), xvec.end(), 0.0); const amrex::Vector mult_facs = { 2.0 + 10.0 * amrex::Random(), 2.0 + 10.0 * amrex::Random(), diff --git a/unit_tests/wind_energy/test_abl_terrain.cpp b/unit_tests/wind_energy/test_abl_terrain.cpp index c99df7e75b..775b247de6 100644 --- a/unit_tests/wind_energy/test_abl_terrain.cpp +++ b/unit_tests/wind_energy/test_abl_terrain.cpp @@ -57,14 +57,14 @@ class TerrainTest : public MeshTest pp.addarr("prob_hi", probhi); } } - std::string terrain_fname = "terrain.amrwind"; + std::string m_terrain_fname = "terrain.amrwind"; }; TEST_F(TerrainTest, terrain) { constexpr amrex::Real tol = 0; // Write target wind file - write_terrain(terrain_fname); + write_terrain(m_terrain_fname); populate_parameters(); initialize_mesh(); auto& pde_mgr = sim().pde_manager();