Skip to content

Conversation

@divyaprakash-iitd
Copy link
Contributor

@divyaprakash-iitd divyaprakash-iitd commented Jul 11, 2025

Proposed Changes

Integrated the Tracy profiler into the SU2 codebase with Meson support. Added build options for enabling profiling, instrumented the function Predict_MLP in SU2_CFD/src/fluid/CDataDrivenFluid.cpp with Tracy macros for demonstration of performance monitoring, and updated the configuration summary for clarity. These changes allow real-time, low-overhead performance analysis via the Tracy GUI.
Details of these changes are documented in my blog post: https://dpcfd.com/posts/2025/07/gsoc-week-3/
Details of these changes are here: https://github.com/divyaprakash-iitd/su2code.github.io/blob/develop/_docs_v7/Tracy-Integration.md

Related Work

This PR does not resolve any open issues but contributes to profiling. This effort aligns with ongoing GSoC work.

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.

@bigfooted bigfooted changed the base branch from master to develop July 12, 2025 11:05
@bigfooted bigfooted marked this pull request as draft July 12, 2025 11:05
@bigfooted
Copy link
Contributor

Hi Nice to have this, can you also add your blog post to the tutorial page on su2code.github.io, maybe under Developer Docs?

@divyaprakash-iitd
Copy link
Contributor Author

divyaprakash-iitd commented Jul 14, 2025

Hi Nice to have this, can you also add your blog post to the tutorial page on su2code.github.io, maybe under Developer Docs?

I have added a new file, Tracy-Integration.md, to the _docs_v7 directory in the develop branch of the su2code/su2code.github.io repository and submitted a pull request. Is this the correct location for new documentation?

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

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

Does this only profile the functions you annotate? Do you still see them as fraction of total time even if you don't annotate the main function of the code?

To integrate this type of tools that require intrusive changes to be used (i.e. annotations) we need to wrap them.

Similar to what we do for AD, OpenMP, etc., if tracy is included then you define some macros for the functionality that we want to expose (e.g. ZoneScopedN) and you turn on the include of tracy (it should not be included explicitly in any other files).
Have a look at omp_structure.hpp and follow the same pattern.

@divyaprakash-iitd
Copy link
Contributor Author

Does this only profile the functions you annotate? Do you still see them as fraction of total time even if you don't annotate the main function of the code?

To integrate this type of tools that require intrusive changes to be used (i.e. annotations) we need to wrap them.

Similar to what we do for AD, OpenMP, etc., if tracy is included then you define some macros for the functionality that we want to expose (e.g. ZoneScopedN) and you turn on the include of tracy (it should not be included explicitly in any other files). Have a look at omp_structure.hpp and follow the same pattern.

Yes, it profiles only the annotated functions, and the functions still appear as a fraction of the total time without annotating the main function.
Thank you for your suggestions. I have looked at "omp_structure.hpp" and implemented a similar "tracy_structure.hpp". I have added documentation on using it to a separate PR. I have verified it by testing on my system. Please let me know if I should make any changes.

@pcarruscag pcarruscag marked this pull request as ready for review July 24, 2025 14:30
@pcarruscag pcarruscag changed the title [WIP] Tracy profiler integration Tracy profiler integration Jul 24, 2025
@pcarruscag pcarruscag merged commit 1d61b75 into su2code:develop Jul 30, 2025
37 checks passed
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.

5 participants