You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
21
17
22
-
## Prerequisites
23
-
24
-
Before integrating Tracy with SU2, ensure the following software is installed:
25
-
26
-
-**SU2 Source Code**: Version 8.2.0 or later.
27
-
-**Meson Build System**: Version 0.61.1 or later.
28
-
-**Git**: For retrieving the Tracy repository.
29
-
-**C++ Compiler**: Such as GCC.
30
-
-**CMake**: Required for building the Tracy profiler.
31
-
32
-
For Ubuntu users, install additional dependencies required for the Tracy server with:
To embed the Tracy client into SU2, you need to modify the Meson build configuration. The client collects profiling data during runtime. Follow these steps:
43
-
44
-
1.**Create a Wrap File for Tracy:**
45
-
46
-
- Navigate to the SU2 source directory: `cd <SU2_SOURCE_DIR>`.
47
-
- Create a file named `subprojects/tracy.wrap` with the following content:
48
-
49
-
```ini
50
-
[wrap-git]
51
-
url = https://github.com/wolfpld/tracy.git
52
-
revision = master
53
-
depth = 1
54
-
```
55
-
56
-
2. **Update Meson Options:**
57
-
58
-
- Edit `meson_options.txt` (or `meson.options`) in `<SU2_SOURCE_DIR>` to include:
59
-
60
-
```meson
61
-
option('tracy_enable',
62
-
type: 'boolean',
63
-
value: false,
64
-
description: 'Enable Tracy profiling support')
65
-
```
18
+
## Compiling SU2 with Tracy
66
19
67
-
3. **Modify the Main Meson Build File:**
68
-
69
-
- Open `meson.build` in `<SU2_SOURCE_DIR>` and add Tracy as a dependency when enabled:
70
-
71
-
```meson
72
-
if get_option('tracy_enable')
73
-
tracy_dep = dependency('tracy', static: true)
74
-
su2_deps += tracy_dep
75
-
su2_cpp_args += '-DTRACY_ENABLE'
76
-
77
-
if get_option('buildtype') != 'debugoptimized'
78
-
warning('For optimal Tracy profiling, use --buildtype=debugoptimized')
79
-
endif
80
-
endif
81
-
```
82
-
83
-
- Update the `default_options` at the top of `meson.build`:
84
-
85
-
```meson
86
-
default_options: ['buildtype=release',
87
-
'warning_level=0',
88
-
'c_std=c99',
89
-
'cpp_std=c++11',
90
-
'tracy_enable=false']
91
-
```
92
-
93
-
- Update the Build Summary to display Tracy status by inserting `get_option('tracy_enable')` into the summary format string (adjust the index accordingly, e.g., `@14@`):
94
-
95
-
```meson
96
-
Tracy Profiler: @14@
97
-
```
98
-
99
-
And update the install instruction line:
100
-
101
-
```meson
102
-
Use './ninja -C @15@ install' to compile and install SU2
103
-
```
104
-
105
-
4. **Build SU2 with Tracy:**
106
-
107
-
- Ensure Meson is updated:
20
+
To compile SU2 with Tracy support, follow these steps:
108
21
22
+
1.**Install Required Tools:**
23
+
- Tracy requires Meson version >=1.3.0, which is newer than the version provided by SU2. Install it manually:
109
24
```bash
110
25
pip install --user --upgrade meson
111
26
```
27
+
- Install Ninja manually, as it is required for the build process:
28
+
```bash
29
+
sudo apt install ninja-build
30
+
```
112
31
113
-
- Run the preconfigure script:
114
-
32
+
2. **Run the Preconfigure Script:**
33
+
- Since the provided `meson.py` script is not used, run the preconfigure script to set up the build environment:
115
34
```bash
116
35
./preconfigure.py
117
36
```
118
37
119
-
- Configure and build SU2:
120
-
38
+
3. **Configure and Build SU2:**
39
+
- Configure the build with Tracy enabled using Meson:
- Replace `<SU2_INSTALL_PATH>` and `<your_config_file>` with your installation path and configuration file.
202
96
203
-
- Replace `<SU2_INSTALL_PATH>` with your installation path and `<your_config_file>` with your configuration file.
204
-
205
-
As the simulation runs, Tracy will display real-time profiling data, allowing you to analyze performance metrics and identify bottlenecks.
97
+
The Tracy GUI will display real-time profiling data during the simulation.
206
98
207
99
## Conclusion
208
100
209
-
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](https://github.com/wolfpld/tracy/releases/latest/download/tracy.pdf).
101
+
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](https://github.com/wolfpld/tracy/releases/latest/download/tracy.pdf).
0 commit comments