@@ -5,68 +5,11 @@ MPI.Init()
55
66using NCDatasets
77using ClimaOcean. ECCO: download_dataset, metadata_path
8+ using Oceananigans. DistributedComputations
89using Oceananigans. DistributedComputations: reconstruct_global_grid
910using CFTime
1011using Dates
1112
12- @testset begin
13- rank = MPI. Comm_rank (MPI. COMM_WORLD)
14-
15- @onrank 0 begin
16- @test rank == 0
17- end
18-
19- @root begin
20- @test rank == 0
21- end
22-
23- @onrank 1 begin
24- @test rank == 1
25- end
26-
27- @onrank 2 begin
28- @test rank == 2
29- end
30-
31- @onrank 3 begin
32- @test rank == 3
33- end
34-
35- a = Int[]
36-
37- @distribute for i in 1 : 10
38- push! (a, i)
39- end
40-
41- @root begin
42- @test a == [1 , 5 , 9 ]
43- end
44-
45- @onrank 1 begin
46- @test a == [2 , 6 , 10 ]
47- end
48-
49- @onrank 2 begin
50- @test a == [3 , 7 ]
51- end
52-
53- @onrank 3 begin
54- @test a == [4 , 8 ]
55- end
56-
57-
58- split_comm = MPI. Comm_split (MPI. COMM_WORLD, rank % 2 , rank)
59-
60- a = Int[]
61-
62- @distribute split_comm for i in 1 : 10
63- push! (a, i)
64- end
65-
66- @onrank split_comm 0 @test a == [1 , 3 , 5 , 7 , 9 ]
67- @onrank split_comm 1 @test a == [2 , 4 , 6 , 8 , 10 ]
68- end
69-
7013@testset " Distributed ECCO download" begin
7114 dates = DateTimeProlepticGregorian (1992 , 1 , 1 ) : Month (1 ) : DateTimeProlepticGregorian (1994 , 4 , 1 )
7215 metadata = Metadata (:u_velocity ; dataset= ECCO4Monthly (), dates)
11558 z = (0 , 1 ))
11659
11760 global_height = regrid_bathymetry (global_grid;
118- dir = " ./" ,
119- filename = " trivial_bathymetry.nc" ,
120- interpolation_passes= 10 )
61+ dir = " ./" ,
62+ filename = " trivial_bathymetry.nc" ,
63+ interpolation_passes= 10 )
12164
12265 arch_x = Distributed (CPU (), partition= Partition (4 , 1 ))
12366 arch_y = Distributed (CPU (), partition= Partition (1 , 4 ))
0 commit comments