Skip to content

Commit d88227c

Browse files
committed
Adding triangle_count tests for gyro_m & dwt_59
1 parent 744bb18 commit d88227c

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

include/graphblas/algorithms/triangle_count.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#include <graphblas.hpp>
3737

38-
constexpr bool Debug = true;
38+
constexpr bool Debug = false;
3939

4040
namespace grb {
4141

@@ -46,7 +46,7 @@ namespace grb {
4646
template< class Iterator >
4747
void printSparseMatrixIterator( size_t rows, size_t cols, Iterator begin, Iterator end, const std::string & name = "", std::ostream & os = std::cout ) {
4848
std::cout << "Matrix \"" << name << "\" (" << rows << "x" << cols << "):" << std::endl << "[" << std::endl;
49-
if( rows > 1000 || cols > 1000 ) {
49+
if( rows > 100 || cols > 100 ) {
5050
os << " Matrix too large to print" << std::endl;
5151
} else {
5252
// os.precision( 3 );

tests/smoke/smoketests.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,9 @@ for BACKEND in ${BACKENDS[@]}; do
338338
fi
339339
echo " "
340340

341-
echo ">>> [x] [ ] Testing the Triangle couting algorithm."
341+
echo ">>> [x] [ ] Testing the Triangle couting algorithm on the dwt_59.mtx"
342342
if [ -f ${INPUT_DIR}/dwt_59.mtx ]; then
343-
$runner ${TEST_BIN_DIR}/triangle_count_${BACKEND} ${INPUT_DIR}/dwt_59.mtx 30 &> ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log
343+
$runner ${TEST_BIN_DIR}/triangle_count_${BACKEND} ${INPUT_DIR}/dwt_59.mtx direct 30 1 1 &> ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log
344344
head -1 ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log
345345
if ! grep -q 'Test OK' ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log; then
346346
echo "Test FAILED"
@@ -355,6 +355,23 @@ for BACKEND in ${BACKENDS[@]}; do
355355
fi
356356
echo " "
357357

358+
echo ">>> [x] [ ] Testing the Triangle couting algorithm on the gyro_m.mtx"
359+
if [ -f ${INPUT_DIR}/gyro_m.mtx ]; then
360+
$runner ${TEST_BIN_DIR}/triangle_count_${BACKEND} ${INPUT_DIR}/gyro_m.mtx direct 598470 1 1 &> ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log
361+
head -1 ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log
362+
if ! grep -q 'Test OK' ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log; then
363+
echo "Test FAILED"
364+
elif ! grep -q '11 iterations to converge' ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log; then
365+
echo "Verification FAILED"
366+
echo "Test FAILED"
367+
else
368+
echo "Test OK"
369+
fi
370+
else
371+
echo "Test DISABLED: gyro_m.mtx was not found. To enable, please provide ${INPUT_DIR}/gyro_m.mtx"
372+
fi
373+
echo " "
374+
358375
if [ "$BACKEND" = "bsp1d" ] || [ "$BACKEND" = "hybrid" ]; then
359376
echo "Additional standardised smoke tests not yet supported for the ${BACKEND} backend"
360377
echo

0 commit comments

Comments
 (0)