<div class="gmail_quote">On Sat, Jan 21, 2012 at 20:37, 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">
<div id=":1bb">  We cannot have MatPreallocated() inside MatSetValues() because MatSetValues() is not collective but MatPreallocated() ->  MatSetUpPreallocation() -> MatMPIAIJSetPreallocation() is collective.<br>
<br>
   Likely this bug has been around a long time but Jed's changes to preallocation business has exposed it.<br></div></blockquote><div><br></div><div>At has been there since the beginning of time (revision 0).</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1bb">
<br>
   How to fix?<br>
<br>
1)       Error out if non preallocated matrix sent to MatSetValues()?   Yuck?  Cause this means user must then always call MatPreallocated() or MatSetUp() before ever using it.<br>
               MatCreate()<br>
               MatSetSizes()<br>
               MatSetType()<br>
               MatSetUp()   or MatXXXSetPreallocation() or MatSetUpPreallocation()<br>
               use<br></div></blockquote><div><br></div><div>Unfortunately, I think this is the only viable choice.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1bb">
<br>
2)       Pray every one always calls MatSetValues() on each process if not preallocating and make sure internally we never screw up. Yuck.</div></blockquote></div><br><div>I fear that this causes deadlock only when someone strong scales the job up to where they get an empty process. That is the kind of bug that is hard to find and can burn too many cycles to risk.</div>