diff --git a/CMakeLists.txt b/CMakeLists.txt index f94f617f23..58eabe7ed5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,8 @@ check_symbol_exists ( fmax "math.h" NO_LIBM ) # code coverage and build type #------------------------------------------------------------------------------- +set (CMAKE_C_FLAGS_RELEASE "-O3 -g") # FIXME + # To compile with test coverage: # cd build # cmake -DCOVERAGE=1 .. @@ -247,6 +249,11 @@ elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" ) #if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0 ) # message ( FATAL_ERROR "icc version must be at least 18.0" ) #endif ( ) +elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang" ) + # options for Apple Clang + # FIXME +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address" ) +# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread" ) elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC" ) # options for clang set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 " ) diff --git a/experimental/test/test_BF.c b/experimental/test/test_BF.c index f4232dcb78..84ab741da6 100644 --- a/experimental/test/test_BF.c +++ b/experimental/test/test_BF.c @@ -151,15 +151,15 @@ void test_BF (void) OK (GrB_Matrix_new (&AT, GrB_FP64, ncols, nrows)) ; OK (GrB_transpose (AT, NULL, NULL, A, NULL)) ; double transpose_time = LAGraph_WallClockTime ( ) - tt ; - fprintf (stderr, "transpose time: %g\n", transpose_time) ; +// fprintf (stderr, "transpose time: %g\n", transpose_time) ; //---------------------------------------------------------------------- // get the source node //---------------------------------------------------------------------- GrB_Index s = 0 ; - fprintf (stderr, "\n==========input graph: nodes: %g edges: %g " - "source node: %g\n", (double) n, (double) nvals, (double) s) ; +// fprintf (stderr, "\n==========input graph: nodes: %g edges: %g " +// "source node: %g\n", (double) n, (double) nvals, (double) s) ; //---------------------------------------------------------------------- // run 1 or 2 trials (2 negative weight cycles) @@ -192,8 +192,8 @@ void test_BF (void) // stop the timer t5 = LAGraph_WallClockTime ( ) - t5 ; t5 = t5 / ntrials; - fprintf (stderr, "BF_full1 time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t5, 1e-6*((double) nvals) / t5) ; +// fprintf (stderr, "BF_full1 time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t5, 1e-6*((double) nvals) / t5) ; //------------------------------------------------------------------ // run LAGraph_BF_full1a before setting the diagonal to 0 @@ -214,8 +214,8 @@ void test_BF (void) // stop the timer t5a = LAGraph_WallClockTime ( ) - t5a ; t5a = t5a / ntrials; - fprintf (stderr, "BF_full1a time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t5a, 1e-6*((double) nvals) / t5a) ; +// fprintf (stderr, "BF_full1a time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t5a, 1e-6*((double) nvals) / t5a) ; //------------------------------------------------------------------ // run LAGraph_BF_full2 before setting the diagonal to 0 @@ -236,8 +236,8 @@ void test_BF (void) // stop the timer t6 = LAGraph_WallClockTime ( ) - t6 ; t6 = t6 / ntrials; - fprintf (stderr, "BF_full2 time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t6, 1e-6*((double) nvals) / t6) ; +// fprintf (stderr, "BF_full2 time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t6, 1e-6*((double) nvals) / t6) ; //------------------------------------------------------------------ // run the LAGraph_BF_full on node s @@ -259,9 +259,9 @@ void test_BF (void) // stop the timer t1 = LAGraph_WallClockTime ( ) - t1 ; t1 = t1 / ntrials; - fprintf (stderr, "BF_full time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t1, 1e-6*((double) nvals) / t1) ; - fprintf (stderr, "t(BF_full1) / t(BF_full): %g\n", t5/t1) ; +// fprintf (stderr, "BF_full time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t1, 1e-6*((double) nvals) / t1) ; +// fprintf (stderr, "t(BF_full1) / t(BF_full): %g\n", t5/t1) ; //------------------------------------------------------------------ // run the BF on node s with LAGraph_BF_basic @@ -280,9 +280,9 @@ void test_BF (void) // stop the timer t2 = LAGraph_WallClockTime ( ) - t2 ; t2 = t2 / ntrials; - fprintf (stderr, "BF_basic time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t2, 1e-6*((double) nvals) / t2) ; - fprintf (stderr, "speedup of BF_basic: %g\n", t1/t2) ; +// fprintf (stderr, "BF_basic time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t2, 1e-6*((double) nvals) / t2) ; +// fprintf (stderr, "speedup of BF_basic: %g\n", t1/t2) ; //------------------------------------------------------------------ // run the BF on node s with LAGraph_pure_c @@ -303,9 +303,9 @@ void test_BF (void) // stop the timer t3 = LAGraph_WallClockTime ( ) - t3 ; t3 = t3 / ntrials; - fprintf (stderr, "BF_pure_c_double : %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t3, 1e-6*((double) nvals) / t3) ; - fprintf (stderr, "speedup of BF_pure_c: %g\n", t1/t3) ; +// fprintf (stderr, "BF_pure_c_double : %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t3, 1e-6*((double) nvals) / t3) ; +// fprintf (stderr, "speedup of BF_pure_c: %g\n", t1/t3) ; if (has_integer_weights) { @@ -337,9 +337,9 @@ void test_BF (void) // stop the timer t4 = LAGraph_WallClockTime ( ) - t4 ; t4 = t4 / ntrials; - fprintf (stderr, "BF_full_mxv time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t4, 1e-6*((double) nvals) / t4) ; - fprintf (stderr, "speedup of BF_full_mxv: %g\n", t1/t4) ; +// fprintf (stderr, "BF_full_mxv time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t4, 1e-6*((double) nvals) / t4) ; +// fprintf (stderr, "speedup of BF_full_mxv: %g\n", t1/t4) ; //------------------------------------------------------------------ // run the BF on node s with LAGraph_BF_basic_mxv @@ -358,9 +358,9 @@ void test_BF (void) // stop the timer t7 = LAGraph_WallClockTime ( ) - t7 ; t7 = t7 / ntrials; - fprintf (stderr, "BF_basic_mxv time: %12.6e (sec), rate:" - " %g (1e6 edges/sec)\n", t7, 1e-6*((double) nvals) / t7) ; - fprintf (stderr, "speedup of BF_basic_mxv: %g\n", t1/t7) ; +// fprintf (stderr, "BF_basic_mxv time: %12.6e (sec), rate:" +// " %g (1e6 edges/sec)\n", t7, 1e-6*((double) nvals) / t7) ; +// fprintf (stderr, "speedup of BF_basic_mxv: %g\n", t1/t7) ; //------------------------------------------------------------------ // run the BF on node s with LAGraph_BF_basic_pushpull diff --git a/experimental/test/test_SquareClustering.c b/experimental/test/test_SquareClustering.c index b4e976aa6c..3e1a340bf4 100644 --- a/experimental/test/test_SquareClustering.c +++ b/experimental/test/test_SquareClustering.c @@ -57,6 +57,8 @@ bool is_close (double a, double b) void test_SquareClustering (void) { LAGraph_Init (msg) ; + GrB_set (GrB_GLOBAL, true, GxB_BURBLE) ; + GrB_Matrix A = NULL ; LAGraph_Graph G = NULL ; diff --git a/experimental/test/test_cdlp.c b/experimental/test/test_cdlp.c index b30dadab45..d75e338736 100644 --- a/experimental/test/test_cdlp.c +++ b/experimental/test/test_cdlp.c @@ -80,11 +80,13 @@ void test_cdlp (void) // compute the communities with LAGraph_cdlp OK (LAGraph_cdlp (&c, G, 100, msg)) ; - GrB_Index n ; OK (GrB_Vector_size (&n, c)) ; LAGraph_PrintLevel pr = (n <= 100) ? LAGraph_COMPLETE : LAGraph_SHORT ; + printf ("\ncdlp (computed result):\n") ; + OK (LAGraph_Vector_Print (c, pr, stdout, msg)) ; + // compute with another method GrB_Vector cgood = NULL ; OK (LAGraph_cdlp_withsort(&cgood, G, 100, msg)) ; OK (GrB_wait (cgood, GrB_MATERIALIZE)) ;