Loading src/TNL/Communicators/MpiCommunicator.h +15 −0 Original line number Diff line number Diff line Loading @@ -340,6 +340,21 @@ class MpiCommunicator #endif } // in-place variant of Allreduce template< typename T > static void Allreduce( T* data, int count, const MPI_Op &op, CommunicationGroup group) { #ifdef HAVE_MPI TNL_ASSERT_NE(group, NullGroup, "Allreduce cannot be called with NullGroup"); MPI_Allreduce( MPI_IN_PLACE, (void*) data,count,MPIDataType(data),op,group); #else throw Exceptions::MPISupportMissing(); #endif } template< typename T > static void Reduce( const T* data, Loading src/TNL/Communicators/NoDistrCommunicator.h +9 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,15 @@ class NoDistrCommunicator memcpy( ( void* ) reduced_data, ( const void* ) data, count * sizeof( T ) ); } // in-place variant of Allreduce template< typename T > static void Allreduce( T* data, int count, const MPI_Op &op, CommunicationGroup group ) { } template< typename T > static void Reduce( T* data, T* reduced_data, Loading Loading
src/TNL/Communicators/MpiCommunicator.h +15 −0 Original line number Diff line number Diff line Loading @@ -340,6 +340,21 @@ class MpiCommunicator #endif } // in-place variant of Allreduce template< typename T > static void Allreduce( T* data, int count, const MPI_Op &op, CommunicationGroup group) { #ifdef HAVE_MPI TNL_ASSERT_NE(group, NullGroup, "Allreduce cannot be called with NullGroup"); MPI_Allreduce( MPI_IN_PLACE, (void*) data,count,MPIDataType(data),op,group); #else throw Exceptions::MPISupportMissing(); #endif } template< typename T > static void Reduce( const T* data, Loading
src/TNL/Communicators/NoDistrCommunicator.h +9 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,15 @@ class NoDistrCommunicator memcpy( ( void* ) reduced_data, ( const void* ) data, count * sizeof( T ) ); } // in-place variant of Allreduce template< typename T > static void Allreduce( T* data, int count, const MPI_Op &op, CommunicationGroup group ) { } template< typename T > static void Reduce( T* data, T* reduced_data, Loading