Skip to content

Commit

Permalink
Adding triangle_count tests for gyro_m & dwt_59
Browse files Browse the repository at this point in the history
  • Loading branch information
byjtew committed Jun 14, 2023
1 parent 744bb18 commit d88227c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/graphblas/algorithms/triangle_count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <graphblas.hpp>

constexpr bool Debug = true;
constexpr bool Debug = false;

namespace grb {

Expand All @@ -46,7 +46,7 @@ namespace grb {
template< class Iterator >
void printSparseMatrixIterator( size_t rows, size_t cols, Iterator begin, Iterator end, const std::string & name = "", std::ostream & os = std::cout ) {
std::cout << "Matrix \"" << name << "\" (" << rows << "x" << cols << "):" << std::endl << "[" << std::endl;
if( rows > 1000 || cols > 1000 ) {
if( rows > 100 || cols > 100 ) {
os << " Matrix too large to print" << std::endl;
} else {
// os.precision( 3 );
Expand Down
21 changes: 19 additions & 2 deletions tests/smoke/smoketests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ for BACKEND in ${BACKENDS[@]}; do
fi
echo " "

echo ">>> [x] [ ] Testing the Triangle couting algorithm."
echo ">>> [x] [ ] Testing the Triangle couting algorithm on the dwt_59.mtx"
if [ -f ${INPUT_DIR}/dwt_59.mtx ]; then
$runner ${TEST_BIN_DIR}/triangle_count_${BACKEND} ${INPUT_DIR}/dwt_59.mtx 30 &> ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log
$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
head -1 ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log
if ! grep -q 'Test OK' ${TEST_OUT_DIR}/triangle_count_dwt_59_${BACKEND}_${P}_${T}.log; then
echo "Test FAILED"
Expand All @@ -355,6 +355,23 @@ for BACKEND in ${BACKENDS[@]}; do
fi
echo " "

echo ">>> [x] [ ] Testing the Triangle couting algorithm on the gyro_m.mtx"
if [ -f ${INPUT_DIR}/gyro_m.mtx ]; then
$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
head -1 ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log
if ! grep -q 'Test OK' ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log; then
echo "Test FAILED"
elif ! grep -q '11 iterations to converge' ${TEST_OUT_DIR}/triangle_count_gyro_m_${BACKEND}_${P}_${T}.log; then
echo "Verification FAILED"
echo "Test FAILED"
else
echo "Test OK"
fi
else
echo "Test DISABLED: gyro_m.mtx was not found. To enable, please provide ${INPUT_DIR}/gyro_m.mtx"
fi
echo " "

if [ "$BACKEND" = "bsp1d" ] || [ "$BACKEND" = "hybrid" ]; then
echo "Additional standardised smoke tests not yet supported for the ${BACKEND} backend"
echo
Expand Down

0 comments on commit d88227c

Please sign in to comment.