[petsc-dev] viewing factored matrices

Barry Smith bsmith at mcs.anl.gov
Fri Nov 22 13:24:42 CST 2013


On Nov 22, 2013, at 10:40 AM, Matthew Knepley <knepley at gmail.com> wrote:

> On Fri, Nov 22, 2013 at 10:33 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>   Hmm, since under normal usage the factored matrix is owned by one of the PCFactor subclass objects do we actually want the PCFactor subclass to manage the viewing of them from the command line and not the “Mat” directly ? Something like   -pc_factor_mat_view xxx    ?    I think this approach would lead to clean simple code, while trying to force it through the MatSetFromOptions() to get the viewer would be convoluted since the factored matrix may not exist when PCSetFromOptions() is called and creating that matrix early (while possible) doesn’t seem the right model. I prefer -pc_factor_mat_xxx options rather than -mat_xx options for anything related to the factored matrix.
> 
> So I assume you would have PCFactor set the prefix of the matrix to prefix+"pc_factor_" and call MatViewFromOptions() inside the PCView()?

   No, I don’t think so. XXXView() has no business calling a YYSetFromOptions() or YYYViewFromOptions(). In fact I go so far as saying MatViewFromOptions() should be removed.

 I thought we were adopting the model that only XXSetFromOptions() queried the database, not any old random function?

    We need to completely separate the time of check for the view option from the data base from the time the view is actually done.   Hence XXXSetFromOptions() needs to snag the -xxx_view information and store it. Then later the viewing call is actually made. So for example SNESSetFromOptions() should get the viewer chosen in the options database and then the end of SNESSolve() would see if the viewer existed and then call SNESView(). Currently in lots of places (like SNES) we actually have SNESSolve() check the database and immediately call the SNESView() if requested, I think this is wrong.    

   Now normally PCView_Factor() would call MatView() on the factored matrix (by default with the default minimal ASCII output, just like PCView() calls MatView() on the original matrix) (I don’t know why it doesn’t now). If you want more info you can set the PetscViewerFormat to have it print more information about the factored matrix.

   I was wrong to suggest -pc_factor_mat_view, we don’t need that or want it I think.




 

   Barry


> 
>    Matt
>  
>   Sound ok?
> 
>    Barry
> 
> 
> On Nov 22, 2013, at 9:59 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 
> > Barry, at some point in your of Mat viewers, factored matrices became
> > disconnected form -mat_view.  PCLU does not call MatSetFromOptions() on
> > the factored matrix and we don't want to do a MatSetFromOptions() on
> > each iteration.  Should MatGetFactor() be restructured to take a Mat
> > that has already been created, so that it can have options set once?
> 
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener




More information about the petsc-dev mailing list