-
Notifications
You must be signed in to change notification settings - Fork 21
OceanSeaIceModel Distributed tests #662
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
Open
taimoorsohail
wants to merge
14
commits into
main
Choose a base branch
from
ts-ncc/sea-ice-distributed-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c632a54
add distributed models test
taimoorsohail dd98f29
temporarily deactivate distr utils tests
taimoorsohail 8c88093
Update test/test_distributed_models.jl
navidcy 4c1c696
Uncomment inclusion of test_distributed_utils.jl
navidcy 18a7c75
Refactor simulation stop time calculation
navidcy 03e24b9
Refactor time step variable for ocean simulation
navidcy 0b7b672
Refactor function definition for clarity
navidcy 994f7b6
split distributed ci
navidcy 53fa1f1
fix pipeline
navidcy 0df5d2f
give slurm_gpus: 2 to distributed_models
navidcy 5b77cae
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
simone-silvestri bd40a2b
Update resource allocation in pipeline configuration
simone-silvestri e8962c7
Update Oceananigans version to 0.100.5
navidcy 1a297a5
Merge branch 'main' into ts-ncc/sea-ice-distributed-test
simone-silvestri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| include("runtests_setup.jl") | ||
|
|
||
| using MPI | ||
|
|
||
| MPI.Init() | ||
| atexit(MPI.Finalize) | ||
|
|
||
| using Oceananigans.Units | ||
| using Oceananigans.DistributedComputations | ||
| using Oceananigans.Architectures: on_architecture | ||
| using Dates | ||
| using ClimaSeaIce | ||
| using ClimaSeaIce.SeaIceThermodynamics: IceWaterThermalEquilibrium | ||
|
|
||
| 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 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.