<div dir="ltr"><div> In a PETSc example (<a href="http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex10.c.html">ex10.c</a>) one MatLoad A and then VecLoad b from a viewer. Since one can change mat block size through option -matload_block_size, the code tries to pad b if A and b's sizes mismatch, using the following test</div><div><pre width="80" style="color:rgb(0,0,0);font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><a name="line186">186: </a> MatGetSize(A,&M,NULL);
<a name="line187">187: </a> VecGetSize(b,&m);
<a name="line188">188: </a> <font color="#4169E1">if</font> (M != m) { <font color="#B22222">/* Create a new vector b by padding the old one */</font></pre> I think the code is wrong. One has to compare local column size of A and local size of b, and if there is a mismatch on ANY processor, then one has to create a new b.</div><div> My questions are: Are users supposed to take this complexity? Does PETSc provide a neat way to do that, for example, MatVecLoad(A,b,viewer)</div><div><br></div><div> Thanks.</div><div>--Junchao Zhang<br></div></div>