<div dir="ltr"><div>I have a dead lock in MatAssemblyEnd<span style="color:rgb(0,0,0);font-family:monospace">_MPIAIJ</span>.</div><div>It uses <span style="font-family:monospace">nonew</span> as collective :<br></div><div><div><span style="font-family:monospace">if (!((Mat_SeqAIJ*)aij->B->data)->nonew) {</span><br></div><div><font face="monospace">    ierr = MPI_Allreduce( ...</font></div></div><div><br></div><div>this is a good optimization for me, however this value is set by</div><div>MatSetOptions(,MAT_NEW_NONZERO_ALLOCATION_ERR,)<br></div><div><font face="monospace">and t</font>his enum is negative</div>MAT_NEW_NONZERO_ALLOCATION_ERR = -2<br><div>thus it is not asserted as collective by MatSetOption.</div><div><br></div><div><span style="font-family:monospace">Some of my procs have nonew==0 and one has nonew==-2.</span><br></div><div><font face="monospace">I'm not sure why adding new nonzero should be an error only for some procs?</font></div><div><font face="monospace">I suggest that this error flag should be set collectively, so changing the value of the enum to positive (patch 0001).</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">My reel problem was caused by MatShift_MPIAIJ</font><span style="font-family:monospace"> and the way it determine if the matrix need to be preallocated :</span></div><div><font face="monospace">if (!aij->nz && !bij->nz)<br></font></div><div><font face="monospace">the results can be true for some procs (with no local lines)</font></div><div><font face="monospace">and false for other procs.</font></div><div><font face="monospace">I suggest to use Y->preallocated instead (patch 0002).</font></div><div><font face="monospace"><br></font></div><div>thanks,<br></div><div><font face="monospace"><br></font></div><div><font face="monospace">Patrick Lacasse</font></div><div><br></div><div><font face="monospace"><br></font></div><div><font face="monospace"><br></font></div><div><font face="monospace"><br></font></div></div>