Loading src/TNL/Communicators/MpiCommunicator.h +10 −10 Original line number Diff line number Diff line Loading @@ -235,24 +235,24 @@ class MpiCommunicator #endif } /* template< typename T > static void Allreduce( T& data, T& reduced_data, template< typename T > static void Allreduce( T* data, T* reduced_data, int count, const MPI_Op &op ) { MPI::COMM_WORLD.Allreduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op); MPI::COMM_WORLD.Allreduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op); }; template< typename T > static void Reduce( T& data, T& reduced_data, static void Reduce( T* data, T* reduced_data, int count, MPI_Op &op, int root) { MPI::COMM_WORLD.Reduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op,root); };*/ MPI::COMM_WORLD.Reduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op,root); }; static void writeProlog( Logger& logger ) { Loading src/TNL/Communicators/NoDistrCommunicator.h +19 −13 Original line number Diff line number Diff line Loading @@ -12,6 +12,12 @@ #include <TNL/Logger.h> #ifdef HAVE_MPI #include <mpi.h> #else enum MPI_Op { MPI_SUM, MPI_MAX }; #endif namespace TNL { namespace Communicators { Loading Loading @@ -96,24 +102,24 @@ class NoDistrCommunicator { } /* template< typename T > static void Allreduce( T& data, T& reduced_data, template< typename T > static void Allreduce( T* data, T* reduced_data, int count, const MPI_Op &op ) { MPI::COMM_WORLD.Allreduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op); memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; template< typename T > static void Reduce( T& data, T& reduced_data, static void Reduce( T* data, T* reduced_data, int count, MPI_Op &op, int root ) { MPI::COMM_WORLD.Reduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op,root); };*/ memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; static void writeProlog( Logger& logger ){}; }; Loading src/TNL/Meshes/DistributedMeshes/CMakeLists.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ SET( headers BufferEntitiesHelper.h DistributedGrid_1D.h DistributedGrid_1D.hpp DistributedGrid_2D.h DistributedGrid_2D.hpp DistributedGrid_3D.h DistributedGrid_3D.hpp DistributedGridSynchronizer.h DistributedGridIO.h ) Loading src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +70 −65 File changed.Preview size limit exceeded, changes collapsed. Show changes src/TNL/Meshes/DistributedMeshes/DistributedGrid_1D.hpp +4 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ template< typename RealType, typename Device, typename Index > template< typename CommunicatorType> void DistributedMesh< Grid< 1, RealType, Device, Index > >:: setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) { this->globalGrid = globalGrid; this->isSet = true; Loading Loading @@ -82,6 +83,7 @@ setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) globalDimensions = globalGrid.getDimensions(); globalBegin = CoordinatesType(0); localBegin = CoordinatesType(0); this->domainDecomposition[ 0 ]; return; } else Loading @@ -93,6 +95,7 @@ setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) right=rank+1; this->domainDecomposition[ 0 ] = rank; std::cerr << "setting domain decomposition to " << this->domainDecomposition << std::endl; globalDimensions=globalGrid.getDimensions(); Loading Loading
src/TNL/Communicators/MpiCommunicator.h +10 −10 Original line number Diff line number Diff line Loading @@ -235,24 +235,24 @@ class MpiCommunicator #endif } /* template< typename T > static void Allreduce( T& data, T& reduced_data, template< typename T > static void Allreduce( T* data, T* reduced_data, int count, const MPI_Op &op ) { MPI::COMM_WORLD.Allreduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op); MPI::COMM_WORLD.Allreduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op); }; template< typename T > static void Reduce( T& data, T& reduced_data, static void Reduce( T* data, T* reduced_data, int count, MPI_Op &op, int root) { MPI::COMM_WORLD.Reduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op,root); };*/ MPI::COMM_WORLD.Reduce( (void*) data, (void*) reduced_data,count,MPIDataType(data),op,root); }; static void writeProlog( Logger& logger ) { Loading
src/TNL/Communicators/NoDistrCommunicator.h +19 −13 Original line number Diff line number Diff line Loading @@ -12,6 +12,12 @@ #include <TNL/Logger.h> #ifdef HAVE_MPI #include <mpi.h> #else enum MPI_Op { MPI_SUM, MPI_MAX }; #endif namespace TNL { namespace Communicators { Loading Loading @@ -96,24 +102,24 @@ class NoDistrCommunicator { } /* template< typename T > static void Allreduce( T& data, T& reduced_data, template< typename T > static void Allreduce( T* data, T* reduced_data, int count, const MPI_Op &op ) { MPI::COMM_WORLD.Allreduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op); memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; template< typename T > static void Reduce( T& data, T& reduced_data, static void Reduce( T* data, T* reduced_data, int count, MPI_Op &op, int root ) { MPI::COMM_WORLD.Reduce((void*) &data, (void*) &reduced_data,count,MPIDataType(data),op,root); };*/ memcpy( ( void* ) reduced_data, ( void* ) data, count * sizeof( T ) ); }; static void writeProlog( Logger& logger ){}; }; Loading
src/TNL/Meshes/DistributedMeshes/CMakeLists.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ SET( headers BufferEntitiesHelper.h DistributedGrid_1D.h DistributedGrid_1D.hpp DistributedGrid_2D.h DistributedGrid_2D.hpp DistributedGrid_3D.h DistributedGrid_3D.hpp DistributedGridSynchronizer.h DistributedGridIO.h ) Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +70 −65 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/TNL/Meshes/DistributedMeshes/DistributedGrid_1D.hpp +4 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ template< typename RealType, typename Device, typename Index > template< typename CommunicatorType> void DistributedMesh< Grid< 1, RealType, Device, Index > >:: setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) { this->globalGrid = globalGrid; this->isSet = true; Loading Loading @@ -82,6 +83,7 @@ setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) globalDimensions = globalGrid.getDimensions(); globalBegin = CoordinatesType(0); localBegin = CoordinatesType(0); this->domainDecomposition[ 0 ]; return; } else Loading @@ -93,6 +95,7 @@ setGlobalGrid( const GridType& globalGrid, const CoordinatesType& overlap ) right=rank+1; this->domainDecomposition[ 0 ] = rank; std::cerr << "setting domain decomposition to " << this->domainDecomposition << std::endl; globalDimensions=globalGrid.getDimensions(); Loading