@@ -146,27 +146,33 @@ using the following call
146
146
call decomp_2d_init(nx, ny, nz, p_row, p_col)
147
147
148
148
where ``nx ``, ``ny `` and ``nz `` are the size of 3D global data to be distributed over
149
- a 2D processor grid :math: ` p_row \times p_col`.
149
+ a 2D processor grid `` p_row x p_col ` `.
150
150
Note that none of the dimensions need to be divisible by ``p_row `` or ``p_col ``, i.e. the library can handle non-evenly distributed data.
151
151
In case of ``p_row=p_col=0 `` an automatic decomposition is selected among all possible combination available.
152
152
The algorithm will choose the closest combination such as
153
153
154
- .. math ::
154
+ $$ n \_ {row} = n \_ {col} = {nproc}^{1/2} $$
155
155
156
- n\_proc=n\_col=\sqrt {nproc}
157
-
158
- In case the root is not exact the closest combitation to have :math: `n\_proc \approx n\_col` with
159
- `n\_proc < n\_col ` is used.
156
+ In case the root is not exact the closest combination to $n_{row} = n_{col}$ with $n_{row} < n_{col}$ is used.
157
+ If a 1D slab decomposition is needed instead of a 2D pencil one, it is recommended to set ``p_row `` to unity and ``p_col `` to ``nproc ``.
160
158
161
159
An optional parameter may be passed to this initialisation routine:
162
160
163
161
::
164
162
165
- call decomp_2d_init(nx, ny, nz, p_row, p_col,periodic_bc)
163
+ call decomp_2d_init(nx, ny, nz, p_row, p_col, periodic_bc)
166
164
167
- Here periodic_bc is a 1D array containing 3 logical values that specify whether periodic boundary condition
165
+ Here `` periodic_bc `` is a 1D array containing 3 logical values that specify whether periodic boundary condition
168
166
should apply in certain dimensions. Note this is only applicable if halo-cell communication is to be used.
169
167
168
+ Another optional parameter may be passed at the initialization stage:
169
+
170
+ ::
171
+
172
+ call decomp_2d_init(nx, ny, nz, p_row, p_col, periodic_bc, comm)
173
+
174
+ Here ``comm `` is the MPI communicator that the library will use. By default, MPI_COMM_WORLD is used.
175
+
170
176
A key element of this library is a set of communication routines that actually perform the data transpositions.
171
177
As mentioned, one needs to perform 4 global transpositions to go through all 3 pencil orientations.
172
178
Correspondingly, the library provides 4 communication subroutines:
@@ -227,7 +233,7 @@ different data sets as 2D pencils.
227
233
call decomp_info_init(n1, n2, n3, new_decomp)
228
234
229
235
Here decomp is an instance of Fortran derived data type DECOMP_INFO encapsulating
230
- the 2D decomposition information associated with one particular global size :math: `n 1 \times n2 \times n3 `.
236
+ the 2D decomposition information associated with one particular global size `` n1 x n2 x n3` `.
231
237
The decomposition object can be initialised using the ``decomp_info_init `` routine as:
232
238
233
239
::
0 commit comments