Skip to content

Commit ec8ba28

Browse files
Made modifications for tracy integration
1 parent 5627e49 commit ec8ba28

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

SU2_CFD/src/fluid/CDataDrivenFluid.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#define USE_MLPCPP
3232
#endif
3333

34+
#include <tracy/Tracy.hpp>
35+
3436
CDataDrivenFluid::CDataDrivenFluid(const CConfig* config, bool display) : CFluidModel() {
3537
rank = SU2_MPI::GetRank();
3638
DataDrivenFluid_ParsedOptions datadriven_fluid_options = config->GetDataDrivenParsedOptions();
@@ -305,7 +307,8 @@ void CDataDrivenFluid::ComputeDerivativeNRBC_Prho(su2double P, su2double rho) {
305307

306308

307309
unsigned long CDataDrivenFluid::Predict_MLP(su2double rho, su2double e) {
308-
unsigned long exit_code = 0;
310+
ZoneScopedN("Predict_MLP");
311+
unsigned long exit_code = 0;
309312
/*--- Evaluate MLP collection for the given values for density and energy. ---*/
310313
#ifdef USE_MLPCPP
311314
MLP_inputs[idx_rho] = rho;
@@ -469,4 +472,4 @@ void CDataDrivenFluid::ComputeIdealGasQuantities() {
469472
Cp_idealgas = Cp;
470473

471474
gamma_idealgas = (R_idealgas / Cv_idealgas) + 1;
472-
}
475+
}

meson.build

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ project('SU2', 'c', 'cpp',
66
default_options: ['buildtype=release',
77
'warning_level=0',
88
'c_std=c99',
9-
'cpp_std=c++17'])
9+
'cpp_std=c++11',
10+
'tracy_enable=false'])
1011

1112
fsmod = import('fs')
1213
if not fsmod.exists('su2preconfig.timestamp')
@@ -112,6 +113,19 @@ if get_option('enable-autodiff') and not omp
112113
endif
113114
endif
114115

116+
# Add Tracy dependency if enabled
117+
if get_option('tracy_enable')
118+
tracy_dep = dependency('tracy', static: true)
119+
su2_deps += tracy_dep
120+
su2_cpp_args += '-DTRACY_ENABLE'
121+
122+
# Add build type check
123+
if get_option('buildtype') != 'debugoptimized'
124+
warning('For optimal Tracy profiling, use --buildtype=debugoptimized')
125+
endif
126+
endif
127+
128+
115129
# add cgns library
116130
if get_option('enable-cgns')
117131
subdir('externals/cgns')
@@ -361,6 +375,7 @@ message('''---------------------------------------------------------------------
361375
libROM: @11@
362376
CoolProp: @12@
363377
MLPCpp: @13@
378+
Tracy Profiler: @14@
364379
365380
Please be sure to add the $SU2_HOME and $SU2_RUN environment variables,
366381
and update your $PATH (and $PYTHONPATH if applicable) with $SU2_RUN
@@ -372,11 +387,11 @@ message('''---------------------------------------------------------------------
372387
export PATH=$PATH:$SU2_RUN
373388
export PYTHONPATH=$PYTHONPATH:$SU2_RUN
374389
375-
Use './ninja -C @14@ install' to compile and install SU2
390+
Use './ninja -C @15@ install' to compile and install SU2
376391
'''.format(get_option('prefix')+'/bin', meson.project_source_root(), get_option('enable-tecio'), get_option('enable-cgns'),
377392
get_option('enable-autodiff'), get_option('enable-directdiff'), get_option('enable-pywrapper'), get_option('enable-mkl'),
378393
get_option('enable-openblas'), get_option('enable-pastix'), get_option('enable-mixedprec'), get_option('enable-librom'), get_option('enable-coolprop'),
379-
get_option('enable-mlpcpp'), meson.project_build_root().startswith(meson.project_source_root()) ? meson.project_build_root().split('/')[-1] : meson.project_build_root()))
394+
get_option('enable-mlpcpp'), get_option('tracy_enable'), meson.project_build_root().startswith(meson.project_source_root()) ? meson.project_build_root().split('/')[-1] : meson.project_build_root()))
380395

381396
if get_option('enable-mpp')
382397
if get_option('install-mpp')

meson_options.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ option('opdi-shared-read-opt', type : 'boolean', value : true, description : 'Op
2929
option('librom_root', type : 'string', value : '', description: 'libROM base directory')
3030
option('enable-librom', type : 'boolean', value : false, description: 'enable LLNL libROM support')
3131
option('static-cgns-deps', type : 'boolean', value : false, description: 'prefer static or dynamic (default) libraries for CGNS dependencies')
32+
option('tracy_enable',
33+
type: 'boolean',
34+
value: false,
35+
description: 'Enable Tracy profiling support')

subprojects/tracy.wrap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[wrap-git]
2+
url = https://github.com/wolfpld/tracy.git
3+
revision = master
4+
depth = 1

0 commit comments

Comments
 (0)