Hybrid Parallel AD Performance Improvements by jblueh · Pull Request #2039 · su2code/SU2 · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
51 changes: 35 additions & 16 deletions Common/include/basic_types/ad_structure.hpp
2 changes: 1 addition & 1 deletion Common/include/code_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ FORCEINLINE Out su2staticcast_p(In ptr) {
#include "codi/tools/data/externalFunctionUserData.hpp"

#if defined(HAVE_OMP)
using su2double = codi::RealReverseIndexOpenMP;
using su2double = codi::RealReverseIndexOpenMPGen<double, double>;
Comment thread
jblueh marked this conversation as resolved.
#else
#if defined(CODI_INDEX_TAPE)
using su2double = codi::RealReverseIndex;
Expand Down
10 changes: 6 additions & 4 deletions Common/include/parallelization/omp_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ void omp_finalize();
* thread, with all threads and memory views synchronized both beforehand and afterwards.
*/

#define BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS \
SU2_OMP_BARRIER \
#define BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS \
SU2_OMP_BARRIER \
if (omp_in_parallel()) AD::StartNoSharedReading(); \
SU2_OMP_MASTER
Comment thread
jblueh marked this conversation as resolved.

#define END_SU2_OMP_SAFE_GLOBAL_ACCESS \
END_SU2_OMP_MASTER \
#define END_SU2_OMP_SAFE_GLOBAL_ACCESS \
END_SU2_OMP_MASTER \
if (omp_in_parallel()) AD::EndNoSharedReading(); \
SU2_OMP_BARRIER

#define SU2_OMP_SAFE_GLOBAL_ACCESS(...) BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS{__VA_ARGS__} END_SU2_OMP_SAFE_GLOBAL_ACCESS
Expand Down
125 changes: 94 additions & 31 deletions Common/src/linear_algebra/CSysSolve.cpp
Loading