-
Notifications
You must be signed in to change notification settings - Fork 60
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
Improve timer output for the fluid applications #1187
Merged
Merged
Conversation
This file contains 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
lpsaavedra
changed the title
[WIP] Improve timer output for the lethe-fluid and lethe-fluid-matrix-free applications
[WIP] Improve timer output for the fluid applications
Jul 5, 2024
lpsaavedra
changed the title
[WIP] Improve timer output for the fluid applications
Improve timer output for the fluid applications
Jul 8, 2024
lpsaavedra
added
Ready for review
and removed
WIP
When a PR is open but not ready for review
labels
Jul 8, 2024
blaisb
approved these changes
Jul 8, 2024
M-Badri
pushed a commit
to M-Badri/lethe
that referenced
this pull request
Sep 29, 2024
escription Trying to analyze times for different benchmarks using the matrix-free application, I realized that there were time sections missing, i.e., there was 10-15% of the total time that was not reported in the final time table. In addition, the functions to update multiphysics vectors were always being executed even if only the fluid dynamics was enabled (in these calls we convert from deal.II to Trilinos vectors), which lead to unnecessary time spent there. Solution Added additional time sections so that the time summary table reflects the overall time reported at the top. The changes were also applied to the matrix-based application so that they can be easily compared. The matrix-free application now checks whether other physics are enabled or not to only perform the update of the multiphysics vectors when needed. As examples of the new timer output, this is how it would look like for the TGV case: For lethe-fluid: +---------------------------------------------------------+------------+------------+ | Total wallclock time elapsed since start | 16s | | | | | | | Section | no. calls | wall time | % of total | +---------------------------------------------+-----------+------------+------------+ | Assemble RHS | 335 | 4.43s | 28% | | Assemble matrix | 224 | 5.31s | 33% | | Calculate CFL and percolate time vectors | 112 | 0.0411s | 0.26% | | Calculate and output norms after Newton its | 224 | 0.0336s | 0.21% | | Calculate enstrophy | 112 | 0.0717s | 0.45% | | Calculate kinetic energy | 112 | 0.0514s | 0.32% | | Distribute constraints after linear solve | 224 | 0.00389s | 0% | | Read mesh and manifolds | 1 | 0.00292s | 0% | | Set initial conditions | 1 | 7.72e-07s | 0% | | Setup DOFs | 1 | 0.00489s | 0% | | Setup ILU | 111 | 5.78s | 36% | | Solve linear system | 224 | 0.254s | 1.6% | | Write checkpoint | 1 | 0.00411s | 0% | +---------------------------------------------+-----------+------------+------------+ For lethe-fluid-matrix-free: +----------------------------------------------------------+------------+------------+ | Total wallclock time elapsed since start | 8.17s | | | | | | | Section | no. calls | wall time | % of total | +----------------------------------------------+-----------+------------+------------+ | Assemble RHS | 338 | 0.0937s | 1.1% | | Assemble matrix | 227 | 0.000153s | 0% | | Calculate CFL and percolate time vectors | 112 | 0.0349s | 0.43% | | Calculate and output norms after Newton its | 227 | 0.0309s | 0.38% | | Calculate enstrophy | 112 | 0.0642s | 0.79% | | Calculate kinetic energy | 112 | 0.0447s | 0.55% | | Calculate time derivative previous solutions | 111 | 0.00199s | 0% | | Distribute constraints after linear solve | 227 | 0.00216s | 0% | | Evaluate non linear term and tau | 111 | 0.0124s | 0.15% | | Read mesh and manifolds | 1 | 0.0029s | 0% | | Set initial conditions | 1 | 6.51e-07s | 0% | | Setup DoFs | 1 | 0.00221s | 0% | | Setup GMG | 111 | 2.4s | 29% | | Solve linear system | 227 | 5.46s | 67% | +----------------------------------------------+-----------+------------+------------+ Testing No time outputs are present in any test. However, I tested this with two of the matrix-free benchmarks (steady and transient) to verify that everything works as it should when outputting the timer per iteration or at the end of the simulation. Documentation The Timer section in the General, CFD and Multiphysics parameters section of the documentation was updated. Former-commit-id: ef14246
blaisb
pushed a commit
that referenced
this pull request
Sep 30, 2024
escription Trying to analyze times for different benchmarks using the matrix-free application, I realized that there were time sections missing, i.e., there was 10-15% of the total time that was not reported in the final time table. In addition, the functions to update multiphysics vectors were always being executed even if only the fluid dynamics was enabled (in these calls we convert from deal.II to Trilinos vectors), which lead to unnecessary time spent there. Solution Added additional time sections so that the time summary table reflects the overall time reported at the top. The changes were also applied to the matrix-based application so that they can be easily compared. The matrix-free application now checks whether other physics are enabled or not to only perform the update of the multiphysics vectors when needed. As examples of the new timer output, this is how it would look like for the TGV case: For lethe-fluid: +---------------------------------------------------------+------------+------------+ | Total wallclock time elapsed since start | 16s | | | | | | | Section | no. calls | wall time | % of total | +---------------------------------------------+-----------+------------+------------+ | Assemble RHS | 335 | 4.43s | 28% | | Assemble matrix | 224 | 5.31s | 33% | | Calculate CFL and percolate time vectors | 112 | 0.0411s | 0.26% | | Calculate and output norms after Newton its | 224 | 0.0336s | 0.21% | | Calculate enstrophy | 112 | 0.0717s | 0.45% | | Calculate kinetic energy | 112 | 0.0514s | 0.32% | | Distribute constraints after linear solve | 224 | 0.00389s | 0% | | Read mesh and manifolds | 1 | 0.00292s | 0% | | Set initial conditions | 1 | 7.72e-07s | 0% | | Setup DOFs | 1 | 0.00489s | 0% | | Setup ILU | 111 | 5.78s | 36% | | Solve linear system | 224 | 0.254s | 1.6% | | Write checkpoint | 1 | 0.00411s | 0% | +---------------------------------------------+-----------+------------+------------+ For lethe-fluid-matrix-free: +----------------------------------------------------------+------------+------------+ | Total wallclock time elapsed since start | 8.17s | | | | | | | Section | no. calls | wall time | % of total | +----------------------------------------------+-----------+------------+------------+ | Assemble RHS | 338 | 0.0937s | 1.1% | | Assemble matrix | 227 | 0.000153s | 0% | | Calculate CFL and percolate time vectors | 112 | 0.0349s | 0.43% | | Calculate and output norms after Newton its | 227 | 0.0309s | 0.38% | | Calculate enstrophy | 112 | 0.0642s | 0.79% | | Calculate kinetic energy | 112 | 0.0447s | 0.55% | | Calculate time derivative previous solutions | 111 | 0.00199s | 0% | | Distribute constraints after linear solve | 227 | 0.00216s | 0% | | Evaluate non linear term and tau | 111 | 0.0124s | 0.15% | | Read mesh and manifolds | 1 | 0.0029s | 0% | | Set initial conditions | 1 | 6.51e-07s | 0% | | Setup DoFs | 1 | 0.00221s | 0% | | Setup GMG | 111 | 2.4s | 29% | | Solve linear system | 227 | 5.46s | 67% | +----------------------------------------------+-----------+------------+------------+ Testing No time outputs are present in any test. However, I tested this with two of the matrix-free benchmarks (steady and transient) to verify that everything works as it should when outputting the timer per iteration or at the end of the simulation. Documentation The Timer section in the General, CFD and Multiphysics parameters section of the documentation was updated. Former-commit-id: ef14246
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.
Description
Trying to analyze times for different benchmarks using the matrix-free application, I realized that there were time sections missing, i.e., there was 10-15% of the total time that was not reported in the final time table. In addition, the functions to update multiphysics vectors were always being executed even if only the fluid dynamics was enabled (in these calls we convert from deal.II to Trilinos vectors), which lead to unnecessary time spent there.
Solution
Added additional time sections so that the time summary table reflects the overall time reported at the top. The changes were also applied to the matrix-based application so that they can be easily compared. The matrix-free application now checks whether other physics are enabled or not to only perform the update of the multiphysics vectors when needed.
As examples of the new timer output, this is how it would look like for the TGV case:
lethe-fluid
:lethe-fluid-matrix-free
:Testing
No time outputs are present in any test. However, I tested this with two of the matrix-free benchmarks (steady and transient) to verify that everything works as it should when outputting the timer per iteration or at the end of the simulation.
Documentation
The
Timer
section in theGeneral, CFD and Multiphysics
parameters section of the documentation was updated.Miscellaneous (will be removed when merged)
Checklist (will be removed when merged)
See this page for more information about the pull request process.
Code related list:
Pull request related list: