[petsc-users] Newbie Question - Really slow - PetscMemCpy
Jed Brown
jed at 59A2.org
Thu Apr 22 10:16:11 CDT 2010
On Thu, 22 Apr 2010 10:11:52 -0500, Matthew Knepley <knepley at gmail.com> wrote:
> Also, you can go in with the debugger and see what is happening. I am
> guessing you switch the matrix you are using (so options do not take
> effect), or recreate it, etc.
Matt, the type is not actually set until *both* MatSetSizes() and
MatSetType() are called (note the caching of mat->ops->create). This is
a case of being flexible about initialization order coming back to bite.
Rather than trying to cache options, I'd like to make it an error to
call MatSetOption() before the type is actually set.
Jed
More information about the petsc-users
mailing list