Skip to content

Commit

Permalink
Allow remapper to take multiple Fields
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sbozzolo committed Apr 15, 2024
1 parent d352572 commit 0abfe23
Show file tree
Hide file tree
Showing 2 changed files with 811 additions and 223 deletions.
Loading

0 comments on commit 0abfe23

Please sign in to comment.