Loading src/TNL/Communicators/MPIPrint.h +7 −7 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ else std::stringstream __tnl_mpi_print_stream_; \ __tnl_mpi_print_stream_ << "Node " << TNL::Communicators::MpiCommunicator::GetRank() << " of " \ << TNL::Communicators::MpiCommunicator::GetSize() << " : " << message << std::endl; \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str().c_str() ); \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str() ); \ mpiSend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() ); \ } \ else \ Loading Loading @@ -77,8 +77,8 @@ else std::stringstream __tnl_mpi_print_stream_; \ __tnl_mpi_print_stream_ << "Node " << TNL::Communicators::MpiCommunicator::GetRank() << " of " \ << TNL::Communicators::MpiCommunicator::GetSize() << " : " << message << std::endl; \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str().c_str() ); \ mpiSsend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() ); \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str() ); \ mpiSend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() ); \ } \ } \ else \ Loading src/TNL/Matrices/DistributedSpMV.h +4 −6 Original line number Diff line number Diff line Loading @@ -153,12 +153,14 @@ public: updateCommunicationPattern( localMatrix, group ); // prepare buffers commRequests.clear(); globalBuffer.init( Partitioner::getOffset( localMatrix.getColumns(), rank, nproc ), inVector.getConstLocalView(), localMatrix.getColumns() - Partitioner::getOffset( localMatrix.getColumns(), rank, nproc ) - inVector.getConstLocalView().getSize() ); const auto globalBufferView = globalBuffer.getConstView(); // buffer for asynchronous communication requests std::vector< typename CommunicatorType::Request > commRequests; // send our data to all processes that need it for( int i = 0; i < commPatternStarts.getRows(); i++ ) { if( i == rank ) Loading Loading @@ -231,21 +233,17 @@ public: commPatternEnds.reset(); localOnlySpan.first = localOnlySpan.second = 0; globalBuffer.reset(); commRequests.clear(); } protected: // communication pattern Matrices::Dense< IndexType, Devices::Host, int, true, Allocators::Host< IndexType > > commPatternStarts, commPatternEnds; Matrices::Dense< IndexType, Devices::Host, int > commPatternStarts, commPatternEnds; // span of rows with only block-diagonal entries std::pair< IndexType, IndexType > localOnlySpan; // global buffer for non-local elements of the vector __DistributedSpMV_impl::ThreePartVector< RealType, DeviceType, IndexType > globalBuffer; // buffer for asynchronous communication requests std::vector< typename CommunicatorType::Request > commRequests; }; } // namespace Matrices Loading src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include <TNL/Meshes/DistributedMeshes/BufferEntitiesHelper.h> #include <TNL/Meshes/DistributedMeshes/Directions.h> #include <TNL/Communicators/MPIPrint.h> #include <TNL/Pointers/SharedPointer.h> namespace TNL { namespace Functions{ Loading src/TNL/Solvers/PDE/ExplicitUpdater.h +0 −5 Original line number Diff line number Diff line Loading @@ -18,11 +18,6 @@ #include <TNL/Meshes/GridDetails/Traverser_Grid2D.h> #include <TNL/Meshes/GridDetails/Traverser_Grid3D.h> #ifdef USE_MPI #include <TNL/Meshes/DistributedGridSynchronizer.h> #endif namespace TNL { namespace Solvers { namespace PDE { Loading Loading
src/TNL/Communicators/MPIPrint.h +7 −7 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ else std::stringstream __tnl_mpi_print_stream_; \ __tnl_mpi_print_stream_ << "Node " << TNL::Communicators::MpiCommunicator::GetRank() << " of " \ << TNL::Communicators::MpiCommunicator::GetSize() << " : " << message << std::endl; \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str().c_str() ); \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str() ); \ mpiSend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() ); \ } \ else \ Loading Loading @@ -77,8 +77,8 @@ else std::stringstream __tnl_mpi_print_stream_; \ __tnl_mpi_print_stream_ << "Node " << TNL::Communicators::MpiCommunicator::GetRank() << " of " \ << TNL::Communicators::MpiCommunicator::GetSize() << " : " << message << std::endl; \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str().c_str() ); \ mpiSsend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() ); \ TNL::String __tnl_mpi_print_string_( __tnl_mpi_print_stream_.str() ); \ mpiSend( __tnl_mpi_print_string_, 0, std::numeric_limits< int >::max() ); \ } \ } \ else \ Loading
src/TNL/Matrices/DistributedSpMV.h +4 −6 Original line number Diff line number Diff line Loading @@ -153,12 +153,14 @@ public: updateCommunicationPattern( localMatrix, group ); // prepare buffers commRequests.clear(); globalBuffer.init( Partitioner::getOffset( localMatrix.getColumns(), rank, nproc ), inVector.getConstLocalView(), localMatrix.getColumns() - Partitioner::getOffset( localMatrix.getColumns(), rank, nproc ) - inVector.getConstLocalView().getSize() ); const auto globalBufferView = globalBuffer.getConstView(); // buffer for asynchronous communication requests std::vector< typename CommunicatorType::Request > commRequests; // send our data to all processes that need it for( int i = 0; i < commPatternStarts.getRows(); i++ ) { if( i == rank ) Loading Loading @@ -231,21 +233,17 @@ public: commPatternEnds.reset(); localOnlySpan.first = localOnlySpan.second = 0; globalBuffer.reset(); commRequests.clear(); } protected: // communication pattern Matrices::Dense< IndexType, Devices::Host, int, true, Allocators::Host< IndexType > > commPatternStarts, commPatternEnds; Matrices::Dense< IndexType, Devices::Host, int > commPatternStarts, commPatternEnds; // span of rows with only block-diagonal entries std::pair< IndexType, IndexType > localOnlySpan; // global buffer for non-local elements of the vector __DistributedSpMV_impl::ThreePartVector< RealType, DeviceType, IndexType > globalBuffer; // buffer for asynchronous communication requests std::vector< typename CommunicatorType::Request > commRequests; }; } // namespace Matrices Loading
src/TNL/Meshes/DistributedMeshes/DistributedGridSynchronizer.h +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #include <TNL/Meshes/DistributedMeshes/BufferEntitiesHelper.h> #include <TNL/Meshes/DistributedMeshes/Directions.h> #include <TNL/Communicators/MPIPrint.h> #include <TNL/Pointers/SharedPointer.h> namespace TNL { namespace Functions{ Loading
src/TNL/Solvers/PDE/ExplicitUpdater.h +0 −5 Original line number Diff line number Diff line Loading @@ -18,11 +18,6 @@ #include <TNL/Meshes/GridDetails/Traverser_Grid2D.h> #include <TNL/Meshes/GridDetails/Traverser_Grid3D.h> #ifdef USE_MPI #include <TNL/Meshes/DistributedGridSynchronizer.h> #endif namespace TNL { namespace Solvers { namespace PDE { Loading