Skip to content

Commit

Permalink
♻️ minPair()/maxPair()->min()/max()
Browse files Browse the repository at this point in the history
  • Loading branch information
MelReyCG committed Jan 29, 2025
1 parent 367836f commit f763763
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/coreComponents/common/MpiWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ struct MpiWrapper
* @return The maximum of all \p value across the ranks.
*/
template< typename FIRST, typename SECOND >
static PairType< FIRST, SECOND > minPair( PairType< FIRST, SECOND > const & pair, MPI_Comm comm = MPI_COMM_GEOS );
static PairType< FIRST, SECOND > min( PairType< FIRST, SECOND > const & pair, MPI_Comm comm = MPI_COMM_GEOS );

/**
* @brief Convenience function for a MPI_Allreduce using a min-pair operation.
Expand All @@ -693,7 +693,7 @@ struct MpiWrapper
* @return The maximum of all \p value across the ranks.
*/
template< typename FIRST, typename SECOND, typename CONTAINER >
static PairType< FIRST, SECOND > minPair( CONTAINER const & pairs, MPI_Comm comm = MPI_COMM_GEOS );
static PairType< FIRST, SECOND > min( CONTAINER const & pairs, MPI_Comm comm = MPI_COMM_GEOS );

/**
* @brief Convenience function for a MPI_Allreduce using a MPI_MAX operation.
Expand All @@ -719,7 +719,7 @@ struct MpiWrapper
* @return The maximum of all \p value across the ranks.
*/
template< typename FIRST, typename SECOND >
static PairType< FIRST, SECOND > maxPair( PairType< FIRST, SECOND > const & pair, MPI_Comm comm = MPI_COMM_GEOS );
static PairType< FIRST, SECOND > max( PairType< FIRST, SECOND > const & pair, MPI_Comm comm = MPI_COMM_GEOS );

/**
* @brief Convenience function for a MPI_Allreduce using a max-pair operation.
Expand All @@ -728,7 +728,7 @@ struct MpiWrapper
* @return The maximum of all \p value across the ranks.
*/
template< typename FIRST, typename SECOND, typename CONTAINER >
static PairType< FIRST, SECOND > maxPair( CONTAINER const & pairs, MPI_Comm comm = MPI_COMM_GEOS );
static PairType< FIRST, SECOND > max( CONTAINER const & pairs, MPI_Comm comm = MPI_COMM_GEOS );

private:

Expand Down Expand Up @@ -1411,19 +1411,19 @@ MpiWrapper::allReduce( CONTAINER const & pairs, MPI_Comm const comm )
}

template< typename FIRST, typename SECOND >
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::minPair( MpiWrapper::PairType< FIRST, SECOND > const & pair, MPI_Comm comm )
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::min( MpiWrapper::PairType< FIRST, SECOND > const & pair, MPI_Comm comm )
{ return allReduce< FIRST, SECOND, PairReduction::Min >( pair, comm ); }

template< typename FIRST, typename SECOND, typename CONTAINER >
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::minPair( CONTAINER const & pairs, MPI_Comm comm )
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::min( CONTAINER const & pairs, MPI_Comm comm )
{ return allReduce< FIRST, SECOND, CONTAINER, PairReduction::Min >( pairs, comm ); }

template< typename FIRST, typename SECOND >
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::maxPair( MpiWrapper::PairType< FIRST, SECOND > const & pair, MPI_Comm comm )
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::max( MpiWrapper::PairType< FIRST, SECOND > const & pair, MPI_Comm comm )
{ return allReduce< FIRST, SECOND, PairReduction::Max >( pair, comm ); }

template< typename FIRST, typename SECOND, typename CONTAINER >
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::maxPair( CONTAINER const & pairs, MPI_Comm comm )
MpiWrapper::PairType< FIRST, SECOND > MpiWrapper::max( CONTAINER const & pairs, MPI_Comm comm )
{ return allReduce< FIRST, SECOND, CONTAINER, PairReduction::Max >( pairs, comm ); }

} /* namespace geos */
Expand Down

0 comments on commit f763763

Please sign in to comment.