2

For a unit test, I'm trying to make sure that a PETSc vector has been destroy. However, I can't seem to find an adequate command that does this gracefully. The best I've been able to do is call VecSetType(...) and look at the error. However, this write PETSC_ERROR output, that I do not want to be written, particularly since I'm expecting an error. Any thoughts or suggestions?

Thanks.

2 Answers2

1

I am not an experienced PetSc user but I know that XDestroy functions are equating the Vec, Mat etc. to NULL. I guess you may compare your VEC with NULL. For me, I'm using a finalizer class to make sure that everything is cleaned up properly. Hope works

Semih Ozmen
  • 571
  • 5
  • 20
0

you can run the code with -log_summary. The profiling information constitute a table for how many vectors have been created and how many of them have been destroyed.

Nazi
  • 67
  • 1
  • 7