<div dir="ltr"><div>Hi, <br></div><div>Sorry for long email. My questions are in the bottom.<br><br></div>I try to use MatMult to multiply a vector to a matrix but I face below problem. <br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Nonconforming object sizes<br>[0]PETSC ERROR: Incompatible partition of A (20) and xx (40)<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[1]PETSC ERROR: Nonconforming object sizes<br>[1]PETSC ERROR: Incompatible partition of A (20) and xx (40)<br>[1]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[1]PETSC ERROR: Petsc Release Version 3.6.3, unknown <br></blockquote><div><br></div><div>I use 2 process for this. I check the local ranges with VecGetOwnershipRange and MatGetOwnershipRange commands and they reveal that the matrix is distributed between processes while the vector is exist completely on both processes.<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">in rank:1, vector start:0, end:40, matrix start:20, end:40<br>in rank:0, vector start:0, end:40, matrix start:0, end:20<br></blockquote><div><br></div><div>I created the vector "vol_" using below commands.<br>   Vec vol_;<br>    VecCreateMPI(PETSC_COMM_SELF, PETSC_DECIDE, size_,&vol_);<br>    VecSet(vol_,val);           //Sets all components of a vector to a single scalar value.<br>    VecAssemblyBegin(vol_);<br>    VecAssemblyEnd(vol_);<br><br></div><div><b>My questions:</b><br></div><div>A- What should I do differently to create a scattered vector in the first place?<br></div><div>B- If my vector initialization is ok, what should I do now to scatter the vector among the processes? <br>I saw the VecScatter function, but I am not sure how to use it, if it is the right function.<br><br></div><div>Best,<br></div><div>Ehsan<br></div><div><br></div></div></div>