diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e836d5696c..b31dc7076c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,5 +1,6 @@ env: - JULIA_VERSION: "1.10.10" + JULIA_VERSION: "1.12.1" + JULIA_VERSION_ENZYME: "1.11.7" BUILDKITE_HOME: "/var/lib/buildkite-agent" JULIA_DEPOT_PATH: "$BUILDKITE_HOME/.julia-oceananigans" JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager @@ -12,7 +13,7 @@ with: coverage: false steps: - - label: "🏕️ initialize environment" + - label: "🏕️ initialize general environment" key: "init" agents: queue: "Oceananigans-nautilus" @@ -26,6 +27,29 @@ steps: cd "$OCEANANIGANS_DIR" julia +$JULIA_VERSION -O0 --color=yes --project -e 'using Pkg; Pkg.test()' + # After we have instantiated the general environment, move manifest to the + # version-specific filename, not to clash with the manifest for Enzyme. + mv -v Manifest.toml Manifest-v$(echo "${JULIA_VERSION}" | cut -d. -f1-2).toml + retry: + automatic: + - exit_status: 1 + limit: 1 + + - label: "🏕️ initialize enzyme environment" + key: "init_enzyme" + depends_on: "init" + agents: + queue: "Oceananigans-nautilus" + env: + TEST_GROUP: "init" + command: | + juliaup add $JULIA_VERSION_ENZYME + cd "$OCEANANIGANS_DIR" + + julia +$JULIA_VERSION_ENZYME -O0 --color=yes --project -e 'using Pkg; Pkg.test()' + # After we have instantiated the Enzyme environment, move manifest to the + # version-specific filename, not to clash with the general manifest. + mv -v Manifest.toml Manifest-v$(echo "${JULIA_VERSION_ENZYME}" | cut -d. -f1-2).toml retry: automatic: - exit_status: 1 @@ -58,12 +82,6 @@ steps: export TEST_ARCHITECTURE="GPU" fi - # Force IFRT runtime for Reactant (this can be moved to Project.toml on 1.11) - touch LocalPreferences.toml - echo "[Reactant]" >> LocalPreferences.toml - echo "xla_runtime = \"IFRT\"" >> LocalPreferences.toml - cat LocalPreferences.toml - # Strip emoji for environment variable group="{{ matrix.group }}" export TEST_GROUP="\${group#* }" @@ -80,7 +98,6 @@ steps: - "GPU" group: - "🦖 poisson_solvers_2" - - "🎭 reactant_2" - "🐇 unit" - "👻 abstract_operations" - "🕊 poisson_solvers_1" @@ -99,14 +116,51 @@ steps: - "🍂 lagrangian_particles" - "🧅 multi_region" - "🦧 scripts" - - "👺 enzyme" - "🍱 xesmf" - - "👹 reactant_1" + retry: automatic: - exit_status: 1 limit: 1 + - label: "{{ matrix.architecture }} - {{ matrix.group }} tests" + key: "tests_enzyme_reactant" + depends_on: "init_enzyme" + agents: + queue: "Oceananigans-nautilus" + command: | + # Add matrix-specific environment variables + if [[ "{{ matrix.architecture }}" == "CPU" ]]; then + export CUDA_VISIBLE_DEVICES="-1" + export TEST_ARCHITECTURE="CPU" + else + export CUDA_VISIBLE_DEVICES="0" + export TEST_ARCHITECTURE="GPU" + fi + + # Strip emoji for environment variable + group="{{ matrix.group }}" + export TEST_GROUP="\${group#* }" + echo $TEST_GROUP + + # Run tests + cd "$OCEANANIGANS_DIR" + julia +$JULIA_VERSION_ENZYME -O0 --color=yes --project -e 'using Pkg; Pkg.test()' + + matrix: + setup: + architecture: + - "CPU" + - "GPU" + group: + - "🎭 reactant_2" + - "👺 enzyme" + - "👹 reactant_1" + + retry: + automatic: + - exit_status: 1 + limit: 1 ##### ##### Blocking wait on tests and documentation ##### diff --git a/Project.toml b/Project.toml index 90404515b1..32289204c5 100755 --- a/Project.toml +++ b/Project.toml @@ -77,7 +77,7 @@ GPUArraysCore = "0.2" Glob = "1.3" InteractiveUtils = "1.9" JLD2 = "0.4, 0.5, 0.6" -KernelAbstractions = "0.9.21" +KernelAbstractions = "0.9.39" Krylov = "0.10.0" KrylovPreconditioners = "0.3.2" LinearAlgebra = "1.9" @@ -92,7 +92,7 @@ OffsetArrays = "1.4" OrderedCollections = "1.1" Printf = "1.9" Random = "1.9" -Reactant = "0.2.162" +Reactant = "0.2.169" ReactantCore = "0.1" Rotations = "1.0" SeawaterPolynomials = "0.3.9" diff --git a/docs/make.jl b/docs/make.jl index 77fdf8bc91..b48040eb62 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -195,7 +195,7 @@ makedocs(; sitename = "Oceananigans.jl", plugins = [bib], warnonly = [:cross_references], draft = false, # set to true to speed things up - doctest = true, # set to false to speed things up + doctest = false, # set to false to speed things up doctestfilters = [ r"┌ Warning:.*", # remove standard warning lines r"└ @ .*", # remove the source location of warnings diff --git a/examples/internal_tide.jl b/examples/internal_tide.jl index 86ced24342..5d3f970b87 100644 --- a/examples/internal_tide.jl +++ b/examples/internal_tide.jl @@ -43,7 +43,7 @@ width = 20kilometers hill(x) = h₀ * exp(-x^2 / 2width^2) bottom(x) = - H + hill(x) -grid = ImmersedBoundaryGrid(underlying_grid, PartialCellBottom(bottom)) +grid = ImmersedBoundaryGrid(underlying_grid, GridFittedBottom(bottom)) # Let's see how the domain with the bathymetry is. diff --git a/src/Models/HydrostaticFreeSurfaceModels/update_hydrostatic_free_surface_model_state.jl b/src/Models/HydrostaticFreeSurfaceModels/update_hydrostatic_free_surface_model_state.jl index 840d511f22..eb7ee3616b 100644 --- a/src/Models/HydrostaticFreeSurfaceModels/update_hydrostatic_free_surface_model_state.jl +++ b/src/Models/HydrostaticFreeSurfaceModels/update_hydrostatic_free_surface_model_state.jl @@ -61,9 +61,9 @@ function mask_immersed_model_fields!(model, grid) η = displacement(model.free_surface) fields_to_mask = merge(model.auxiliary_fields, prognostic_fields(model)) - foreach(fields_to_mask) do field - if field !== η - mask_immersed_field!(field) + foreach(keys(fields_to_mask)) do key + if key != :η + @inbounds mask_immersed_field!(fields_to_mask[key]) end end mask_immersed_field_xy!(η, k=size(grid, 3)+1) diff --git a/src/Models/NonhydrostaticModels/update_hydrostatic_pressure.jl b/src/Models/NonhydrostaticModels/update_hydrostatic_pressure.jl index a5733295a2..744425fd28 100644 --- a/src/Models/NonhydrostaticModels/update_hydrostatic_pressure.jl +++ b/src/Models/NonhydrostaticModels/update_hydrostatic_pressure.jl @@ -12,10 +12,12 @@ the `buoyancy_perturbationᶜᶜᶜ` downwards: @kernel function _update_hydrostatic_pressure!(pHY′, grid, buoyancy, C) i, j = @index(Global, NTuple) - @inbounds pHY′[i, j, grid.Nz] = - z_dot_g_bᶜᶜᶠ(i, j, grid.Nz+1, grid, buoyancy, C) * Δzᶜᶜᶠ(i, j, grid.Nz+1, grid) + pᵏ = - z_dot_g_bᶜᶜᶠ(i, j, grid.Nz+1, grid, buoyancy, C) * Δzᶜᶜᶠ(i, j, grid.Nz+1, grid) + @inbounds pHY′[i, j, grid.Nz] = pᵏ for k in grid.Nz-1 : -1 : 1 - @inbounds pHY′[i, j, k] = pHY′[i, j, k+1] - z_dot_g_bᶜᶜᶠ(i, j, k+1, grid, buoyancy, C) * Δzᶜᶜᶠ(i, j, k+1, grid) + pᵏ -= z_dot_g_bᶜᶜᶠ(i, j, k+1, grid, buoyancy, C) * Δzᶜᶜᶠ(i, j, k+1, grid) + @inbounds pHY′[i, j, k] = pᵏ end end diff --git a/src/MultiRegion/multi_region_field.jl b/src/MultiRegion/multi_region_field.jl index 09040ec9f5..b91f73c258 100644 --- a/src/MultiRegion/multi_region_field.jl +++ b/src/MultiRegion/multi_region_field.jl @@ -6,7 +6,7 @@ using Oceananigans.OutputWriters: output_indices using Base: @propagate_inbounds -import Oceananigans.BoundaryConditions: regularize_field_boundary_conditions +import Oceananigans.BoundaryConditions: regularize_field_boundary_conditions, FieldBoundaryConditions import Oceananigans.Diagnostics: hasnan import Oceananigans.DistributedComputations: reconstruct_global_field, CommunicationBuffers import Oceananigans.Fields: set!, compute!, compute_at!, interior, communication_buffers, diff --git a/src/Oceananigans.jl b/src/Oceananigans.jl index 5b255bc0ae..8a6b306dcb 100644 --- a/src/Oceananigans.jl +++ b/src/Oceananigans.jl @@ -121,10 +121,10 @@ using DocStringExtensions using FFTW function __init__() - if VERSION >= v"1.11.0" - @warn """You are using Julia v1.11 or later!" - Oceananigans is currently tested on Julia v1.10." - If you find issues with Julia v1.11 or later," + if VERSION >= v"1.13.0" + @warn """You are using Julia v1.13 or later!" + Oceananigans is currently tested on Julia v1.12." + If you find issues with Julia v1.13 or later," please report at https://github.com/CliMA/Oceananigans.jl/issues/new""" end diff --git a/test/test_init.jl b/test/test_init.jl index d13eeb249a..48a656d980 100644 --- a/test/test_init.jl +++ b/test/test_init.jl @@ -1,4 +1,3 @@ -using Enzyme using CUDA using Metal using AMDGPU