[Trilinos-Users] [EXTERNAL] Trilinos-Users Digest, Vol 166, Issue 1

Hoemmen, Mark mhoemme at sandia.gov
Tue Dec 3 12:24:34 MST 2019

Greetings --

It sounds like you're a bit confused about how Tpetra's sparse matrices work.  It's perfectly valid for a matrix to have no stored ("nonzero") entries in a row.  You can have a row Map that has 10 global rows, for example, even if the matrix has no nonzero entries at all.  It's also valid to have a column Map with (say) 10 global rows in this case.

Thus, it makes no sense to talk about a Map with indices in it, in which no MPI process has that index.  (I am deliberately avoiding the word "owns," since it confuses finite-element mesh experts.  Distributed finite-element meshes talk about "owned" degrees of freedom and "shared" degrees of freedom.  Tpetra::Map does not distinguish "owns" and "shares."  If an index is in a Map somewhere, then one or more MPI processes in the Map's MPI communicator "have" that index.  If multiple processes "have" the index, then Tpetra does NOT specify a "boss" or "owning" process for that index.  The Export or Import process is Tpetra's way of letting users specify an "owning" process.)

To repeat: There is no such thing as a Map with an index that no process "owns."  Such a Map cannot exist.

The indexBase must equal the smallest global index, globally (over all MPI processes in the Map's communicator).   Otherwise, don't worry about it; it practically has no effect.

Mark Hoemmen

On 12/3/19, 12:00 PM, "Trilinos-Users on behalf of trilinos-users-request at trilinos.org" <trilinos-users-bounces at trilinos.org on behalf of trilinos-users-request at trilinos.org> wrote:
    Message: 1
    Date: Fri, 22 Nov 2019 10:52:57 -0500
    From: Wen Yan <wenyan4work at gmail.com>
    To: trilinos-users at trilinos.org
    Subject: [Trilinos-Users] question about an arbitrary Tpetra::map
    	<CAPd-e8jG9y=zaQwktXnNUHWCrSZ7zhNd5uhGLBQ7YVU9ySvnbg at mail.gmail.com>
    Content-Type: text/plain; charset="utf-8"
    Dear Trilinos users,
    Could you please help me understand this constructor of Tpetra::map?
    If I want to have a (row or column) map for a Tpetra::CrsMatrix, like this:
    Index:   [0, 1,  2,  3,  4,  5, 6, 7, 8,  9]
    Owner: [X, X, 0, 0/1, X, 1, X, X,1, 0/1]
    where the mathematical dimension is 10, indexbase=0, distributed on two
    ranks (0 and 1), and X means no rank owns this index, i.e., no entry in the
    sparse matrix.
    rank 0 owns indices 2,3,9
    rank 1 owns indices 3,5,8,9
    Question 1:
    Is it correct to construct this map with the following parameters?
    indexList = [2,3,9] on rank0, and [3,5,8,9] on rank1,
    indexListSize= 3 on rank0, and 4 on rank1.
    Question 2:
    I am particularly confused by the document of indexBase, which says: "
    Currently, Map
     requires that this equal the global minimum index over all processes'
    indexList inputs."
    Does this mean that index 0 must be owned by some rank, even if there is no
    entry for this index? Further, does this mean every globalIndex in a
    Tpetra::map must be owned by some rank?
    Thank you,
    *Wen Yan*

More information about the Trilinos-Users mailing list