New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid some uses of Triangulation::user_flags #13853
Conversation
19d592b
to
5de9f8f
Compare
This is the sort of thing that makes me nervous just before a release, at least the parts that aren't in |
I agree, the interference with other PRs should be small enough to not have to look into it again, so let's postpone to 9.5. |
For the record, while creating the patch, the combination of hp and multigrid tests that I ran to verify did uncover three places where I had made a mistake, so we seem to indeed have covered most of these places reasonably well. |
5de9f8f
to
5354a95
Compare
For reference, this PR will have significant effect on our performance tests. The Regarding larger scales, we are significantly ahead already before this PR: On 64 nodes / 4608 MPI ranks, the |
5354a95
to
c7ba75e
Compare
c7ba75e
to
38c1c52
Compare
Avoid some uses of Triangulation::user_flags
While working on the internal restructuring of
DoFHandler
, and also when looking at performance profiles, I observed an annoyingly high number of calls toTriangulation::save_user_flags
andTriangulation::load_user_flags
. We used those in many places to store some information regarding the lines or faces of a triangulation we only want to visit once, e.g. during the enumeration of the DoFs. However, that comes with a lot of boilerplate, because we always need to save the user flags, do our thing, and restore them. Also from a performance point of view, these operations are not for free, becausestd::vector<bool>
has no single-instruction access function.This PR cleans up the uses outside the immediate grid constructions that should be safe: Keeping a separate vector with the flags communicates the intent much more clearly, and avoids going back and forth between a user's flags, thus reducing the time in those setup functions. A net of 270 reduced lines of code shows that this is a significant simplification. (OK, 20 lines or so are due to range-based for loops I changed on the way).
I tagged this with the 9.4 milestone because I want to get it done, but it is not an urgent PR.