Internals of IndexSet #63
-
I am wondering what the different mappings in PartitionedArrays.jl/src/IndexSets.jl Lines 215 to 223 in d5224f7 If I could get this clarified I will add some docs and/or comments in the code to clarify. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 1 reply
-
Hi @fredrikekre,
A given part only stores a portion of the global indices. In order to locally address the entities on the local part, these are assigned a local index. Each of the global entities is assigned a part owner among the parts on which it is present (recall from above that the partition may be overlapping, thus a given entity might be present in more than one part). Using the concept of part owner, we can classify the set of local entities into owned entities by the part (denoted with Each of the owned entities are labelled with a local index within the set of all owned entities, and the same applies for ghost entities. Finally, note that there is an optimized implementation of
Some distribution linear algebra libraries, such as PETSc, rely on this kind of partitions. Does all this make sense? |
Beta Was this translation helpful? Give feedback.
-
Thanks, then my understanding after experimenting a bit was roughly correct. I will try to add some documentation or comments in the code to make it easier for others. The most confusing things was "gid", which, if I understand correctly sometimes means "global id" and sometimes "ghost id". |
Beta Was this translation helpful? Give feedback.
-
That would be very helpful. Thanks!
"gid" should always mean "global id". Where does it mean "ghost id" ? |
Beta Was this translation helpful? Give feedback.
-
Global ids are "gids" and ghost ids are "hids". Local ids are "lids". We try to stick to this convention in all the package. If you find a notation mistake let us know! |
Beta Was this translation helpful? Give feedback.
-
Ah okay, I thought that |
Beta Was this translation helpful? Give feedback.
-
In I see your concern. Perhaps the function could be called |
Beta Was this translation helpful? Give feedback.
-
Yea okay, that makes sense, then I think the name is okay, but I will include that description in the docstring for clarity. |
Beta Was this translation helpful? Give feedback.
-
Although, the only modifications are the ghost id's, so there is not really any adding of global IDs
is a no-op, for example (except the |
Beta Was this translation helpful? Give feedback.
Hi @fredrikekre,
IndexSet
describes the (potentially overlapping) data distribution layout of a global set of indices in each of the parts on which this set is partitioned (note there are as manyIndexSet
instances as parts, one per part). Thepart
member variable represents the part corresponding to theIndexSet
. These indices can be used to label entities of distributed global data structures such as cells, degrees of freedom, etc.A given part only stores a portion of the global indices. In order to locally address the entities on the local part, these are assigned a local index.
lid_to_gid
stores the mapping among local and global indices. Note that theeltype
oflid_to_gid
is 64-bit …