Skip to content

Commit

Permalink
Tcov; mpfr pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed Mar 5, 2024
1 parent f68b699 commit a998092
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
23 changes: 13 additions & 10 deletions SPEX/Config/Tcov_Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ MPFR_PATH = @MPFR_PATH@

################################################################################

# select the thread-safety mechanism to test: none, openmp, or pthreads.
# select the thread-safety mechanism to test: none, openmp, etc
# none:
# THREADS =
# opemp:
# THREADS = -fopenmp
THREADS = -DSPEX_USE_PTHREADS -pthread
# __thread keyword (gcc and many compilers):
THREADS = -DHAVE_KEYWORD__THREAD

# Linux test coverage (gcc is required for test coverage)
CC = gcc
Expand Down Expand Up @@ -245,17 +248,17 @@ vtests: vtests4llu vtests4chol

# run test for SPEX_LU with valgrind
vtests4llu: all
- $(V) ./spex_demo_lu_extended p 2 q 0 f ../ExampleMats/10teams_mat.txt ../ExampleMats/10teams_v.txt > lu1.out
- $(V) ./spex_demo_lu_extended p 3 q 1 o 1 f ../ExampleMats/10teams_mat.txt ../ExampleMats/10teams_v.txt > lu2.out
- $(V) ./spex_demo_lu_extended p 4 q 2 o 1 f ../ExampleMats/test_mat.txt ../ExampleMats/test_rhs.txt > lu3.out
- $(V) ./spex_demo_lu_extended p 5 f ../ExampleMats/10teams_mat.txt ../ExampleMats/10teams_v.txt > lu4.out
- $(V) ./tcov_for_lu > test_for_lu.out
- $(V) ./tcov_for_lu 0 1 1 > lu5.out

$(V) ./spex_demo_lu_extended q 1 f ../ExampleMats/10teams.mat.txt ../ExampleMats/10teams.rhs.txt > lu1.out
$(V) ./spex_demo_lu_extended q 2 o 1 f ../ExampleMats/10teams.mat.txt ../ExampleMats/10teams.rhs.txt > lu2.out
$(V) ./spex_demo_lu_extended q 3 o 1 f ../ExampleMats/test.mat.txt ../ExampleMats/test.rhs.txt > lu3.out
$(V) ./spex_demo_lu_extended f ../ExampleMats/10teams.mat.txt ../ExampleMats/10teams.rhs.txt > lu4.out
$(V) ./tcov_for_lu > test_for_lu.out
$(V) ./tcov_for_lu 0 1 1 > lu5.out
$(V) ./tcov_for_lu2 ../ExampleMats/Trefethen_500.mat.txt ../ExampleMats/Trefethen_500.rhs.txt > test_for_lu2.out

# run test for SPEX_Cholesky with valgrind
vtests4chol: all
- $(V) ./tcov_for_cholesky ../ExampleMats/872.mat.txt > test_for_cholesky.out
$(V) ./tcov_for_cholesky ../ExampleMats/mesh1e1.mat.txt ../ExampleMats/mesh1e1.rhs.txt > test_for_cholesky.out

#-------------------------------------------------------------------------------

Expand Down
5 changes: 1 addition & 4 deletions SPEX/SPEX_Utilities/Source/SPEX_gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ void *spex_gmp_allocate
// spex_gmp_safe_free: free a block of memory and remove it from the archive
//------------------------------------------------------------------------------

// FIXME: what is this doing?
#define SPEX_MPFR_REAL_PTR(x) (&((x)->_mpfr_d[-1]))

static inline void spex_gmp_safe_free (void *p)
{
if (spex_gmp != NULL)
Expand Down Expand Up @@ -405,7 +402,7 @@ static inline void spex_gmp_safe_free (void *p)
}
if (spex_gmp->mpfr_archive != NULL)
{
if (p == SPEX_MPFR_REAL_PTR(spex_gmp->mpfr_archive))
if (p == SPEX_MPFR_MANT(spex_gmp->mpfr_archive))
{
SPEX_MPFR_MANT(spex_gmp->mpfr_archive) = NULL ;
}
Expand Down
2 changes: 0 additions & 2 deletions SPEX/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

Lorena: test python interface

Tim: test MATLAB interface

Tim: get 100% test coverage

Chris: User Guide
Expand Down

0 comments on commit a998092

Please sign in to comment.