Skip to content

Commit

Permalink
Merge pull request #2243 from su2code/feature_profiling
Browse files Browse the repository at this point in the history
Added gprof profiling option
  • Loading branch information
EvertBunschoten authored Mar 18, 2024
2 parents f817924 + 9cfed5f commit 35231dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion SU2_CFD/src/fluid/CFluidFlamelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ CFluidFlamelet::CFluidFlamelet(CConfig* config, su2double value_pressure_operati
for (auto iCV = 0u; iCV < n_control_vars; iCV++) table_scalar_names[iCV] = config->GetControllingVariableName(iCV);

/*--- auxiliary species transport equations---*/
for (size_t i_aux = 0; i_aux < n_user_scalars; i_aux++) {
for (auto i_aux = 0u; i_aux < n_user_scalars; i_aux++) {
table_scalar_names[n_control_vars + i_aux] = config->GetUserScalarName(i_aux);
}

Expand Down
14 changes: 11 additions & 3 deletions SU2_CFD/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ su2_cfd_src += files(['iteration/CIteration.cpp',

su2_cfd_src += files(['limiters/CLimiterDetails.cpp'])

profiling_args = []
if get_option('enable-gprof')
profiling_args = ['-pg','-no-pie']
endif

if get_option('enable-normal')
su2_cfd_lib = static_library('SU2core',
su2_cfd_src,
Expand All @@ -201,7 +206,8 @@ if get_option('enable-normal')
'SU2_CFD.cpp',
install : true,
dependencies : [su2_cfd_dep, su2_deps, common_dep],
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args])
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args] + profiling_args,
link_args: profiling_args)
endif

if get_option('enable-autodiff')
Expand All @@ -216,7 +222,8 @@ if get_option('enable-autodiff')
'SU2_CFD.cpp',
install : true,
dependencies : [su2_cfd_dep_ad, su2_deps, codi_dep, commonAD_dep],
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_rev_args])
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_rev_args] + profiling_args,
link_args: profiling_args)
endif

if get_option('enable-directdiff')
Expand All @@ -231,6 +238,7 @@ if get_option('enable-directdiff')
'SU2_CFD.cpp',
install : true,
dependencies : [su2_cfd_dep_dd, su2_deps, codi_dep, commonDD_dep],
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_for_args])
cpp_args: ['-fPIC'] + [default_warning_flags, su2_cpp_args, codi_for_args] + profiling_args,
link_args: profiling_args)
endif

3 changes: 2 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ option('extra-deps', type : 'string', value : '', description: 'comma-separated
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
option('install-mpp', type : 'boolean', value : false, description: 'install Mutation++ in the directory defined with --prefix')
option('enable-coolprop', type : 'boolean', value : false, description: 'enable CoolProp support')
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable MLPCpp support')
option('enable-mlpcpp', type : 'boolean', value : false, description: 'enable profiling through gprof')
option('enable-gprof', type : 'boolean', value : false, description: 'enable MLPCpp support')
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')
option('codi-tape', type : 'combo', choices : ['JacobianLinear', 'JacobianReuse', 'JacobianMultiUse', 'PrimalLinear', 'PrimalReuse', 'PrimalMultiUse'], value : 'JacobianLinear', description: 'CoDiPack tape choice')
option('opdi-shared-read-opt', type : 'boolean', value : true, description : 'OpDiLib shared reading optimization')
Expand Down

0 comments on commit 35231dd

Please sign in to comment.