Skip to content

Commit

Permalink
Merge branch 'fix-reduction-formatting' into 'master'
Browse files Browse the repository at this point in the history
Reformat reduction macros

See merge request OPAL/Libraries/ippl!159
  • Loading branch information
Arc676 committed Mar 15, 2023
2 parents 8595707 + 2faaa55 commit d2e380e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ IndentGotoLabels: false
NamespaceIndentation: All
PackConstructorInitializers: Never
ReflowComments: true
StatementMacros: ['DefineUnaryOperation', 'DefineBinaryOperation']
StatementMacros: ['DefineUnaryOperation', 'DefineBinaryOperation', 'DefineReduction', 'DefineParticleReduction']
6 changes: 3 additions & 3 deletions src/Field/BareField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ namespace ippl {
}

DefineReduction(Sum, sum, valL += myVal, MPI_SUM)
DefineReduction(Max, max, if (myVal > valL) valL = myVal, MPI_MAX)
DefineReduction(Min, min, if (myVal < valL) valL = myVal, MPI_MIN)
DefineReduction(Prod, prod, valL *= myVal, MPI_PROD)
DefineReduction(Max, max, if (myVal > valL) valL = myVal, MPI_MAX)
DefineReduction(Min, min, if (myVal < valL) valL = myVal, MPI_MIN)
DefineReduction(Prod, prod, valL *= myVal, MPI_PROD)

} // namespace ippl
6 changes: 3 additions & 3 deletions src/Particle/ParticleAttrib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ namespace ippl {
}

DefineParticleReduction(Sum, sum, valL += myVal, MPI_SUM)
DefineParticleReduction(Max, max, if (myVal > valL) valL = myVal, MPI_MAX)
DefineParticleReduction(Min, min, if (myVal < valL) valL = myVal, MPI_MIN)
DefineParticleReduction(Prod, prod, valL *= myVal, MPI_PROD)
DefineParticleReduction(Max, max, if (myVal > valL) valL = myVal, MPI_MAX)
DefineParticleReduction(Min, min, if (myVal < valL) valL = myVal, MPI_MIN)
DefineParticleReduction(Prod, prod, valL *= myVal, MPI_PROD)
} // namespace ippl

0 comments on commit d2e380e

Please sign in to comment.