Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c632a54
add distributed models test
taimoorsohail Oct 13, 2025
dd98f29
temporarily deactivate distr utils tests
taimoorsohail Oct 13, 2025
8c88093
Update test/test_distributed_models.jl
navidcy Oct 13, 2025
4c1c696
Uncomment inclusion of test_distributed_utils.jl
navidcy Oct 13, 2025
18a7c75
Refactor simulation stop time calculation
navidcy Oct 13, 2025
03e24b9
Refactor time step variable for ocean simulation
navidcy Oct 13, 2025
0b7b672
Refactor function definition for clarity
navidcy Oct 13, 2025
994f7b6
split distributed ci
navidcy Oct 14, 2025
53fa1f1
fix pipeline
navidcy Oct 14, 2025
0df5d2f
give slurm_gpus: 2 to distributed_models
navidcy Oct 15, 2025
5b77cae
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
simone-silvestri Oct 15, 2025
bd40a2b
Update resource allocation in pipeline configuration
simone-silvestri Oct 15, 2025
e8962c7
Update Oceananigans version to 0.100.5
navidcy Oct 15, 2025
1a297a5
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
simone-silvestri Oct 24, 2025
fa8f5ff
Update memory allocation to 100G for tests
simone-silvestri Oct 27, 2025
a635556
Update archs list to include only CPU architecture
simone-silvestri Oct 27, 2025
1f08691
Apply suggestion from @simone-silvestri
simone-silvestri Oct 28, 2025
b4d7ac7
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
navidcy Nov 18, 2025
db7d029
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
navidcy Dec 7, 2025
2da81e9
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
navidcy Dec 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,27 @@ steps:
slurm_ntasks: 1
slurm_gpus_per_task: 1

- label: "Run distributed tests"
key: "test_distributed"
- label: "Run distributed utils tests"
key: "test_distributed_utils"
env:
TEST_GROUP: "distributed"
TEST_GROUP: "distributed_utils"
commands:
- "srun julia --project -e 'using Pkg; Pkg.test()'"
agents:
slurm_mem: 10G
slurm_cpus_per_task: 1
slurm_ntasks: 4

- label: "Run distributed models tests"
key: "test_distributed_models"
env:
TEST_GROUP: "distributed_models"
commands:
- "srun julia --project -e 'using Pkg; Pkg.test()'"
agents:
slurm_mem: 100G # Why would we need so much memory?
slurm_gpus_per_task: 1
slurm_ntasks: 4

- wait: ~
continue_on_failure: true
6 changes: 5 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,14 @@ if test_group == :ocean_sea_ice_model || test_group == :all
include("test_diagnostics.jl")
end

if test_group == :distributed || test_group == :all
if test_group == :distributed_utils || test_group == :all
include("test_distributed_utils.jl")
end

if test_group == :distributed_models || test_group == :all
include("test_distributed_models.jl")
end

if test_group == :reactant || test_group == :all
include("test_reactant.jl")
end
Expand Down
67 changes: 67 additions & 0 deletions test/test_distributed_models.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
include("runtests_setup.jl")

using MPI

MPI.Init()
atexit(MPI.Finalize)

using Oceananigans.Units
using Oceananigans.DistributedComputations
using Oceananigans.Architectures: on_architecture
using Dates

# TODO: add a distributed GPU architecture to the list of archs... Requires making sure CUDA-aware MPI is enabled
archs = [Distributed(CPU(); partition = Partition(y = DistributedComputations.Equal()), synchronized_communication=true)]

# archs = [Distributed(CPU(); partition = Partition(y = DistributedComputations.Equal()), synchronized_communication=true),
# Distributed(GPU(); partition = Partition(y = DistributedComputations.Equal()), synchronized_communication=true)]

function analytical_immersed_tripolar_grid(underlying_grid::TripolarGrid;
radius = 5, # degrees
active_cells_map = false)

λp = underlying_grid.conformal_mapping.first_pole_longitude
φp = underlying_grid.conformal_mapping.north_poles_latitude
φm = underlying_grid.conformal_mapping.southernmost_latitude

Lz = underlying_grid.Lz

# We need a bottom height field that ``masks'' the singularities
bottom_height(λ, φ) = ((abs(λ - λp) < radius) & (abs(φp - φ) < radius)) |
((abs(λ - λp - 180) < radius) & (abs(φp - φ) < radius)) | (φ < φm) ? 0 : - Lz

grid = ImmersedBoundaryGrid(underlying_grid, GridFittedBottom(bottom_height); active_cells_map)

return grid
end

@testset "Distributed Models" begin
for arch in archs
@info "Testing on architecture: $arch"

Nx, Ny, Nz = 100, 100, 30
underlying_grid = TripolarGrid(arch; size = (Nx, Ny, Nz), z = (-6000, 0), halo = (7, 7, 4))
grid = analytical_immersed_tripolar_grid(underlying_grid; active_cells_map=true)
free_surface = SplitExplicitFreeSurface(grid; cfl=0.7, fixed_Δt=10minutes)

Δt = 10

ocean = ocean_simulation(grid; Δt, free_surface, timestepper = :SplitRungeKutta3)
sea_ice = sea_ice_simulation(grid, ocean; advection=WENO(order=7))

set!(sea_ice.model, h=Metadatum(:sea_ice_thickness; dataset=ECCO4Monthly()),
ℵ=Metadatum(:sea_ice_concentration; dataset=ECCO4Monthly()))

radiation = Radiation(arch)
atmosphere = JRA55PrescribedAtmosphere(arch; backend=JRA55NetCDFBackend(5))

coupled_model = OceanSeaIceModel(ocean, sea_ice; atmosphere, radiation)

stop_iteration = 5
simulation = Simulation(coupled_model; Δt, verbose=false, stop_time=stop_iteration * Δt)

run!(simulation)

@test coupled_model.clock.iteration == stop_iteration
end
end
Loading