[petsc-dev] viewing factored matrices

Barry Smith bsmith at mcs.anl.gov
Fri Nov 22 17:44:43 CST 2013


On Nov 22, 2013, at 2:45 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>   Ok now let’s consider the given case for viewing the matrix. In the
>>   code one could do KPSGetPC(), PCFactorGetMatrix(), MatView() so
>>   anally the option could be -ksp_pc_factor_mat_view and when would
>>   the view get triggered? Well it makes sense right after the
>>   factorization. And if we shorten the option name out completely we
>>   get -mat_view (but we already have a mat_view for the originally
>>   matrix so to prevent problems we could have -factor_mat_view or
>>   -pc_factor_mat_view.
> 
> What about -mg_levels_2_mat_view or -fieldsplit_pressure_mat_view?  If
> the number of levels or the fieldsplit names are obtained automatically
> From the matrix, then the object cannot reasonably exist at
> PCSetFromOptions.  Or is there a way?

  Ahh, but the XXX/PCSetFromOptions for the inner PC IS called after the inner KSP/PC is created! Hence -fieldsplit_pressure_factor_mat_view should work. Search for KSPSetFromOptions() in field split.c and mg.c 

   The key is that the calls to the inner XXXSetFromOptions() are not nested in the calls to the outer XXSetFromOptions() (obviously because the inner ones do not exist when the outer one is called). 

    So there may be some strange corner cases where it is possible for the XXXSetFromOptions() can never get called before for you want the view but I think the normal case is fine.
> 
> 
>> Final note: since someone may want to have -mat_view draw -mat_view
>> ascii in the same run we actually need to maintain a collection of
>> viewers for each trigger point
> 
> The options database doesn't currently work this way.  What interface
> would be use to get those options passed multiple times?

   True. 




More information about the petsc-dev mailing list