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
Copy file name to clipboardExpand all lines: tests/test_petsc.py
+12-29Lines changed: 12 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -2213,25 +2213,24 @@ def test_petsc_pi(self):
2213
2213
classTestPetscSection:
2214
2214
"""
2215
2215
These tests validate the use of `PetscSection` (from PETSc) to constrain essential
2216
-
boundary nodes by removing them from the linear solver, rather than leaving them in
2216
+
boundary nodes by removing them from the linear solver, rather than keeping them in
2217
2217
the system as trivial equations.
2218
2218
2219
2219
Users specify essential boundary conditions via the `EssentialBC` equation, with a specifed `SubDomain`.
2220
2220
When `constrain_bcs=True` is passed to `petscsolve`, the Devito compiler generates code that
2221
-
removes these degrees of freedom from the linear system. A requirement for this in PETSc is
2222
-
that each MPI rank identifies ALL constrained nodes that lie within its local data region, including
2221
+
removes these degrees of freedom from the linear system. A PETSc requirement is
2222
+
that each MPI rank identifies ALL constrained nodes within its local data region, including
2223
2223
non-owned (halo) nodes.
2224
2224
2225
2225
To achieve this, the compiler creates new `EssentialBC`-like equations with modified (sub)dimensions
2226
-
(to extend the loop bounds) that are utilised in two callback functions to constrain the nodes.
2227
-
No non-owned (haloed) data is indexed into - the loops are purely used to specify the constrained "local" indices
2228
-
on each rank.
2226
+
(to extend the loop bounds), which are used in two callback functions to constrain the nodes.
2227
+
No non-owned (halo) data is indexed into - the loops are only used to specify the constrained "local"
2228
+
indices on each rank.
2229
2229
2230
2230
Tests in this class use the following notation:
2231
2231
- `x` : a grid point
2232
2232
- `[]` : the `SubDomain` specified by the `EssentialBC` (the region being constrained)
2233
2233
- `|` : an MPI rank boundary
2234
-
2235
2234
"""
2236
2235
# first test that the loop generated is correct symbolically..
2237
2236
@@ -2272,10 +2271,7 @@ def _get_loop_bounds(self, shape, so, subdomain):
2272
2271
@pytest.mark.parallel(mode=[1, 2, 4])
2273
2272
deftest_1_constrain_indices_1d(self, mode):
2274
2273
# halo size 2
2275
-
# 12 grid points in 1D with a subdomain spanning the region contained inside the brackets [], x represents a grid point, | represents the decomposition
2276
-
# {rank: (min, max)} represents the loop bounds to constrain indices (locally) corresponding to the subdomain on this particular rank
2277
-
# IMPROVE WORDING
2278
-
# In petsc, when constraining indices, you constrain local (haloed) indices - INCLUDING NON OWNED INDICES
# subdomain on the right side of the grid not left
2521
2516
# halo size 2
2522
-
# 24 grid points in 1D with a subdomain spanning the region contained inside the brackets [], x represents a grid point, | represents the decomposition
2523
-
# {rank: (min, max)} represents the loop bounds to constrain indices (locally) corresponding to the subdomain on this particular rank
2524
-
# IMPROVE WORDING
2525
-
# In petsc, when constraining indices, you constrain local (haloed) indices - INCLUDING NON OWNED INDICES
# subdomain on the right side of the grid not left
2624
2616
# halo size 4
2625
2617
# same as test 4 but halo size 4 (so don't test 8 ranks)
2626
-
# 24 grid points in 1D with a subdomain spanning the region contained inside the brackets [], x represents a grid point, | represents the decomposition
2627
-
# {rank: (min, max)} represents the loop bounds to constrain indices (locally) corresponding to the subdomain on this particular rank
2628
-
# IMPROVE WORDING
2629
-
# In petsc, when constraining indices, you constrain local (haloed) indices - INCLUDING NON OWNED INDICES
# 24 grid points in 1D with a subdomain spanning the region contained inside the brackets [], x represents a grid point, | represents the decomposition
2713
-
# {rank: (min, max)} represents the loop bounds to constrain indices (locally) corresponding to the subdomain on this particular rank
2714
-
# IMPROVE WORDING
2715
-
# In petsc, when constraining indices, you constrain local (haloed) indices - INCLUDING NON OWNED INDICES
# 24 grid points in 1D with a subdomain spanning the region contained inside the brackets [], x represents a grid point, | represents the decomposition
2815
-
# {rank: (min, max)} represents the loop bounds to constrain indices (locally) corresponding to the subdomain on this particular rank
2816
-
# IMPROVE WORDING
2817
-
# In petsc, when constraining indices, you constrain local (haloed) indices - INCLUDING NON OWNED INDICES
0 commit comments