Skip to content
Snippets Groups Projects
Commit b9fcf23f authored by Lukas Cejka's avatar Lukas Cejka Committed by Tomáš Oberhuber
Browse files

Added debuggin prints

parent 3acd94ae
No related branches found
No related tags found
1 merge request!45Matrices revision
...@@ -69,7 +69,13 @@ bool MatrixReader< Matrix >::readMtxFileHostMatrix( std::istream& file, ...@@ -69,7 +69,13 @@ bool MatrixReader< Matrix >::readMtxFileHostMatrix( std::istream& file,
if( ! computeCompressedRowLengthsFromMtxFile( file, rowLengths, columns, rows, symmetricMatrix, verbose ) ) if( ! computeCompressedRowLengthsFromMtxFile( file, rowLengths, columns, rows, symmetricMatrix, verbose ) )
return false; return false;
std::cout << " rowLengths sizeof: " << sizeof( rowLengths ) << std::endl;
std::cout << " rowLengths element sizeof: " << sizeof( rowLengths[0] ) << std::endl;
std::cout << " rowLengths getSize(): " << rowLengths.getSize() << std::endl;
matrix.setCompressedRowLengths( rowLengths ); matrix.setCompressedRowLengths( rowLengths );
std::cout << "->CompressedRowLengths SET" << std::endl;
if( ! readMatrixElementsFromMtxFile( file, matrix, symmetricMatrix, verbose, symReader ) ) if( ! readMatrixElementsFromMtxFile( file, matrix, symmetricMatrix, verbose, symReader ) )
return false; return false;
...@@ -340,6 +346,9 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file, ...@@ -340,6 +346,9 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
IndexType processedElements( 0 ); IndexType processedElements( 0 );
Timer timer; Timer timer;
timer.start(); timer.start();
std::cout << "\nBefore while..." << std::endl;
while( std::getline( file, line ) ) while( std::getline( file, line ) )
{ {
if( line[ 0 ] == '%' ) continue; if( line[ 0 ] == '%' ) continue;
...@@ -370,6 +379,9 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file, ...@@ -370,6 +379,9 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
processedElements++; processedElements++;
} }
} }
std::cout << "\nAfter while..." << std::endl;
file.clear(); file.clear();
long int fileSize = file.tellg(); long int fileSize = file.tellg();
timer.stop(); timer.stop();
...@@ -377,6 +389,9 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file, ...@@ -377,6 +389,9 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
std::cout << " Reading the matrix elements ... " << processedElements << " / " << matrix.getNumberOfMatrixElements() std::cout << " Reading the matrix elements ... " << processedElements << " / " << matrix.getNumberOfMatrixElements()
<< " -> " << timer.getRealTime() << " -> " << timer.getRealTime()
<< " sec. i.e. " << fileSize / ( timer.getRealTime() * ( 1 << 20 )) << "MB/s." << std::endl; << " sec. i.e. " << fileSize / ( timer.getRealTime() * ( 1 << 20 )) << "MB/s." << std::endl;
std::cout << "->END of reading matrix elements from file" << std::endl;
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment