Skip to content

Commit b00b87b

Browse files
authored
Merge pull request #2112 from su2code/ad_fixes
Fix adjoint vector size
2 parents 1a1693d + 1d2dcb2 commit b00b87b

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

Common/include/basic_types/ad_structure.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ inline bool TapeActive() { return false; }
6262
inline void PrintStatistics() {}
6363

6464
/*!
65-
* \brief Registers the variable as an input and saves internal data (indices). I.e. as a leaf of the computational
66-
* graph. \param[in] data - The variable to be registered as input. \param[in] push_index - boolean whether we also want
67-
* to push the index.
65+
* \brief Registers the variable as an input. I.e. as a leaf of the computational graph.
66+
* \param[in] data - The variable to be registered as input.
6867
*/
69-
inline void RegisterInput(su2double& data, bool push_index = true) {}
68+
inline void RegisterInput(su2double& data) {}
7069

7170
/*!
7271
* \brief Registers the variable as an output. I.e. as the root of the computational graph.

SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ void CDiscAdjMultizoneDriver::SetAdjObjFunction() {
780780
}
781781
}
782782
if (rank == MASTER_NODE) {
783+
AD::ResizeAdjoints();
783784
AD::SetDerivative(ObjFunc_Index, SU2_TYPE::GetValue(seeding));
784785
}
785786
}

meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ if get_option('enable-autodiff') or get_option('enable-directdiff')
7575
codi_dep = [declare_dependency(include_directories: 'externals/codi/include')]
7676
codi_rev_args = ['-DCODI_REVERSE_TYPE']
7777
codi_for_args = ['-DCODI_FORWARD_TYPE']
78+
79+
if get_option('debug')
80+
codi_rev_args += '-DCODI_EnableAssert'
81+
codi_for_args += '-DCODI_EnableAssert'
82+
endif
7883
endif
7984

8085
if get_option('enable-autodiff') and not omp
@@ -91,11 +96,11 @@ if get_option('enable-autodiff') and not omp
9196
elif get_option('codi-tape') == 'PrimalMultiUse'
9297
codi_rev_args += '-DCODI_PRIMAL_MULTIUSE_TAPE'
9398
else
94-
message('Invalid CoDiPack tape choice @1@'.format(get_option('codi-tape')))
99+
error('Invalid CoDiPack tape choice @0@'.format(get_option('codi-tape')))
95100
endif
96101

97102
if get_option('codi-tape') != 'JacobianLinear'
98-
warning('The tape choice @1@ is not tested regularly in SU2'.format(get_option('codi-tape')))
103+
warning('The tape choice @0@ is not tested regularly in SU2'.format(get_option('codi-tape')))
99104
endif
100105
endif
101106

meson_scripts/init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def init_submodules(
5555

5656
# This information of the modules is used if projects was not cloned using git
5757
# The sha tag must be maintained manually to point to the correct commit
58-
sha_version_codi = "c30f195eb9d772cadc75e9dbf4c88cb351ee34bb"
58+
sha_version_codi = "8ee822a9b0bb8235a2494467b774e27fb64ff14f"
5959
github_repo_codi = "https://github.com/scicompkl/CoDiPack"
6060
sha_version_medi = "aafc2d1966ba1233640af737e71c77c1a86183fd"
6161
github_repo_medi = "https://github.com/SciCompKL/MeDiPack"

0 commit comments

Comments
 (0)