Skip to content
Snippets Groups Projects
Commit ae5acec4 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed signature of the Allreduce method of communicators

parent d87dce3e
No related branches found
No related tags found
No related merge requests found
...@@ -310,14 +310,14 @@ class MpiCommunicator ...@@ -310,14 +310,14 @@ class MpiCommunicator
} }
template< typename T > template< typename T >
static void Allreduce( T* data, static void Allreduce( const T* data,
T* reduced_data, T* reduced_data,
int count, int count,
const MPI_Op &op, const MPI_Op &op,
CommunicationGroup group) CommunicationGroup group)
{ {
#ifdef HAVE_MPI #ifdef HAVE_MPI
MPI_Allreduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op,group); MPI_Allreduce( (const void*) data, (void*) reduced_data,count,MPIDataType(data),op,group);
#else #else
throw Exceptions::MPISupportMissing(); throw Exceptions::MPISupportMissing();
#endif #endif
......
...@@ -108,13 +108,13 @@ class NoDistrCommunicator ...@@ -108,13 +108,13 @@ class NoDistrCommunicator
} }
template< typename T > template< typename T >
static void Allreduce( T* data, static void Allreduce( const T* data,
T* reduced_data, T* reduced_data,
int count, int count,
const MPI_Op &op, const MPI_Op &op,
CommunicationGroup group ) CommunicationGroup group )
{ {
memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); memcpy( ( void* ) reduced_data, ( const void* ) data, count * sizeof( T ) );
} }
template< typename T > template< typename T >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment