Skip to content

Commit ca51cf4

Browse files
Merge pull request GraphBLAS#300 from GraphBLAS/with_GraphBLAS_v10
fix leak in test_Coarsen_matching; add more to "make memcheck"
2 parents 42fcded + a7d3134 commit ca51cf4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ test: library
7676
verbose_test: library
7777
( cd build && ctest . --verbose || ctest . --rerun-failed --output-on-failure )
7878

79-
memcheck: debug
79+
# memcheck: compile with -g and no OpenMP (the latter gives spurious leaks from
80+
# dlopen and dlinit), and run the tests with valgrind. For best results,
81+
# compile GraphBLAS without OpenMP and with the JIT disabled.
82+
memcheck: distclean
83+
( cd build && cmake $(CMAKE_OPTIONS) -DCMAKE_BUILD_TYPE=Debug -DLAGRAPH_USE_OPENMP=0 .. )
84+
( cd build && cmake --build . --config Release -j${JOBS} )
8085
( cd build && ctest . -T memcheck )
8186

8287
# target used in CI

experimental/test/test_Coarsen_Matching.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ void test_Coarsen_Matching () {
132132
OK (LAGraph_Free ((void**)(&rows), msg)) ;
133133
OK (LAGraph_Free ((void**)(&cols), msg)) ;
134134
OK (LAGraph_Free ((void**)(&vals), msg)) ;
135+
OK (GrB_wait (A, GrB_MATERIALIZE)) ;
135136

136137
// ================== graph generation done ======================================
137138

@@ -163,6 +164,7 @@ void test_Coarsen_Matching () {
163164
GrB_Matrix A_fp32 = NULL ;
164165
OK (GrB_Matrix_new (&A_fp32, GrB_FP32, n, n)) ;
165166
OK (GrB_assign (A_fp32, NULL, NULL, G->A, GrB_ALL, n, GrB_ALL, n, NULL)) ;
167+
OK (GrB_free (&(G->A))) ;
166168
OK (GrB_free (&(G->AT))) ;
167169
G->A = A_fp32 ;
168170
A_fp32 = NULL ;

0 commit comments

Comments
 (0)