Skip to content

Conversation

@EvertBunschoten
Copy link
Member

@EvertBunschoten EvertBunschoten commented Mar 15, 2024

Proposed Changes

Added profiling option through gprof. This allows you to profile your SU2 application to see where it spends most of its time and therefore figure out which of your new features could use some better efficiency.

How to enable profiling? Add the flag -Denable-gprof to your meson.py command and re-configure.

Now you can run SU2 or SU2 AD as normal. However, at the end, a file called gmon.out will be generated in your working directory.

In order to get the analysis from the profiling, run gprof <path/to/SU2/executable> > analysis.txt. Now, the file analysis.txt contains the profiling analysis which you can use to assess the efficiency of your code.

Added instructions for enabling and using the gprof option on the su2code.github.io repository under PR #145

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

@EvertBunschoten EvertBunschoten self-assigned this Mar 15, 2024
@EvertBunschoten EvertBunschoten changed the title Added gprof profiling option [WIP]Added gprof profiling option Mar 15, 2024
@EvertBunschoten EvertBunschoten marked this pull request as ready for review March 15, 2024 20:36
@EvertBunschoten EvertBunschoten changed the title [WIP]Added gprof profiling option Added gprof profiling option Mar 15, 2024
Copy link
Contributor

@bigfooted bigfooted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@EvertBunschoten EvertBunschoten merged commit 35231dd into develop Mar 18, 2024
@EvertBunschoten EvertBunschoten deleted the feature_profiling branch March 18, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants