<div class="gmail_quote">On Fri, Nov 26, 2010 at 01:29, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The easiest fix would be to put MatPreallocated() at the beginning of MatGetSizes() and whatever else doesn't have it. I don't know if there would be any bad side affects to making this change.</blockquote></div>
<div><br></div><div>The problem is that MatGetSize() is not collective.</div><br><div>Is it really necessary to have preallocation be the same as knowing the sizes? What I didn't notice is that, while there is still ops->setsizes, none of the implementations use it any more. I thought the idea was that MatCreate_X would set up the layout if the sizes had been set, otherwise it would drop its callback into ops->setsizes, and set up the layout when the user subsequently called MatSetSizes (where this dispatch logic still is). I didn't realize/remember that it was actually MatCreate_X that was registered in the callback. That of course causes trouble because you MatSetType(A,MATAIJ) and then calls to MATSeqAIJXXX are ignored.</div>
<div><br></div><div>I know it is some added implementation complexity, but how about calling MatCreate_X directly in MatSetType, and have an independent ops->setsizes which will set up the layout?</div><div><br></div><div>
Jed</div>