Skip to content
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

PETSc options treatment #144

Closed
jkozdon opened this issue Jul 14, 2021 · 2 comments
Closed

PETSc options treatment #144

jkozdon opened this issue Jul 14, 2021 · 2 comments

Comments

@jkozdon
Copy link
Member

jkozdon commented Jul 14, 2021

The way the library is currently written the PETSc options are not universally set, but turned on and off for different operations.

I don't know enough about PETSc, but is this a good design decision? Is it possible that the options won't carry through properly when we need them?

For example

PETSc.jl/src/snes.jl

Lines 48 to 62 in 38552ba

function SNES{$PetscScalar}(comm::MPI.Comm; kwargs...)
@assert initialized($petsclib)
opts = Options($petsclib, kwargs...)
snes = SNES{$PetscScalar, $PetscLib}(C_NULL, opts, nothing, nothing, nothing, nothing, nothing)
@chk ccall((:SNESCreate, $libpetsc), PetscErrorCode, (MPI.MPI_Comm, Ptr{CSNES}), comm, snes)
with(snes.opts) do
setfromoptions!(snes)
end
if comm == MPI.COMM_SELF
finalizer(destroy, snes)
end
return snes
end

Is this mainly needed when things are created?

@boriskaus or @psanan you have any thoughts?

My inclination right now is to leave it as is, but wanted to start a discussion in case this became important or a problem.

@boriskaus
Copy link
Collaborator

boriskaus commented Jul 14, 2021 via email

@jkozdon jkozdon closed this as completed Jul 14, 2021
@psanan
Copy link
Contributor

psanan commented Jul 15, 2021

Right - the "options database" is a key-value store which is used to set up solvers, as @boriskaus says, and can also be directly used by the user if they want to define their own command line options. In normal usage there is a single (formerly global) options database that's used for everything, but there can be multiple ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants