Loading src/Benchmarks/DistSpMV/tnl-benchmark-distributed-spmv.h +1 −1 Original line number Diff line number Diff line Loading @@ -241,7 +241,7 @@ struct SpmvBenchmark const auto gi = distributedMatrix.getLocalRowRange().getGlobalIndex( i ); distributedRowLengths[ gi ] = matrix.getRowCapacity( gi ); } distributedMatrix.setCompressedRowLengths( distributedRowLengths ); distributedMatrix.setRowCapacities( distributedRowLengths ); // copy data from the global matrix/vector into the distributed matrix/vector for( IndexType i = 0; i < distributedMatrix.getLocalMatrix().getRows(); i++ ) { Loading src/Benchmarks/LinearSolvers/tnl-benchmark-linear-solvers.h +2 −2 Original line number Diff line number Diff line Loading @@ -457,13 +457,13 @@ struct LinearSolversBenchmark DistributedVector dist_x0( localRange, matrixPointer->getRows(), group ); DistributedVector dist_b( localRange, matrixPointer->getRows(), group ); // copy the row lengths from the global matrix to the distributed matrix // copy the row capacities from the global matrix to the distributed matrix DistributedRowLengths distributedRowLengths( localRange, matrixPointer->getRows(), group ); for( IndexType i = 0; i < distMatrixPointer->getLocalMatrix().getRows(); i++ ) { const auto gi = distMatrixPointer->getLocalRowRange().getGlobalIndex( i ); distributedRowLengths[ gi ] = matrixPointer->getRowCapacity( gi ); } distMatrixPointer->setCompressedRowLengths( distributedRowLengths ); distMatrixPointer->setRowCapacities( distributedRowLengths ); // copy data from the global matrix/vector into the distributed matrix/vector for( IndexType i = 0; i < distMatrixPointer->getLocalMatrix().getRows(); i++ ) { Loading src/TNL/Matrices/DistributedMatrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public: __cuda_callable__ IndexType getColumns() const; void setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ); void setRowCapacities( const CompressedRowLengthsVector& rowLengths ); template< typename Vector > void getCompressedRowLengths( Vector& rowLengths ) const; Loading src/TNL/Matrices/DistributedMatrix_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -151,14 +151,14 @@ template< typename Matrix, typename Communicator > void DistributedMatrix< Matrix, Communicator >:: setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) setRowCapacities( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT_EQ( rowLengths.getSize(), getRows(), "row lengths vector has wrong size" ); TNL_ASSERT_EQ( rowLengths.getLocalRange(), getLocalRowRange(), "row lengths vector has wrong distribution" ); TNL_ASSERT_EQ( rowLengths.getCommunicationGroup(), getCommunicationGroup(), "row lengths vector has wrong communication group" ); if( getCommunicationGroup() != CommunicatorType::NullGroup ) { localMatrix.setCompressedRowLengths( rowLengths.getConstLocalView() ); localMatrix.setRowCapacities( rowLengths.getConstLocalView() ); spmv.reset(); } Loading src/TNL/Matrices/SparseMatrix.hpp +6 −6 Original line number Diff line number Diff line Loading @@ -218,7 +218,7 @@ void SparseMatrix< Real, Device, Index, MatrixType, Segments, RealAllocator, IndexAllocator >:: setRowCapacities( const RowsCapacitiesVector& rowsCapacities ) { TNL_ASSERT_EQ( rowsCapacities.getSize(), this->getRows(), "Number of matrix rows does not fit with rowLengths vector size." ); TNL_ASSERT_EQ( rowsCapacities.getSize(), this->getRows(), "Number of matrix rows does not fit with rowCapacities vector size." ); using RowsCapacitiesVectorDevice = typename RowsCapacitiesVector::DeviceType; if( std::is_same< DeviceType, RowsCapacitiesVectorDevice >::value ) this->segments.setSegmentsSizes( rowsCapacities ); Loading Loading @@ -263,7 +263,7 @@ setElements( const std::initializer_list< std::tuple< IndexType, IndexType, Real rowCapacities[ std::get< 0 >( i ) ]++; } SparseMatrix< Real, Devices::Host, Index, MatrixType, Segments > hostMatrix( rows, columns ); hostMatrix.setCompressedRowLengths( rowCapacities ); hostMatrix.setRowCapacities( rowCapacities ); for( const auto& i : data ) { if( std::get< 1 >( i ) >= columns ) Loading Loading @@ -296,14 +296,14 @@ setElements( const std::map< std::pair< MapIndex, MapIndex > , MapValue >& map ) if( !std::is_same< DeviceType, Devices::Host >::value ) { SparseMatrix< Real, Devices::Host, Index, MatrixType, Segments > hostMatrix( this->getRows(), this->getColumns() ); hostMatrix.setCompressedRowLengths( rowsCapacities ); hostMatrix.setRowCapacities( rowsCapacities ); for( auto element : map ) hostMatrix.setElement( element.first.first, element.first.second, element.second ); *this = hostMatrix; } else { this->setCompressedRowLengths( rowsCapacities ); this->setRowCapacities( rowsCapacities ); for( auto element : map ) this->setElement( element.first.first, element.first.second, element.second ); } Loading Loading @@ -677,7 +677,7 @@ operator=( const DenseMatrix< Real_, Device_, Index_, Organization, RealAllocato Containers::Vector< RHSIndexType, RHSDeviceType, RHSIndexType > rowLengths; matrix.getCompressedRowLengths( rowLengths ); this->setLike( matrix ); this->setCompressedRowLengths( rowLengths ); this->setRowCapacities( rowLengths ); Containers::Vector< IndexType, DeviceType, IndexType > rowLocalIndexes( matrix.getRows() ); rowLocalIndexes = 0; Loading Loading @@ -787,7 +787,7 @@ operator=( const RHSMatrix& matrix ) Containers::Vector< RHSIndexType, RHSDeviceType, RHSIndexType > rowLengths; matrix.getCompressedRowLengths( rowLengths ); this->setDimensions( matrix.getRows(), matrix.getColumns() ); this->setCompressedRowLengths( rowLengths ); this->setRowCapacities( rowLengths ); Containers::Vector< IndexType, DeviceType, IndexType > rowLocalIndexes( matrix.getRows() ); rowLocalIndexes = 0; Loading Loading
src/Benchmarks/DistSpMV/tnl-benchmark-distributed-spmv.h +1 −1 Original line number Diff line number Diff line Loading @@ -241,7 +241,7 @@ struct SpmvBenchmark const auto gi = distributedMatrix.getLocalRowRange().getGlobalIndex( i ); distributedRowLengths[ gi ] = matrix.getRowCapacity( gi ); } distributedMatrix.setCompressedRowLengths( distributedRowLengths ); distributedMatrix.setRowCapacities( distributedRowLengths ); // copy data from the global matrix/vector into the distributed matrix/vector for( IndexType i = 0; i < distributedMatrix.getLocalMatrix().getRows(); i++ ) { Loading
src/Benchmarks/LinearSolvers/tnl-benchmark-linear-solvers.h +2 −2 Original line number Diff line number Diff line Loading @@ -457,13 +457,13 @@ struct LinearSolversBenchmark DistributedVector dist_x0( localRange, matrixPointer->getRows(), group ); DistributedVector dist_b( localRange, matrixPointer->getRows(), group ); // copy the row lengths from the global matrix to the distributed matrix // copy the row capacities from the global matrix to the distributed matrix DistributedRowLengths distributedRowLengths( localRange, matrixPointer->getRows(), group ); for( IndexType i = 0; i < distMatrixPointer->getLocalMatrix().getRows(); i++ ) { const auto gi = distMatrixPointer->getLocalRowRange().getGlobalIndex( i ); distributedRowLengths[ gi ] = matrixPointer->getRowCapacity( gi ); } distMatrixPointer->setCompressedRowLengths( distributedRowLengths ); distMatrixPointer->setRowCapacities( distributedRowLengths ); // copy data from the global matrix/vector into the distributed matrix/vector for( IndexType i = 0; i < distMatrixPointer->getLocalMatrix().getRows(); i++ ) { Loading
src/TNL/Matrices/DistributedMatrix.h +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public: __cuda_callable__ IndexType getColumns() const; void setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ); void setRowCapacities( const CompressedRowLengthsVector& rowLengths ); template< typename Vector > void getCompressedRowLengths( Vector& rowLengths ) const; Loading
src/TNL/Matrices/DistributedMatrix_impl.h +2 −2 Original line number Diff line number Diff line Loading @@ -151,14 +151,14 @@ template< typename Matrix, typename Communicator > void DistributedMatrix< Matrix, Communicator >:: setCompressedRowLengths( const CompressedRowLengthsVector& rowLengths ) setRowCapacities( const CompressedRowLengthsVector& rowLengths ) { TNL_ASSERT_EQ( rowLengths.getSize(), getRows(), "row lengths vector has wrong size" ); TNL_ASSERT_EQ( rowLengths.getLocalRange(), getLocalRowRange(), "row lengths vector has wrong distribution" ); TNL_ASSERT_EQ( rowLengths.getCommunicationGroup(), getCommunicationGroup(), "row lengths vector has wrong communication group" ); if( getCommunicationGroup() != CommunicatorType::NullGroup ) { localMatrix.setCompressedRowLengths( rowLengths.getConstLocalView() ); localMatrix.setRowCapacities( rowLengths.getConstLocalView() ); spmv.reset(); } Loading
src/TNL/Matrices/SparseMatrix.hpp +6 −6 Original line number Diff line number Diff line Loading @@ -218,7 +218,7 @@ void SparseMatrix< Real, Device, Index, MatrixType, Segments, RealAllocator, IndexAllocator >:: setRowCapacities( const RowsCapacitiesVector& rowsCapacities ) { TNL_ASSERT_EQ( rowsCapacities.getSize(), this->getRows(), "Number of matrix rows does not fit with rowLengths vector size." ); TNL_ASSERT_EQ( rowsCapacities.getSize(), this->getRows(), "Number of matrix rows does not fit with rowCapacities vector size." ); using RowsCapacitiesVectorDevice = typename RowsCapacitiesVector::DeviceType; if( std::is_same< DeviceType, RowsCapacitiesVectorDevice >::value ) this->segments.setSegmentsSizes( rowsCapacities ); Loading Loading @@ -263,7 +263,7 @@ setElements( const std::initializer_list< std::tuple< IndexType, IndexType, Real rowCapacities[ std::get< 0 >( i ) ]++; } SparseMatrix< Real, Devices::Host, Index, MatrixType, Segments > hostMatrix( rows, columns ); hostMatrix.setCompressedRowLengths( rowCapacities ); hostMatrix.setRowCapacities( rowCapacities ); for( const auto& i : data ) { if( std::get< 1 >( i ) >= columns ) Loading Loading @@ -296,14 +296,14 @@ setElements( const std::map< std::pair< MapIndex, MapIndex > , MapValue >& map ) if( !std::is_same< DeviceType, Devices::Host >::value ) { SparseMatrix< Real, Devices::Host, Index, MatrixType, Segments > hostMatrix( this->getRows(), this->getColumns() ); hostMatrix.setCompressedRowLengths( rowsCapacities ); hostMatrix.setRowCapacities( rowsCapacities ); for( auto element : map ) hostMatrix.setElement( element.first.first, element.first.second, element.second ); *this = hostMatrix; } else { this->setCompressedRowLengths( rowsCapacities ); this->setRowCapacities( rowsCapacities ); for( auto element : map ) this->setElement( element.first.first, element.first.second, element.second ); } Loading Loading @@ -677,7 +677,7 @@ operator=( const DenseMatrix< Real_, Device_, Index_, Organization, RealAllocato Containers::Vector< RHSIndexType, RHSDeviceType, RHSIndexType > rowLengths; matrix.getCompressedRowLengths( rowLengths ); this->setLike( matrix ); this->setCompressedRowLengths( rowLengths ); this->setRowCapacities( rowLengths ); Containers::Vector< IndexType, DeviceType, IndexType > rowLocalIndexes( matrix.getRows() ); rowLocalIndexes = 0; Loading Loading @@ -787,7 +787,7 @@ operator=( const RHSMatrix& matrix ) Containers::Vector< RHSIndexType, RHSDeviceType, RHSIndexType > rowLengths; matrix.getCompressedRowLengths( rowLengths ); this->setDimensions( matrix.getRows(), matrix.getColumns() ); this->setCompressedRowLengths( rowLengths ); this->setRowCapacities( rowLengths ); Containers::Vector< IndexType, DeviceType, IndexType > rowLocalIndexes( matrix.getRows() ); rowLocalIndexes = 0; Loading