[petsc-dev] We need to cleanup viewers

Jed Brown jed at jedbrown.org
Thu Mar 27 11:29:12 CDT 2014


Barry Smith <bsmith at mcs.anl.gov> writes:
>>     I cannot think of a reason not to throw an error for unrecognized viewers.
>
>    That was the old model and it was terrible. Thus we changed to silently ignore unrecognized viewers.

How is this not confusing to users?  If they explicitly call XXView(x,v)
and it does nothing, how do they figure out what is wrong?  Maybe
viewers could have an option marking them as optional?

>> 2) We need to rationalize behavior with conditionally compiled viewers
>> 
>>     Jed proposes a registration process.
>
>     Finally a real system for double dispatch?

I hate the fact that Viewers are not really extensible.  We have a hacky
sort of multiple dispatch in Mat, but we could do it right and improve
Mat performance while we're at it.  Fast implementations in the CL world
are as old as I am, which brings us to

https://en.wikipedia.org/wiki/Greenspun%27s_Tenth_Rule

>> A simpler, but uglier solution is to
>>     protect the dispatch call and speciailzed view function with #ifdef and
>>     provide an error at the dispatch point.
>
>   How are we not doing this now?

There are places in the code where #ifdef is used at a higher level,
creating lots of clutter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140327/2becce8c/attachment.sig>


More information about the petsc-dev mailing list