Skip to content

Commit 255b43f

Browse files
committed
Merge remote-tracking branch 'origin/develop' into nemo_visc_update
2 parents 9c6ac28 + 3ec1c68 commit 255b43f

882 files changed

Lines changed: 5359 additions & 6967 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/regression.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
strategy:
6161
fail-fast: false
6262
matrix:
63-
testscript: ['tutorials.py', 'parallel_regression.py', 'parallel_regression_AD.py', 'serial_regression.py', 'serial_regression_AD.py', 'hybrid_regression.py']
63+
testscript: ['tutorials.py', 'parallel_regression.py', 'parallel_regression_AD.py', 'serial_regression.py', 'serial_regression_AD.py', 'hybrid_regression.py', 'hybrid_regression_AD.py']
6464
include:
6565
- testscript: 'tutorials.py'
6666
tag: MPI
@@ -74,6 +74,8 @@ jobs:
7474
tag: NoMPI
7575
- testscript: 'hybrid_regression.py'
7676
tag: OMP
77+
- testscript: 'hybrid_regression_AD.py'
78+
tag: OMP
7779
steps:
7880
- name: Download All artifact
7981
uses: actions/download-artifact@v2

Common/doc/docmain.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file docmain.hpp
33
* \brief This file contains documentation for Doxygen and does not have any significance with respect to C++.
44
* \author F. Palacios
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* The current SU2 release has been coordinated by the
88
* SU2 International Developers Society <www.su2devsociety.org>
@@ -33,7 +33,7 @@
3333
*/
3434

