@@ -7,7 +7,7 @@ using MPI
7
7
# These tests are meant to be run on 4 ranks. This script may be run
8
8
# stand-alone (outside the test environment) via
9
9
#
10
- # mpiexec -n 4 julia --project test_distributed_models .jl
10
+ # $ MPI_TEST=true mpiexec -n 4 julia --project test_distributed_hydrostatic_model .jl
11
11
#
12
12
# provided that a few packages (like TimesDates.jl) are in your global environment.
13
13
#
@@ -17,14 +17,10 @@ using MPI
17
17
#
18
18
# then later:
19
19
#
20
- # julia> include("test_distributed_models.jl")
21
- #
22
- # When running the tests this way, uncomment the following line
20
+ # julia> include("test_distributed_hydrostatic_model.jl")
23
21
24
22
MPI. Initialized () || MPI. Init ()
25
23
26
- # to initialize MPI.
27
-
28
24
using Oceananigans. Operators: hack_cosd
29
25
using Oceananigans. DistributedComputations: ranks, partition, all_reduce, cpu_architecture, reconstruct_global_grid, synchronized
30
26
using Oceananigans. TurbulenceClosures. TKEBasedVerticalDiffusivities: CATKEVerticalDiffusivity
@@ -86,7 +82,7 @@ Nx = 32
86
82
Ny = 32
87
83
88
84
for arch in archs
89
-
85
+
90
86
# We do not test on `Fractional` partitions where we cannot easily ensure that H ≤ N
91
87
# which would lead to different advection schemes for partitioned and non-partitioned grids.
92
88
# `Fractional` is, however, tested in regression tests where the horizontal dimensions are larger.
@@ -96,23 +92,25 @@ for arch in archs
96
92
97
93
if valid_x_partition & valid_y_partition & valid_z_partition
98
94
@testset " Testing distributed solid body rotation" begin
99
- underlying_grid = LatitudeLongitudeGrid (arch, size = (Nx, Ny, 3 ),
95
+ underlying_grid = LatitudeLongitudeGrid (arch,
96
+ size = (Nx, Ny, 3 ),
100
97
halo = (4 , 4 , 3 ),
101
98
latitude = (- 80 , 80 ),
102
99
longitude = (- 160 , 160 ),
103
100
z = (- 1 , 0 ),
104
101
radius = 1 ,
105
- topology= (Bounded, Bounded, Bounded))
102
+ topology = (Bounded, Bounded, Bounded))
106
103
107
104
bottom (λ, φ) = - 30 < λ < 30 && - 40 < φ < 20 ? 0 : - 1
108
105
109
106
immersed_grid = ImmersedBoundaryGrid (underlying_grid, GridFittedBottom (bottom))
110
- immersed_active_grid = ImmersedBoundaryGrid (underlying_grid, GridFittedBottom (bottom); active_cells_map = true )
107
+ immersed_active_grid = ImmersedBoundaryGrid (underlying_grid, GridFittedBottom (bottom); active_cells_map= true )
111
108
112
109
global_underlying_grid = reconstruct_global_grid (underlying_grid)
113
110
global_immersed_grid = ImmersedBoundaryGrid (global_underlying_grid, GridFittedBottom (bottom))
114
111
115
- for (grid, global_grid) in zip ((underlying_grid, immersed_grid, immersed_active_grid), (global_underlying_grid, global_immersed_grid, global_immersed_grid))
112
+ for (grid, global_grid) in zip ((underlying_grid, immersed_grid, immersed_active_grid),
113
+ (global_underlying_grid, global_immersed_grid, global_immersed_grid))
116
114
if arch. local_rank == 0
117
115
@info " Testing distributed solid body rotation with $(ranks (arch)) ranks on $(typeof (grid). name. wrapper) "
118
116
end
@@ -190,3 +188,4 @@ for arch in archs
190
188
end
191
189
end
192
190
end
191
+
0 commit comments