<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I think that the test<div><br></div><div><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; font-family: Consolas, Menlo, 'Liberation Mono', Courier, monospace; line-height: 1.4; color: rgb(51, 51, 51); widows: 1; background-color: rgb(255, 255, 255); position: static; z-index: auto;">if ((diag != 0.0) && (mat->A->rmap->N == mat->A->cmap->N)) {</pre><div><br></div></div><div>at line 836 in src/mat/impls/aij/mpi/mpiaij.c (master) is a bug, either for rectangular matrices or even for square matrices with non-trivial layouts.<div><br></div><div>It can happen that some of the processes does not satisfy the test and some others do; in this case, MatAssemblyBegin/End is not  collectively called.</div><div><br></div><div>I don’t see any trivial fix; my solution involves computing a flag during MatSetSizes() based on some test on the ranges of the row and column layouts.</div><div>I will go on and fix it in a branch unless someone has a simpler solution.</div><div><br></div><div><br></div><div><br></div><div><br><div><div><div><br></div></div></div></div></div></body></html>