3535
/*!
36-
* \mainpage SU2 version 7.1.1 "Blackbird"
36+
* \mainpage SU2 version 7.2.0 "Blackbird"
3737
* SU2 suite is an open-source collection of C++ based software tools
3838
* to perform PDE analysis and PDE constrained optimization problems. The toolset is designed with
3939
* computational fluid dynamics and aerodynamic shape optimization in mind, but is extensible to

Common/include/CConfig.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* \brief All the information about the definition of the physical problem.
44
* The subroutines and functions are in the <i>CConfig.cpp</i> file.
55
* \author F. Palacios, T. Economon, B. Tracey
6-
* \version 7.1.1 "Blackbird"
6+
* \version 7.2.0 "Blackbird"
77
*
88
* SU2 Project Website: https://su2code.github.io
99
*
@@ -475,7 +475,6 @@ class CConfig {
475475
unsigned short Kind_Solver, /*!< \brief Kind of solver Euler, NS, Continuous adjoint, etc. */
476476
Kind_FluidModel, /*!< \brief Kind of the Fluid Model: Ideal or Van der Walls, ... . */
477477
Kind_InitOption, /*!< \brief Kind of Init option to choose if initializing with Reynolds number or with thermodynamic conditions */
478-
Kind_TransCoeffModel, /*!< \brief Transport coefficient Model for NEMO solver. */
479478
Kind_GridMovement, /*!< \brief Kind of the static mesh movement. */
480479
*Kind_SurfaceMovement, /*!< \brief Kind of the static mesh movement. */
481480
nKind_SurfaceMovement, /*!< \brief Kind of the dynamic mesh movement. */
@@ -1142,6 +1141,7 @@ class CConfig {
11421141
monoatomic; /*!< \brief Flag for monoatomic mixture. */
11431142
string GasModel, /*!< \brief Gas Model. */
11441143
*Wall_Catalytic; /*!< \brief Pointer to catalytic walls. */
1144+
TRANSCOEFFMODEL Kind_TransCoeffModel; /*!< \brief Transport coefficient Model for NEMO solver. */
11451145

11461146
/*!
11471147
* \brief Set the default values of config options not set in the config file using another config object.
@@ -3623,7 +3623,7 @@ class CConfig {
36233623
* \brief Get the transport coefficient model.
36243624
* \return Index of transport coefficient model.
36253625
*/
3626-
unsigned short GetKind_TransCoeffModel(void) const { return Kind_TransCoeffModel; }
3626+
TRANSCOEFFMODEL GetKind_TransCoeffModel(void) const { return Kind_TransCoeffModel; }
36273627

36283628
/*!
36293629
* \brief Get the total number of heat flux markers.

Common/include/adt/CADTBaseClass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file CADTBaseClass.hpp
33
* \brief Base class for storing an ADT in an arbitrary number of dimensions.
44
* \author E. van der Weide
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*

Common/include/adt/CADTComparePointClass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file CADTComparePointClass.hpp
33
* \brief subroutines for comparing two points in an alternating digital tree (ADT).
44
* \author E. van der Weide
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*

Common/include/adt/CADTElemClass.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file CADTElemClass.hpp
33
* \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions.
44
* \author E. van der Weide
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*
@@ -35,7 +35,7 @@
3535
* \class CADTElemClass
3636
* \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions.
3737
* \author E. van der Weide
38-
* \version 7.1.1 "Blackbird"
38+
* \version 7.2.0 "Blackbird"
3939
*/
4040
class CADTElemClass : public CADTBaseClass {
4141
private:

Common/include/adt/CADTNodeClass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file CADTNodeClass.hpp
33
* \brief Class for storing the information needed in a node of an ADT.
44
* \author E. van der Weide
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*

Common/include/adt/CADTPointsOnlyClass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file CADTPointsOnlyClass.hpp
33
* \brief Class for storing an ADT of only points in an arbitrary number of dimensions.
44
* \author E. van der Weide
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*

Common/include/adt/CBBoxTargetClass.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* \brief Class for storing the information of a possible bounding box candidate
44
during a minimum distance search.
55
* \author E. van der Weide
6-
* \version 7.1.1 "Blackbird"
6+
* \version 7.2.0 "Blackbird"
77
*
88
* SU2 Project Website: https://su2code.github.io
99
*
@@ -34,7 +34,7 @@
3434
* \brief Class for storing the information of a possible bounding box candidate
3535
during a minimum distance search.
3636
* \author E. van der Weide
37-
* \version 7.1.1 "Blackbird"
37+
* \version 7.2.0 "Blackbird"
3838
*/
3939
struct CBBoxTargetClass {
4040

Common/include/basic_types/ad_structure.hpp

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* \file ad_structure.hpp
33
* \brief Main routines for the algorithmic differentiation (AD) structure.
44
* \author T. Albring, J. Blühdorn
5-
* \version 7.1.1 "Blackbird"
5+
* \version 7.2.0 "Blackbird"
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*
@@ -252,7 +252,7 @@ namespace AD{
252252

253253
/*!
254254
* \brief Start a passive region, i.e. stop recording.
255-
* \return True is tape was active.
255+
* \return True if tape was active.
256256
*/
257257
inline bool BeginPassive() { return false; }
258258

@@ -262,6 +262,28 @@ namespace AD{
262262
*/
263263
inline void EndPassive(bool wasActive) {}
264264

265+
/*!
266+
* \brief Pause the use of preaccumulation.
267+
* \return True if preaccumulation was active.
268+
*/
269+
inline bool PausePreaccumulation() { return false; }
270+
271+
/*!
272+
* \brief Resume the use of preaccumulation.
273+
* \param[in] wasActive - Whether preaccumulation was active before pausing.
274+
*/
275+
inline void ResumePreaccumulation(bool wasActive) {}
276+
277+
/*!
278+
* \brief Begin a hybrid parallel adjoint evaluation mode that assumes an inherently safe reverse path.
279+
*/
280+
inline void StartNoSharedReading() {}
281+
282+
/*!
283+
* \brief End the "no shared reading" adjoint evaluation mode.
284+
*/
285+
inline void EndNoSharedReading() {}
286+
265287
#else
266288
using CheckpointHandler = codi::DataStore;
267289

@@ -271,9 +293,10 @@ namespace AD{
271293

272294
extern ExtFuncHelper* FuncHelper;
273295

274-
extern bool Status;
275-
276296
extern bool PreaccActive;
297+
#ifdef HAVE_OPDI
298+
SU2_OMP(threadprivate(PreaccActive))
299+
#endif
277300

278301
extern bool PreaccEnabled;
279302

@@ -290,6 +313,9 @@ namespace AD{
290313
extern std::vector<TapePosition> TapePositions;
291314

292315
extern codi::PreaccumulationHelper<su2double> PreaccHelper;
316+
#ifdef HAVE_OPDI
317+
SU2_OMP(threadprivate(PreaccHelper))
318+
#endif
293319

294320
/*--- Reference to the tape. ---*/
295321

@@ -446,6 +472,7 @@ namespace AD{
446472
FORCEINLINE void EndPreacc(){
447473
if (PreaccActive) {
448474
PreaccHelper.finish(false);
475+
PreaccActive = false;
449476
}
450477
}
451478

@@ -522,6 +549,39 @@ namespace AD{
522549

523550
FORCEINLINE void EndPassive(bool wasActive) { if(wasActive) StartRecording(); }
524551

552+
FORCEINLINE bool PausePreaccumulation() {
553+
const auto current = PreaccEnabled;
554+
if (!current) return false;
555+
SU2_OMP_BARRIER
556+
SU2_OMP_MASTER
557+
PreaccEnabled = false;
558+
END_SU2_OMP_MASTER
559+
SU2_OMP_BARRIER
560+
return true;
561+
}
562+
563+
FORCEINLINE void ResumePreaccumulation(bool wasActive) {
564+
if (!wasActive) return;
565+
SU2_OMP_BARRIER
566+
SU2_OMP_MASTER
567+
PreaccEnabled = true;
568+
END_SU2_OMP_MASTER
569+
SU2_OMP_BARRIER
570+
}
571+
572+
FORCEINLINE void StartNoSharedReading() {
573+
#ifdef HAVE_OPDI
574+
opdi::logic->setAdjointAccessMode(opdi::LogicInterface::AdjointAccessMode::Classical);
575+
opdi::logic->addReverseBarrier();
576+
#endif
577+
}
578+
579+
FORCEINLINE void EndNoSharedReading() {
580+
#ifdef HAVE_OPDI
581+
opdi::logic->setAdjointAccessMode(opdi::LogicInterface::AdjointAccessMode::Atomic);
582+
opdi::logic->addReverseBarrier();
583+
#endif
584+
}
525585
#endif // CODI_REVERSE_TYPE
526586

527587
} // namespace AD

0 commit comments

Comments
 (0)