barbagroup/PetIBM

[factorization] `make check` passes but log file reports errors

mesnardo opened this issue · 1 comments

Branch: factorization.
Problem with unit-tests.
Tests were run with gtest-1.7.0.

make check does not return any error (the tests pass), however, the log file tests/mesh/cartesianmesh-test.log reports some PETSc errors for the tests CartesianMeshTest2D_AllDirichlet and CartesainMeshTest2D_YPeriodic.
(Note that the name of the group of tests, CartesainMeshTest2D_YPeriodic, has a typo and should be renamed CartesianMeshTest2D_YPeriodic.)

Error message:

[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Object is in wrong state
[0]PETSC ERROR: Clearing DM of global vectors that has a global vector obtained with DMGetGlobalVector()
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.8.1, Nov, 04, 2017 
[0]PETSC ERROR: Unknown Name on a linux-gnu-openmpi-dbg named phantom by mesnardo Mon Jan  8 15:02:59 2018
[0]PETSC ERROR: Configure options --PETSC_DIR=/home/mesnardo/src/petsc/3.8.1 --PETSC_ARCH=linux-gnu-openmpi-dbg --with-mpi-dir=/home/mesnardo/src/openmpi/1.8.8/linux-gnu-opt-install --COPTFLAGS=-O0 --CXXOPTFLAGS=-O0 --FOPTFLAGS=-O0 --with-debugging=1 --download-fblaslapack --download-hypre --download-hdf5 --download-superlu_dist --download-parmetis --download-metis --download-ptscotch --with-x=1
[0]PETSC ERROR: #1 DMClearGlobalVectors() line 196 in /home/mesnardo/src/petsc/3.8.1/src/dm/interface/dmget.c
[0]PETSC ERROR: #2 DMDestroy() line 661 in /home/mesnardo/src/petsc/3.8.1/src/dm/interface/dm.c
[0]PETSC ERROR: #3 ~MeshBase() line 29 in /home/mesnardo/git/barbagroup/PetIBM/src/mesh/mesh.cpp

Although all test fixtures are passing correctly, the error happens when destroying the mesh in the TearDownTestCase method.
If we skip mesh.~shared_ptr(), the error goes away.

Any idea @piyueh ?

That does not surprise me, though I haven't looked into it. Since we improved the destructors and destroyers of the classes in the factorization branch, we should not call ~shared_ptr() explicitly. And actually, calling ~shared_ptr() explicitly is not recommended by Stack Overflow ...

I forgot to check the destructors of those unit-tests at that time. I'll check it.