-
Configuration File
Mesh File
Restart File
Solver Setup
Physical Definition
Markers and Boundary Conditions
Convective Schemes
Slope Limiters and Shock Resolution
History and Solution Output
Linear Solvers and Preconditioners
Basics of Multi-Zone Computations
Execution
Aeroacoustic analysis of unsteady pressure
Flamelet Solver — Python Wrapper Wall Boundary Conditions
Output Fields Reference
Error Messages
-
Setup Guide: Steady RANS for External Aerodynamics
Setup Guide: Incompressible Flows
Setup Guide: Unsteady Flows and DES
Setup Guide: Laminar-Turbulent Transition
Setup Guide: Turbomachinery
Setup Guide: Heat Transfer and Conjugate Heat Transfer
Setup Guide: Species Transport and Combustion
Setup Guide: Shape Optimization with the Discrete Adjoint
Setup Guide: Non-Ideal Compressible Flows
-
Option Reference
Problem Definition
FluidModel
Data-driven fluid model parameters
Freestream Conditions
Reference Conditions
Boundary Markers
Time-marching
Linear solver definition
Convergence
Multi-grid
Spatial Discretization
Adjoint and Gradient
Sobolev Gradient Solver Parameters
Input/output files and formats
Dynamic mesh definition
Aeroelastic Simulation (Typical Section Model)
Wind Gust
Equivalent Area
Grid deformation
Deformable mesh
FEM flow solver definition
FEA solver
Multizone definition
Radiation solver
Heat solver
Visualize Control Volumes
Inverse design problem
Unsupported options
FFD point inversion
Automatic Differentation options
Python Options
Hybrid_RANSLES Options
Output Options
libROM options
Renamed and Removed Options
-
GIT-ting Started
Developing SU2 on GitHub (Internal Developers)
Running Regression Tests
Code Review
Code Structure
Style Guide
Advanced AD Techniques
Containers for Development
Writing Unit Tests
Integrating Tracy Profiler with SU2
Automatic Differentiation (AD)
Code Reference (Doxygen)
Debugging SU2
Documentation Improvements and Status
Glossary
Docs Check
Integrating Tracy Profiler with SU2
- Introduction
- Compiling SU2 with Tracy
- Instrumenting SU2 Code
- Running the Profiler and Visualizing Data
- Conclusion
Introduction
Tracy is a high-performance, real-time profiler designed for C++ applications, offering nanosecond-resolution timing with minimal overhead. It is an excellent tool for profiling computationally intensive software like SU2, where traditional profilers such as Valgrind may introduce significant slowdowns. This guide provides step-by-step instructions for integrating Tracy with SU2, enabling users to analyze and optimize the performance of their CFD simulations effectively.
Compiling SU2 with Tracy
To compile SU2 with Tracy support, follow these steps:
- Configure the build with Tracy enabled using Meson:
./meson.py setup build -Dwith-mpi=disabled --buildtype=debugoptimized -Dtracy_enable=true --prefix=<SU2_INSTALL_PATH> - Build and install SU2:
./ninja -C build install - Replace
<SU2_INSTALL_PATH>with your desired installation directory.
This embeds the Tracy client into SU2 for profiling.
Instrumenting SU2 Code
To profile a function in SU2, you must use the project’s centralized wrapper macros. This approach ensures that profiling can be cleanly enabled or disabled at compile time without modifying the core logic.
- Include the SU2 Tracy Wrapper Header:
- Add an include directive for
tracy_structure.hppat the top of your C++ source file. The relative path will depend on the file’s location. For example, for a file inSU2_CFD/src/fluid/:#include "../../../Common/include/tracy_structure.hpp" - Important: Do not include
<tracy/Tracy.hpp>directly. The wrapper header manages the actual Tracy library.
- Add an include directive for
- Instrument the Function with SU2 Macros:
- Use
SU2_ZONE_SCOPED_N("MyLabel")to mark a function or scope with a custom name. This is the recommended macro for clarity.void MyFunction() { SU2_ZONE_SCOPED_N("MyFunction"); // Function implementation } - The label you provide (e.g.,
"MyFunction") is what will appear in the Tracy profiler’s timeline. - Alternatively, for a quick annotation, you can use
SU2_ZONE_SCOPED;. This macro automatically uses the compiler-provided function name for the label.void MyFunction() { SU2_ZONE_SCOPED; // Function implementation }
- Use
Running the Profiler and Visualizing Data
After compiling and instrumenting SU2, profile and visualize the data as follows:
- Build the Tracy Server:
Install additional dependencies required for the Tracy server.
sudo apt install libfreetype6-dev libcapstone-dev libdbus-1-dev \
libxkbcommon-dev libwayland-dev wayland-protocols \
libegl1-mesa-dev libglvnd-dev libgtk-3-dev
- Navigate to the Tracy directory:
cd <SU2_SOURCE_DIR>/subprojects/tracy. - Build the profiler using CMake:
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release cmake --build profiler/build --config Release --parallel
- Launch the Tracy Profiler:
- Run the profiler:
./profiler/build/tracy-profiler - Click “Connect” in the GUI to wait for SU2.
- Run the profiler:
- Run the SU2 Simulation:
- In a separate terminal, execute your simulation:
<SU2_INSTALL_PATH>/bin/SU2_CFD <your_config_file>.cfg - Replace
<SU2_INSTALL_PATH>and<your_config_file>with your installation path and configuration file.
- In a separate terminal, execute your simulation:
The Tracy GUI will display real-time profiling data during the simulation.
Conclusion
Integrating Tracy with SU2 equips users with a powerful, low-overhead tool for profiling and optimizing CFD simulations. Its real-time visualization and precise timing capabilities make it ideal for performance analysis. For advanced features, troubleshooting, or additional details, consult the Tracy documentation.