You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This supports halo-cell communications among pencils with arbitrary global sizes, as described by `opt_decomp`, the decomposition object. The last optional parameter `opt_global` is required (to be set to .true.) if global coordinate is used to define the pencils, i.e. the input array var is defined using the start/end variables rather than size variables. This ensures the coordinate systems used by `var` and `var_halo` are consistent.
17
+
This supports halo-cell communications among pencils with arbitrary global sizes, as described by
18
+
`opt_decomp`, the decomposition object.
19
+
The optional parameter `opt_global` is required (to be set to .true.) if global coordinate is used
20
+
to define the pencils, i.e. the input array var is defined using the start/end variables rather than
21
+
size variables.
22
+
This ensures the coordinate systems used by `var` and `var_halo` are consistent.
23
+
The optional parameter `opt_pencil` allows the user to specify which pencil they are operating in
24
+
(`1=X,2=Y,3=Z`), our recommendation is to do so, the current interface makes this parameter optional
25
+
to continue supporting the previous implementation which would try to determin the orientation
26
+
automatically, however this may not be reliable.
18
27
19
28
To demonstrate the use of this API, here is an example that computes spatial derivatives:
20
29
@@ -49,4 +58,58 @@ The extra parameter periodic_bc is a 1D array containing 3 logical values that s
49
58
50
59
Like the rest of 2DECOMP&FFT, the halo-cell support API is implemented in a black-box fashion. The library internally handles the communications between neighbouring blocks using standard MPI non-blocking point-to-point communications.
51
60
52
-
61
+
-----------------------
62
+
Halo-exchange interface
63
+
-----------------------
64
+
65
+
The high-level halo interface described above makes it easy to add halo support to existing codes.
66
+
However, by handling the memory allocation for you, it is difficult to adopt in a code that is
67
+
already written to handle its halos when porting to the 2DECOMP&FFT library.
68
+
As described above, the `update_halo` interface operates in two phases:
69
+
1) a new array, extended with halo entries is allocated
70
+
2) local data is copied into the local region of this array and used to communicate halo values to
71
+
neighbouring processes
72
+
73
+
To facilitate the use of 2DECOMP&FFT by existing stencil codes we have exposed the data exchange
74
+
(step 2) as a new interface `exchange_halo`.
75
+
There are two behaviours of the interface based on the optional parameters `opt_depth` and
0 commit comments