Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gprof profiling option #2243

Merged
merged 3 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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