Skip to content

Commit 38ffafd

Browse files
committed
Allow remapper to take multiple Fields
This PR increases the rank of some internal arrays of the remapper by 1. The new dimension is to allow the remapper to process multiple Fields at the same time. The idea is the following: when creating a Remapper, one can specify a buffer_length. When the buffer_length is larger than one, the Remapper will preallocate space to be able to interpolate buffer_length at the same time. Then, when `interpolate` is called, the Remapper can work with any number of Fields and the work is divided in batches of buffer_length size. E.g, If buffer_length is 10 and 22 fields are to be interpolated, the work is processed in groups of 10+10+2. The only cost of choosing a large buffer_length is memory (there shouldn't be any runtime penalty in interpolating 1 field with a batch_length of 100). The memory cost of a Remapper is order (B, H, V), where B is the buffer length, H is the number of horizontal points, and V the number of vertical points. For H = 180x90 and V = 50, this means that each buffer costs 51_840_000 bytes (50 MB) for double precision on the root process + 50 MB / N_tasks on each task + base cost that is independent of B.
1 parent 79039d4 commit 38ffafd

File tree

4 files changed

+825
-223
lines changed

4 files changed

+825
-223
lines changed

.buildkite/pipeline.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,30 +243,38 @@ steps:
243243
agents:
244244
slurm_ntasks: 4
245245

246-
- label: "Unit: distributed remapping"
247-
key: distributed_remapping
246+
- label: "Unit: distributed remapping (1 process)"
247+
key: distributed_remapping_1proc
248+
command: "julia --color=yes --check-bounds=yes --project=test test/Remapping/distributed_remapping.jl"
249+
env:
250+
CLIMACOMMS_DEVICE: "CPU"
251+
252+
- label: "Unit: distributed remapping (2 processes)"
253+
key: distributed_remapping_2procs
248254
command: "srun julia --color=yes --check-bounds=yes --project=test test/Remapping/distributed_remapping.jl"
249255
env:
250256
CLIMACOMMS_CONTEXT: "MPI"
251257
CLIMACOMMS_DEVICE: "CPU"
252258
agents:
253259
slurm_ntasks: 2
254260

255-
- label: "Unit: distributed remapping (1 process)"
256-
key: distributed_remapping_1proc
261+
- label: "Unit: distributed remapping with CUDA (1 process)"
262+
key: distributed_remapping_gpu_1proc
257263
command: "julia --color=yes --check-bounds=yes --project=test test/Remapping/distributed_remapping.jl"
258264
env:
259-
CLIMACOMMS_DEVICE: "CPU"
265+
CLIMACOMMS_DEVICE: "CUDA"
266+
agents:
267+
slurm_gpus: 1
260268

261-
- label: "Unit: distributed remapping with CUDA"
262-
key: distributed_remapping_gpu
269+
- label: "Unit: distributed remapping with CUDA (2 processes)"
270+
key: distributed_remapping_gpu_2procs
263271
command: "srun julia --color=yes --check-bounds=yes --project=test test/Remapping/distributed_remapping.jl"
264272
env:
265273
CLIMACOMMS_CONTEXT: "MPI"
266274
CLIMACOMMS_DEVICE: "CUDA"
267275
agents:
268276
slurm_ntasks: 2
269-
slurm_gpus: 1
277+
slurm_gpus_per_task: 1
270278

271279
- label: "Unit: distributed gather"
272280
key: unit_distributed_gather4

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ ClimaCore.jl Release Notes
44
main
55
-------
66

7+
- ![][badge-🤖precisionΔ] `Remapper`s can now process multiple `Field`s at the same time if created with some `buffer_lenght > 1`.
8+
PR ([#1669](https://github.com/CliMA/ClimaCore.jl/pull/1669)) Machine-precision differences are expected.
9+
710
v0.13.4
811
-------
912

0 commit comments

Comments
 (0)