Skip to content

Commit a9466bb

Browse files
committed
Suggestion for an option that disabled OpDiLib.
1 parent 3b4a018 commit a9466bb

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

Common/include/code_config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ using su2mixedfloat = passivedouble;
112112
#endif
113113

114114
/*--- Detect if OpDiLib has to be used. ---*/
115-
#if defined(HAVE_OMP) && defined(CODI_REVERSE_TYPE)
115+
#if defined(HAVE_OMP) && defined(CODI_REVERSE_TYPE) && !defined(FORCE_OPDI_OFF)
116116
#ifndef __INTEL_COMPILER
117117
#define HAVE_OPDI
118118
#else

meson.build

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,20 @@ if omp
117117

118118
# add opdi dependency
119119
if get_option('enable-autodiff')
120-
codi_dep += declare_dependency(include_directories: 'externals/opdi/include')
121-
122-
if get_option('opdi-backend') == 'macro'
123-
su2_cpp_args += '-DFORCE_OPDI_MACRO_BACKEND'
124-
elif get_option('opdi-backend') == 'ompt'
125-
su2_cpp_args += '-DFORCE_OPDI_OMPT_BACKEND'
126-
endif
127-
128-
if get_option('opdi-shared-read-opt') == false
129-
su2_cpp_args += '-DOPDI_VARIABLE_ADJOINT_ACCESS_MODE=0'
120+
if get_option('opdi-backend') == 'none'
121+
su2_cpp_args += '-DFORCE_OPDI_OFF'
122+
else
123+
codi_dep += declare_dependency(include_directories: 'externals/opdi/include')
124+
125+
if get_option('opdi-backend') == 'macro'
126+
su2_cpp_args += '-DFORCE_OPDI_MACRO_BACKEND'
127+
elif get_option('opdi-backend') == 'ompt'
128+
su2_cpp_args += '-DFORCE_OPDI_OMPT_BACKEND'
129+
endif
130+
131+
if get_option('opdi-shared-read-opt') == false
132+
su2_cpp_args += '-DOPDI_VARIABLE_ADJOINT_ACCESS_MODE=0'
133+
endif
130134
endif
131135
endif
132136
endif

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ option('enable-tests', type : 'boolean', value : false, description: 'compile U
1818
option('enable-mixedprec', type : 'boolean', value : false, description: 'use single precision floating point arithmetic for sparse algebra')
1919
option('extra-deps', type : 'string', value : '', description: 'comma-separated list of extra (custom) dependencies to add for compilation')
2020
option('enable-mpp', type : 'boolean', value : false, description: 'enable Mutation++ support')
21-
option('opdi-backend', type : 'combo', choices : ['auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')
21+
option('opdi-backend', type : 'combo', choices : ['none', 'auto', 'macro', 'ompt'], value : 'auto', description: 'OpDiLib backend choice')
2222
option('codi-tape', type : 'combo', choices : ['JacobianLinear', 'JacobianIndex'], value : 'JacobianLinear', description: 'CoDiPack tape choice')
2323
option('opdi-shared-read-opt', type : 'boolean', value : true, description : 'OpDiLib shared reading optimization')
2424
option('librom_root', type : 'string', value : '', description: 'libROM base directory')

0 commit comments

Comments
 (0)