Skip to content

Commit

Permalink
Merge branch 'main' into new_multiphase_hybrid_nodalcoupling
Browse files Browse the repository at this point in the history
  • Loading branch information
mbkuhn authored Dec 17, 2024
2 parents 5d26910 + aac8202 commit 9bd2d0f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
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-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
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 libcusparse-dev-12-6
- name: Configure and build
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda-12.6/bin:${PATH}
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
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
sudo apt-get install -y --no-install-recommends build-essential rocm-dev rocrand-dev rocprim-dev hiprand-dev rocsparse-dev
- name: Configure and build
run: |
source /etc/profile.d/rocm.sh
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
cat build-output-warnings.txt
exit $(tail -n 1 build-output-warnings.txt | awk '{print $2}')
- name: Deploy
if: github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@releases/v3
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
BRANCH: gh-pages
FOLDER: documentation
SINGLE_COMMIT: true
token: ${{secrets.GITHUB_TOKEN}}
branch: gh-pages
folder: documentation
single-commit: true
12 changes: 9 additions & 3 deletions amr-wind/utilities/index_operations.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@
namespace amr_wind::utils {

//! Return closest index (from lower) of value in vector
AMREX_FORCE_INLINE int
closest_index(const amrex::Vector<amrex::Real>& vec, const amrex::Real value)
AMREX_FORCE_INLINE int closest_index(
const amrex::Vector<amrex::Real>& vec,
const amrex::Real value,
const amrex::Real tol = 0.0)
{
auto const it = std::upper_bound(vec.begin(), vec.end(), value);
auto it = std::upper_bound(vec.begin(), vec.end(), value);
if (it == vec.end()) {
// Try again with tolerance added
it = std::upper_bound(vec.begin(), vec.end(), value - tol);
}
AMREX_ALWAYS_ASSERT(it != vec.end());

const int idx = static_cast<int>(std::distance(vec.begin(), it));
Expand Down
30 changes: 20 additions & 10 deletions amr-wind/wind_energy/ABLBoundaryPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ void InletData::read_data(
const size_t nc = fld->num_comp();
const int nstart = m_components[static_cast<int>(fld->id())];

const int idx = utils::closest_index(times, time);
const int idx = utils::closest_index(times, time, constants::LOOSE_TOL);
const int idxp1 = idx + 1;
m_tn = times[idx];
m_tnp1 = times[idxp1];
AMREX_ALWAYS_ASSERT(((m_tn <= time) && (time <= m_tnp1)));
AMREX_ALWAYS_ASSERT(
((m_tn <= time + constants::LOOSE_TOL) &&
(time <= m_tnp1 + constants::LOOSE_TOL)));

const int normal = ori.coordDir();
const amrex::GpuArray<int, 2> perp = utils::perpendicular_idx(normal);
Expand Down Expand Up @@ -152,15 +154,17 @@ void InletData::read_data_native(
const int nstart =
static_cast<int>(m_components[static_cast<int>(fld->id())]);

const int idx = utils::closest_index(times, time);
const int idx = utils::closest_index(times, time, constants::LOOSE_TOL);
const int idxp1 = idx + 1;

m_tn = times[idx];
m_tnp1 = times[idxp1];

auto ori = oit();

AMREX_ALWAYS_ASSERT(((m_tn <= time) && (time <= m_tnp1)));
AMREX_ALWAYS_ASSERT(
((m_tn <= time + constants::LOOSE_TOL) &&
(time <= m_tnp1 + constants::LOOSE_TOL)));
AMREX_ALWAYS_ASSERT(fld->num_comp() == bndry_n[ori].nComp());
AMREX_ASSERT(bndry_n[ori].boxArray() == bndry_np1[ori].boxArray());

Expand Down Expand Up @@ -711,7 +715,8 @@ void ABLBoundaryPlane::read_header()
ncf.var("time").get(m_in_times.data());

// Sanity check the input file time
AMREX_ALWAYS_ASSERT(m_in_times[0] <= m_time.current_time());
AMREX_ALWAYS_ASSERT(
m_in_times[0] <= m_time.current_time() + constants::LOOSE_TOL);

for (auto& plane_grp : ncf.all_groups()) {
int normal, face_dir;
Expand Down Expand Up @@ -1042,7 +1047,9 @@ void ABLBoundaryPlane::read_file(const bool nph_target_time)
const amrex::Real time =
nph_target_time ? m_time.current_time() + 0.5 * m_time.delta_t()
: m_time.new_time();
AMREX_ALWAYS_ASSERT((m_in_times[0] <= time) && (time < m_in_times.back()));
AMREX_ALWAYS_ASSERT(
(m_in_times[0] <= time + constants::LOOSE_TOL) &&
(time < m_in_times.back() + constants::LOOSE_TOL));

// return early if current data files can still be interpolated in time
if ((m_in_data.tn() <= time) && (time < m_in_data.tnp1())) {
Expand Down Expand Up @@ -1078,12 +1085,14 @@ void ABLBoundaryPlane::read_file(const bool nph_target_time)

if (m_out_fmt == "native") {

const int index = utils::closest_index(m_in_times, time);
const int index =
utils::closest_index(m_in_times, time, constants::LOOSE_TOL);
const int t_step1 = m_in_timesteps[index];
const int t_step2 = m_in_timesteps[index + 1];

AMREX_ALWAYS_ASSERT(
(m_in_times[index] <= time) && (time <= m_in_times[index + 1]));
(m_in_times[index] <= time + constants::LOOSE_TOL) &&
(time <= m_in_times[index + 1] + constants::LOOSE_TOL));

const std::string chkname1 =
m_filename + amrex::Concatenate("/bndry_output", t_step1);
Expand Down Expand Up @@ -1161,9 +1170,10 @@ void ABLBoundaryPlane::populate_data(
}

AMREX_ALWAYS_ASSERT(
((m_in_data.tn() <= time) || (time <= m_in_data.tnp1())));
((m_in_data.tn() <= time - constants::LOOSE_TOL) ||
(time <= m_in_data.tnp1() - constants::LOOSE_TOL)));
AMREX_ALWAYS_ASSERT(
std::abs(time - m_in_data.tinterp()) < constants::TIGHT_TOL);
std::abs(time - m_in_data.tinterp()) < constants::LOOSE_TOL);

for (amrex::OrientationIter oit; oit != nullptr; ++oit) {
auto ori = oit();
Expand Down
2 changes: 1 addition & 1 deletion submods/amrex
Submodule amrex updated 47 files
+2 −1 .github/workflows/dependencies/dependencies_hip.sh
+2 −1 .github/workflows/dependencies/dependencies_nvcc.sh
+2 −2 .github/workflows/intel.yml
+56 −0 CHANGES
+1 −3 Docs/Readme.sphinx
+2 −2 Src/Base/AMReX_COORDSYS_2D_C.H
+3 −3 Src/Base/AMReX_ParallelDescriptor.H
+27 −11 Src/Base/AMReX_TableData.H
+179 −0 Src/EB/AMReX_EBData.H
+3 −0 Src/EB/AMReX_EBDataCollection.H
+5 −0 Src/EB/AMReX_EBFabFactory.H
+84 −1 Src/EB/AMReX_EBFabFactory.cpp
+1 −0 Src/EB/CMakeLists.txt
+2 −0 Src/EB/Make.package
+5 −5 Src/FFT/AMReX_FFT_OpenBCSolver.H
+109 −54 Src/FFT/AMReX_FFT_Poisson.H
+0 −1 Src/FFT/AMReX_FFT_R2C.H
+58 −0 Src/LinearSolvers/AMReX_AlgPartition.H
+102 −0 Src/LinearSolvers/AMReX_AlgPartition.cpp
+453 −0 Src/LinearSolvers/AMReX_AlgVector.H
+9 −0 Src/LinearSolvers/AMReX_Algebra.H
+3 −2 Src/LinearSolvers/AMReX_GMRES.H
+160 −0 Src/LinearSolvers/AMReX_GMRES_MV.H
+46 −0 Src/LinearSolvers/AMReX_Smoother_MV.H
+192 −0 Src/LinearSolvers/AMReX_SpMV.H
+645 −0 Src/LinearSolvers/AMReX_SpMatrix.H
+8 −0 Src/LinearSolvers/CMakeLists.txt
+7 −1 Src/LinearSolvers/MLMG/AMReX_MLCurlCurl.H
+83 −2 Src/LinearSolvers/MLMG/AMReX_MLCurlCurl.cpp
+138 −14 Src/LinearSolvers/MLMG/AMReX_MLCurlCurl_K.H
+29 −30 Src/LinearSolvers/MLMG/AMReX_MLEBABecLap_2D_K.H
+56 −47 Src/LinearSolvers/MLMG/AMReX_MLEBABecLap_3D_K.H
+3 −21 Src/LinearSolvers/MLMG/AMReX_MLEBABecLap_F.cpp
+0 −2 Src/LinearSolvers/MLMG/Make.package
+11 −0 Src/LinearSolvers/Make.package
+13 −5 Src/Particle/AMReX_ParticleCommunication.H
+29 −12 Src/Particle/AMReX_ParticleCommunication.cpp
+9 −0 Tests/Algebra/GMRES/CMakeLists.txt
+17 −0 Tests/Algebra/GMRES/GNUmakefile
+1 −0 Tests/Algebra/GMRES/Make.package
+119 −0 Tests/Algebra/GMRES/main.cpp
+1 −1 Tests/CMakeLists.txt
+1 −1 Tests/LinearSolvers/CurlCurl/MyTest.cpp
+30 −7 Tests/LinearSolvers/CurlCurl/initProb_K.H
+18 −5 Tools/CMake/AMReXParallelBackends.cmake
+1 −1 Tools/GNUMake/Make.defs
+2 −8 Tools/GNUMake/comps/hip.mak

0 comments on commit 9bd2d0f

Please sign in to comment.