#include "petscsa.h" PetscErrorCode SAMappingSetSizes(SAMapping map, PetscInt m, PetscInt n, PetscInt M, PetscInt N)Collective on SAMapping
map | - the mapping | |
m | - number of local domain indices (or PETSC_DETERMINE) | |
n | - number of local range columns (or PETSC_DETERMINE) | |
M | - number of global domain indices (or PETSC_DETERMINE or PETSC_IGNORE) | |
N | - number of global range indices (or PETSC_DETERMINE or PETSC_IGNORE) |
(P) Parallel layout for the domain demands that the local values of m on all ranks of the communicator add up to M (see more at MatSetSizes, for example). Thus, m and M must be specified in this compatible way. One way to ensure this is to specify m and leave M as PETSC_DETERMINE -- then M is computed by summing the local m across the ranks. The other option is to specify M (the same on all ranks, which will be checked) and leave m as PETSC_DETERMINE. In this case the local m is determined by dividing M as equally as possible among the ranks (m might end up being 0). If both m and M are specified, their compatibility is verified by summing the m across the ranks. If m or M are PETSC_DETERMINE on one rank, they must be PETSC_DETERMINE on all of the ranks, or the program might hang. Finally, both m and M cannot be PETSC_DETERMINE at once.
In any case, domain indices can have any value 0 <= i < M on every rank (with the same M). However, domain indices are split up among the ranks: each rank will "own" m indices with the indices owned by rank 0 numbered [0,m), followed by the indices on rank 1, and so on.
(S) Sequential layout for the domain makes it essentially into a disjoint union of local domains of local size m. This is signalled by specifying M as PETSC_IGNORE.
In this case, domain indices can have any value 0 <= i < m on every rank (with its own m).
When the domain is not laid out in parallel, no migration takes place and the mapping of indices is done purely locally.
Level:beginner
Location:src/dm/sa/interface/sa.c
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages