On Sat, Jan 21, 2012 at 8:44 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Sat, Jan 21, 2012 at 20:37, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">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> 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><div>At has been there since the beginning of time (revision 0).</div>
<div class="im"><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
<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><div>Unfortunately, I think this is the only viable choice.</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<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></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>
</blockquote></div><br>I think we should try to draw out the complete state machine for Mat. This of-the-cuff reasoning obviously does not<div>work when things get complicated.</div><div><br></div><div> Matt<br clear="all">
<div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>
</div>