Skip to content

Commit

Permalink
Larger number of colors for the discrete adjoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
jblueh committed Nov 14, 2023
1 parent 21a0e4a commit d45447a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Common/include/toolboxes/graph_toolbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ T createNaturalColoring(Index_t numInnerIndexes) {
* \param[out] indexColor - Optional, vector with colors given to the outer indices.
* \return Coloring in the same type of the input pattern.
*/
template <typename Color_t = unsigned char, size_t MaxColors = 255, size_t MaxMB = 128, class T>
template <typename Color_t = char, size_t MaxColors = 64, size_t MaxMB = 128, class T>
T colorSparsePattern(const T& pattern, size_t groupSize = 1, bool balanceColors = false,
std::vector<Color_t>* indexColor = nullptr) {
static_assert(std::is_integral<Color_t>::value, "");
Expand Down
5 changes: 3 additions & 2 deletions SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,9 @@ void CFVMFlowSolverBase<V, R>::HybridParallelInitialization(const CConfig& confi

#ifdef CODI_REVERSE_TYPE
/*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color
* group size. Find the maximum edge color group size that yields an efficient coloring. ---*/
const auto& coloring = geometry.GetEdgeColoring(&parallelEff, true);
* group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers
* of colors. ---*/
const auto& coloring = geometry.GetEdgeColoring<unsigned char, 255>(&parallelEff, true);
#else
const auto& coloring = geometry.GetEdgeColoring(&parallelEff);
#endif
Expand Down
5 changes: 3 additions & 2 deletions SU2_CFD/include/solvers/CScalarSolver.inl
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ CScalarSolver<VariableType>::CScalarSolver(CGeometry* geometry, CConfig* config,
su2double parallelEff = 1.0;
#ifdef CODI_REVERSE_TYPE
/*--- For the discrete adjoint, the reducer strategy is costly. Prefer coloring, possibly with reduced edge color
* group size. Find the maximum edge color group size that yields an efficient coloring. ---*/
const auto& coloring = geometry->GetEdgeColoring(&parallelEff, true);
* group size. Find the maximum edge color group size that yields an efficient coloring. Also, allow larger numbers
* of colors. ---*/
const auto& coloring = geometry->GetEdgeColoring<unsigned char, 255>(&parallelEff, true);
#else
const auto& coloring = geometry->GetEdgeColoring(&parallelEff);
#endif
Expand Down

0 comments on commit d45447a

Please sign in to comment.