<div dir="ltr">Hi Barry,<div><br></div><div> is MatSetOption still logically collective?</div><div>Shouldn't this code :</div><div><br></div><div><div> if (op > 0) PetscValidLogicalCollectiveEnum(mat,op,2);</div>
<div> PetscValidLogicalCollectiveBool(mat,flg,3);</div><div><br></div><div>be :</div><div><br></div><div><div> if (op > 0) {</div><div> PetscValidLogicalCollectiveEnum(mat,op,2);</div><div>
PetscValidLogicalCollectiveBool(mat,flg,3);</div><div> }</div><div><br></div><div style>Could this be part of the next release patch?</div><div><br></div><div>thks,</div><div><br></div><div>Patrick</div></div>
<div><br></div><div><br></div><div><br></div><div><br>
</div><div> </div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/10/4 Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Fixed, supposedly in petsc-dev<br>
<div class="HOEnZb"><div class="h5"><br>
On Sep 26, 2012, at 1:47 PM, Patrick Lacasse <<a href="mailto:patrick.m.lacasse@gmail.com">patrick.m.lacasse@gmail.com</a>> wrote:<br>
<br>
> Thanks Barry for your answer,<br>
><br>
> Patrick<br>
><br>
> 2012/9/20 Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br>
><br>
> Patrick,<br>
><br>
> We may have gone overboard with our assertions in this routine.<br>
><br>
> Some MatOptions really should be collective while others like the one you are using need not be collective.<br>
><br>
> Simple solution just remove those two collective asserts. Harder solution, use the asserts for only the options that should be checked. We could for example use less then some number for collective asserts and greater than number for for non collective. A little hacky but would work?<br>
><br>
> Barry<br>
><br>
><br>
><br>
> On Sep 20, 2012, at 11:42 AM, Patrick Lacasse <<a href="mailto:patrick.m.lacasse@gmail.com">patrick.m.lacasse@gmail.com</a>> wrote:<br>
><br>
> > Hi,<br>
> ><br>
> > I just discovered that the way we assemble our matrix cause a deadlock in MatSetOption<br>
> > when petsc is compiled with debugging option enabled.<br>
> ><br>
> > I resume :<br>
> > - We loop over elements.<br>
> > - For each element we create a small elementary matrix.<br>
> > - We assemble the elementary matrix with MatSetValues into the big one.<br>
> ><br>
> > Sometimes, we have some rectangular elementary matrix that needs to be added twice,<br>
> > the second time it is transposed. The big matrix is not symmetric for many possible reasons.<br>
> > We are essentially doing it for every elementary matrix that needs it :<br>
> ><br>
> > MatSetOption(mat,MAT_ROW_ORIENTED,true)<br>
> > MatSetValues(...)<br>
> > MatSetOption(mat,MAT_ROW_ORIENTED,false)<br>
> > MatSetValues(...)<br>
> ><br>
> > Of course, it fails (deadlock) in MatSetOption at assertion<br>
> > PetscValidLogicalCollectiveEnum(mat,op,2);<br>
> > because different process don't loop over the same (number of) elements.<br>
> > However, it is working fine without the assertion.<br>
> ><br>
> > I have two question :<br>
> > Is there really a risk to call MatSetOption(mat, MAT_ROW_ORIENTED, flg) on only one process?<br>
> > What can I do now?<br>
> ><br>
> > Some possible answer are<br>
> > - Close our eyes and stop compiling petsc with debugging option enabled.<br>
> > - We could copy our elementary matrix into a transposed one before to MatSetValues. We don't want do this cause we think it would slow down our code.<br>
> > - Could MatSetValues has a bonus argument row_oriented?<br>
> > - Could the assertions in MatSetOption be skipped for some options?<br>
> > - Could we add a function MatSetRowOriented which would not be collective?<br>
> ><br>
> > thanks,<br>
> ><br>
> > Patrick Lacasse<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>