From 1da4e77e5c406d6901088135bfceeed7476b6e40 Mon Sep 17 00:00:00 2001 From: Gregory Wagner Date: Fri, 24 Jan 2025 07:36:24 -0500 Subject: [PATCH] Show how to distribute the super simple simulation --- oceananigans-dynamical-core/super_simple_simulation.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/oceananigans-dynamical-core/super_simple_simulation.jl b/oceananigans-dynamical-core/super_simple_simulation.jl index 839bc53..d45a569 100644 --- a/oceananigans-dynamical-core/super_simple_simulation.jl +++ b/oceananigans-dynamical-core/super_simple_simulation.jl @@ -7,16 +7,17 @@ Reactant.Ops.DEBUG_MODE[] = true ENV["JULIA_DEBUG"] = "Reactant_jll" @show Reactant_jll.cuDriverGetVersion(dlopen("libcuda.so")) -arch = GPU() # CPU() to run on CPU +# arch = CPU() +# arch = Distributed(GPU(), partition=Partition(2, 2)) # distributed on 4 GPUs +arch = GPU() Nx, Ny, Nz = (360, 120, 100) # number of cells grid = LatitudeLongitudeGrid(arch, size=(Nx, Ny, Nz), halo=(7, 7, 7), longitude=(0, 360), latitude=(-60, 60), z=(-1000, 0)) # One of the implest configurations we might consider: -model = HydrostaticFreeSurfaceModel(; grid, momentum_advection=WENO()) - -@assert model.free_surface isa SplitExplicitFreeSurface +free_surface = SplitExplicitFreeSurface(substeps=30) +model = HydrostaticFreeSurfaceModel(; grid, free_surface, momentum_advection=WENO()) uᵢ(x, y, z) = randn() set!(model, u=uᵢ, v=uᵢ)