Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show how to distribute the super simple simulation #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions oceananigans-dynamical-core/super_simple_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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ᵢ)
Expand Down