Commit c39ce1ce authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Various small fixes

parent 520414ca
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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                                                                                                                          \
@@ -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                                                                                                                          \
+4 −6
Original line number Diff line number Diff line
@@ -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 )
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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{
+0 −5
Original line number Diff line number Diff line
@@ -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 {