diff --git a/docs/Suppressions.md b/docs/Suppressions.md index 630b044ab..4583fcde4 100644 --- a/docs/Suppressions.md +++ b/docs/Suppressions.md @@ -82,3 +82,30 @@ for( size_t k = 0; k < block_size; ++k ) { } ``` +7. `include/graphblas/reference/blas1.hpp`, masked_apply_generic +``` +for( size_t k = 0; k < block_size; ++k ) { + if( mask_b[ k ] ) { + apply( z_b[ k ], x_b[ k ], y_b[ k ], op ); + } +} +for( size_t k = 0; k < block_size; ++k ) { + const size_t index = i + k; + assert( index < n ); + if( mask_b[ k ] ) { +#ifdef _H_GRB_REFERENCE_OMP_BLAS1 + if( !z_coors.asyncAssign( index, update ) ) { + (void) ++asyncAssigns; + } +#else + (void) z_coors.assign( index ); +#endif + GRB_UTIL_IGNORE_MAYBE_UNINITIALIZED + // z_b[ k ] has been initialized in the loop just before + *( z_p + index ) = z_b[ k ]; + GRB_UTIL_RESTORE_WARNINGS + } +} +#ifdef _H_GRB_REFERENCE_OMP_BLAS1 + +``` diff --git a/include/graphblas/nonblocking/pipeline.hpp b/include/graphblas/nonblocking/pipeline.hpp index 2ea724bd6..e01939e11 100644 --- a/include/graphblas/nonblocking/pipeline.hpp +++ b/include/graphblas/nonblocking/pipeline.hpp @@ -319,6 +319,7 @@ namespace grb { const Coordinates< nonblocking > * const vector_ptr ); #endif + void markMaybeSparseDenseDescriptorVerification( Coordinates< nonblocking > * const vector_ptr ); @@ -330,6 +331,7 @@ namespace grb { void merge( Pipeline &pipeline ); void clear(); + #ifdef GRB_ALREADY_DENSE_OPTIMIZATION void buildAlreadyDenseVectors(); #endif diff --git a/include/graphblas/reference/blas1.hpp b/include/graphblas/reference/blas1.hpp index 35ebc02f9..05c1de938 100644 --- a/include/graphblas/reference/blas1.hpp +++ b/include/graphblas/reference/blas1.hpp @@ -3750,7 +3750,10 @@ namespace grb { #else (void) z_coors.assign( index ); #endif + GRB_UTIL_IGNORE_MAYBE_UNINITIALIZED + // z_b[ k ] has been initialized in the loop just before *( z_p + index ) = z_b[ k ]; + GRB_UTIL_RESTORE_WARNINGS } } #ifdef _H_GRB_REFERENCE_OMP_BLAS1 diff --git a/include/graphblas/utils/unordered_memmove.hpp b/include/graphblas/utils/unordered_memmove.hpp index de4cd1546..e36dcfeef 100644 --- a/include/graphblas/utils/unordered_memmove.hpp +++ b/include/graphblas/utils/unordered_memmove.hpp @@ -303,11 +303,11 @@ namespace grb { size_t lStartBatch = std::lower_bound( src_offsets, src_offsets + endBatch + 1, lStart ) - src_offsets; - assert( src_offsets[ endBatch ] >= lStart ); + assert( static_cast< size_t >( src_offsets[ endBatch ] ) >= lStart ); if( src_offsets[ lStartBatch ] > static_cast< IND >(lStart) ) { assert( lStartBatch > 0 ); (void) --lStartBatch; - assert( src_offsets[ lStartBatch ] < lStart ); + assert( static_cast< size_t >( src_offsets[ lStartBatch ] ) < lStart ); } assert( lStartBatch >= startBatch ); assert( lStartBatch <= endBatch ); @@ -337,8 +337,8 @@ namespace grb { // process complete batches for( ; lCurBatch < lEndBatch - 1; ++lCurBatch ) { - assert( lStart <= src_offsets[ lCurBatch ] ); - assert( lEnd >= src_offsets[ lCurBatch + 1 ] ); + assert( lStart <= static_cast< size_t >( src_offsets[ lCurBatch ] ) ); + assert( lEnd >= static_cast< size_t >( src_offsets[ lCurBatch + 1 ] ) ); const size_t nElems = (src_offsets[ lCurBatch + 1 ] - src_offsets[ lCurBatch ]); (void) std::memcpy( @@ -350,8 +350,8 @@ namespace grb { } // process last batch, which may be incomplete - assert( lEnd > src_offsets[ lEndBatch - 1 ] ); - assert( lEnd <= src_offsets[ lEndBatch ] ); + assert( lEnd > static_cast< size_t >( src_offsets[ lEndBatch - 1 ] ) ); + assert( lEnd <= static_cast< size_t >( src_offsets[ lEndBatch ] ) ); (void) std::memcpy( source + dst_offsets[ lEndBatch - 1 ], buffer + bOffset, diff --git a/src/graphblas/nonblocking/pipeline.cpp b/src/graphblas/nonblocking/pipeline.cpp index 739a88fd4..07fa87166 100644 --- a/src/graphblas/nonblocking/pipeline.cpp +++ b/src/graphblas/nonblocking/pipeline.cpp @@ -746,6 +746,10 @@ grb::RC Pipeline::verifyDenseDescriptor() { it != dense_descr_coordinates.end(); ++it ) { if( !( *it )->isDense() ) { +#ifdef _NONBLOCKING_DEBUG + std::cout << "\t error in pipeline execution: the dense descriptor was " + << "illegally used" << std::endl; +#endif return ILLEGAL; } } @@ -1031,13 +1035,6 @@ grb::RC Pipeline::execution() { // verify that the dense descriptor was legally used ret = ret ? ret : verifyDenseDescriptor(); -#ifdef _NONBLOCKING_DEBUG - if( ret == ILLEGAL ) { - std::cerr << "error in pipeline execution: the dense descriptor was " - << "illegally used" << std::endl; - } -#endif - clear(); return ret; diff --git a/src/transition/fuselets.cpp b/src/transition/fuselets.cpp index a366fa6d0..90ceb7548 100644 --- a/src/transition/fuselets.cpp +++ b/src/transition/fuselets.cpp @@ -336,10 +336,11 @@ static int update_spmv_dot( #ifndef NDEBUG // we employ defensive programming and perform expensive input checks when // compiled in debug mode: + assert(n <= std::numeric_limits< OffsetT >::max() ); for( size_t i = 0; i < n; ++i ) { assert( ia[ i + 1 ] >= ia[ i ] ); - for( size_t k = ia[ i ]; k < ia[ i + 1 ]; ++k ) { - assert( ij[ k ] < n ); + for( OffsetT k = ia[ i ]; k < ia[ i + 1 ]; ++k ) { + assert( ij[ k ] < static_cast( n ) ); } } #endif diff --git a/tests/performance/scaling.cpp b/tests/performance/scaling.cpp index 1606e7d8d..8d8e85c6e 100644 --- a/tests/performance/scaling.cpp +++ b/tests/performance/scaling.cpp @@ -124,11 +124,14 @@ void grbProgram( const struct input &data_in, struct output &out ) { out.times.io = 0; timer.reset(); out.error_code = grb::set( vx, 1 ); + out.error_code = out.error_code ? out.error_code : + grb::set( vy, 0 ); out.error_code = out.error_code ? out.error_code : setupSparseMatrix( mx, n ); out.error_code = out.error_code ? out.error_code : grb::wait(); if( out.error_code != grb::SUCCESS ) { - std::cerr << "Error in experiment set-up\n"; + std::cerr << "Error in experiment set-up: " + << grb::toString( out.error_code ) << "\n"; init_error = true; } out.times.preamble = timer.time(); @@ -142,7 +145,8 @@ void grbProgram( const struct input &data_in, struct output &out ) { } out.times.useful = timer.time() / static_cast< double >( data_in.rep ); if( out.error_code != grb::SUCCESS && !init_error ) { - std::cerr << "Error during experiment hot loop\n"; + std::cerr << "Error during experiment hot loop: " + << grb::toString( out.error_code ) << "\n"; } // done out.times.postamble = 0; @@ -156,11 +160,14 @@ void grbProgram( const struct input &data_in, struct output &out ) { out.times.io = 0; timer.reset(); out.error_code = grb::set( vx, 1 ); + out.error_code = out.error_code ? out.error_code : + grb::set( vy, 0 ); out.error_code = out.error_code ? out.error_code : setupSparseMatrix( mx, n ); out.error_code = out.error_code ? out.error_code : grb::wait(); if( out.error_code != grb::SUCCESS ) { - std::cerr << "Error in experiment set-up\n"; + std::cerr << "Error in experiment set-up: " + << grb::toString( out.error_code ) << "\n"; init_error = true; } out.times.preamble = timer.time(); @@ -175,7 +182,8 @@ void grbProgram( const struct input &data_in, struct output &out ) { } out.times.useful = timer.time() / static_cast< double >( data_in.rep ); if( out.error_code != grb::SUCCESS && !init_error ) { - std::cerr << "Error during experiment hot loop\n"; + std::cerr << "Error during experiment hot loop: " + << grb::toString( out.error_code ) << "\n"; } // done out.times.postamble = 0; @@ -189,11 +197,14 @@ void grbProgram( const struct input &data_in, struct output &out ) { out.times.io = 0; timer.reset(); out.error_code = grb::set( vx, 1 ); + out.error_code = out.error_code ? out.error_code : + grb::set( vy, 0 ); out.error_code = out.error_code ? out.error_code : setupSparseMatrix( mx, n ); out.error_code = out.error_code ? out.error_code : grb::wait(); if( out.error_code != grb::SUCCESS ) { - std::cerr << "Error in experiment set-up\n"; + std::cerr << "Error in experiment set-up: " + << grb::toString( out.error_code ) << "\n"; init_error = true; } out.times.preamble = timer.time(); @@ -207,7 +218,8 @@ void grbProgram( const struct input &data_in, struct output &out ) { } out.times.useful = timer.time() / static_cast< double >( data_in.rep ); if( out.error_code != grb::SUCCESS && !init_error ) { - std::cerr << "Error during experiment hot loop\n"; + std::cerr << "Error during experiment hot loop: " + << grb::toString( out.error_code ) << "\n"; } // done out.times.postamble = 0; @@ -221,11 +233,14 @@ void grbProgram( const struct input &data_in, struct output &out ) { out.times.io = 0; timer.reset(); out.error_code = grb::set( vx, 1 ); + out.error_code = out.error_code ? out.error_code : + grb::set( vy, 0 ); out.error_code = out.error_code ? out.error_code : setupSparseMatrix( mx, n ); out.error_code = out.error_code ? out.error_code : grb::wait(); if( out.error_code != grb::SUCCESS ) { - std::cerr << "Error in experiment set-up\n"; + std::cerr << "Error in experiment set-up: " + << grb::toString( out.error_code ) << "\n"; init_error = true; } out.times.preamble = timer.time(); @@ -240,7 +255,8 @@ void grbProgram( const struct input &data_in, struct output &out ) { } out.times.useful = timer.time() / static_cast< double >( data_in.rep ); if( out.error_code != grb::SUCCESS && !init_error ) { - std::cerr << "Error during experiment hot loop\n"; + std::cerr << "Error during experiment hot loop: " + << grb::toString( out.error_code ) << "\n"; } // done out.times.postamble = 0;