Skip to content

Commit

Permalink
Update CI to ubuntu-24.04 (#1338)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Nov 10, 2024
1 parent 49600cb commit 2af34a0
Show file tree
Hide file tree
Showing 27 changed files with 74 additions and 77 deletions.
8 changes: 5 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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).*"}
Expand Down
52 changes: 22 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(numcomp * i)];
error_V[i] = height_interpolated_v -
vavg.line_average()[static_cast<int>(numcomp * i + 1)];
error_V[i] =
height_interpolated_v - vavg.line_average()[(numcomp * i + 1)];
}

if (amrex::toLower(m_forcing_scheme) == "indirect") {
Expand Down
3 changes: 2 additions & 1 deletion amr-wind/incflo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions amr-wind/setup/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/FreeSurfaceSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/LineSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public:

void output_locations(SampleLocType& sample_locs) const override
{
return sampling_locations(sample_locs);
sampling_locations(sample_locs);
}

void
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/PlaneSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public:

void output_locations(SampleLocType& sample_locs) const override
{
return sampling_locations(sample_locs);
sampling_locations(sample_locs);
}

void
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/ProbeSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public:

void output_locations(SampleLocType& sample_locs) const override
{
return sampling_locations(sample_locs);
sampling_locations(sample_locs);
}

void
Expand Down
8 changes: 4 additions & 4 deletions amr-wind/utilities/sampling/ProbeSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(m_offset_vector.size()) == AMREX_SPACEDIM);
Expand All @@ -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<int>(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;
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/RadarSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion amr-wind/utilities/sampling/SamplingContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(p_dids[ip] + uid_offset);
pp.idata(IIx::sid) = probe_id;
pp.idata(IIx::nid) = static_cast<int>(p_dids[ip]);
});
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/utilities/sampling/VolumeSampler.H
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public:

void output_locations(SampleLocType& sample_locs) const override
{
return sampling_locations(sample_locs);
sampling_locations(sample_locs);
}

void
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/wind_energy/ABLAnelastic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 0 additions & 1 deletion amr-wind/wind_energy/ABLBoundaryPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
5 changes: 3 additions & 2 deletions amr-wind/wind_energy/actuator/ActSrcLineOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ template <typename ActTrait>
void ActSrcOp<ActTrait, ActSrcLine>::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();

Expand Down
6 changes: 3 additions & 3 deletions amr-wind/wind_energy/actuator/disk/ActSrcDiskOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ void ActSrcOp<
std::enable_if_t<std::is_base_of_v<DiskType, ActTrait>>>::
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);
}

Expand Down
5 changes: 3 additions & 2 deletions amr-wind/wind_energy/actuator/turbine/ActSrcDiskOp_Turbine.H
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ void ActSrcOp<
std::enable_if_t<std::is_base_of_v<TurbineType, ActTrait>>>::
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();

Expand Down
3 changes: 1 addition & 2 deletions unit_tests/aw_test_utils/test_utils.H
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ inline amrex::Real field_probe(
const int k,
const int icomp = 0)
{
amrex::Real value =
field_probe_impl<amrex::Real>(field, lev, i, j, k, icomp);
auto value = field_probe_impl<amrex::Real>(field, lev, i, j, k, icomp);
amrex::ParallelDescriptor::ReduceRealSum(value);
return value;
}
Expand Down
Loading

0 comments on commit 2af34a0

Please sign in to comment.