Updating to PartitionedArrays v0.5#157
Open
JordiManyer wants to merge 53 commits into
Open
Conversation
[Diff since v0.4.12](v0.4.12...v0.4.13) **Merged pull requests:** - Add Hcurl-projection test + fix BUG (#199) (@amartinhuertas)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #157 +/- ##
==========================================
- Coverage 84.72% 79.38% -5.34%
==========================================
Files 16 19 +3
Lines 4249 4255 +6
==========================================
- Hits 3600 3378 -222
- Misses 649 877 +228
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…One MPI process is spawned by testset
Closed
Member
Author
|
@amartinhuertas I think this starts being ready. There are still a couple things I want to do, but they are optional. All tests we have in master pass, I believe. So (no rush) I think it is time to start reviewing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have been detached from the development of PartitionedArrays for a while, currently stuck at v0.3. This is also related to #137 .
This PR is an update to PartitionedArrays v0.5, with a substantial rework of the re-assembly process... This comes with several upsides, such as
Change Log
FESpace free dof ids are now given by a permuted instance of
LocalIndicesWithVariableBlockSize. We were already doing this (so our numbering strategy does not change), but it's now explicit. This has two advantages:LocalIndicesWithVariableBlockSize.scanoperation). This is quite handy for assembly, since expanding the ghost ids in the index partition can be done using PArrays'sfind_ownerandunion_ghostmethods.With PA 0.5, new assembly strategies are available. Also, we've been wanting to fix the confusing names we currently have. We now have the following assembly strategies:
Assembled: We integrate on owned cells and collect contributions for owned and ghost row ids, then exchange ghost contributions and assemble. CurrentSubAssembledRows.SubAssembled: We integrate on owned cells and collect contributions for owned and ghost row ids, but no exchange. The resulting matrix is sub-assembled, i.e each local matrix contains the contribution for it's owned and ghost rows/cols resulting from integrating over the owned part of the domain.LocallyAssembled: This assumes all contributions can be found by integrating on the local portion of the domain. We integrate on local cells (owned and ghost), and keep contributions for owned row ids. No exchange is needed. CurrentFullyAssembledRows. Comes at your own risk.The indices in the matrices and vectors are now
LocalIndicesWithVariableBlockSize, so that the owner of a dof can be locally deduced by it's gid. This will save us some communication.To-Do
Assembled, but for which extra ghost rows are not allocated. This strategy will re-assemble using COO matrices (instead of directly inserting in the matrix). This can save binary searches, which can be quite costly. The re-assembly caches will be stored by the user (this will be an advanced api).SubAssembled()assembly strategy.Assembly cache reuse strategy
The most involved part of this PR is the assembly cache re-use. The issue is that so far we had been using the output
PSparseMatrixas the cache, by allocating extra ghost rows that were only used in the sub-assembly process. This has quite a lot of downsides (see #137), so we are pivoting towards an external assembly cache model.However, having external caches does not go well with the current Gridap API. Here is a possible solution:
assemble_matrix!will not be supported, except if anAssembleris provided (see next point).Assemblerwill hold the caches. To be able to reuse an assembler for multiple matrices, we will use aDictand the matrix object-id to hold multiple caches (tied to a single matrix each). Cache re-use will be activated by boolean variablereusethat is held by theAssembler.FEOperatorswill keep an instance of their assembler, allowing re-use by default for nonlinear and transientFEOperators.