-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initialize and finalize and destroy #155
Comments
I see no reason why this would be done. In the testing we do this but with a |
PETSc supports this. It is done sometimes in practice because someone uses PETSc within a larger code and wants to encapsulate as much as possible, so they initialize and finalize PETSc for each solve. Is it already an issue without the second |
That is true, but we catch it with a check to see if PETSc is finalized Lines 191 to 195 in 73f12e0
OK. I have a few ideas for how to work around this, so will leave the issue open. Some smarter people than me may weigh in as well. |
Do we ever see a use case where we might have something like:
I ask because this can cause problems with the garbage collector in when it's used. For instance, if the garbage collector is run on a PETSc object allocated in the first chunk of work AFTER petsc has been re-initialized this is an error since the actual PETSc object doesn't exist anymore. The
destroy
has a check for whether PETSc is finalized, but this will not catch PETSc having been re-initialized.The text was updated successfully, but these errors were encountered: