<div dir="ltr"><div dir="ltr">On Thu, May 7, 2020 at 4:37 PM Emmanuel Ayala <<a href="mailto:juaneah@gmail.com">juaneah@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, I hope everyone is well.<br><br>I have a MPI vector, I selected some elements of this vector and for some processes there is not selected elements (I stored the indices elements into an array). So, I wan to to create a MPI vector using these selected elements, the selected elements must be fully distributed in a MPI vector, but I do not figure out how to do it properly. <br><br>If I use VecGetSubVector, it creates a MPI vector, but in those processes where there is not selected elements, the subvector portion is empty, this means that the resultant vector is unbalanced.<br></div></blockquote><div><br></div><div>Yes, you cannot use SubVector.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">If I use:<br><br>VecScatterCreate(Vec x,IS ix,Vec y,IS iy,VecScatter *ctx);<br>VecScatterBegin(VecScatter ctx,Vec x,Vec y,INSERT VALUES,SCATTER FORWARD);<br>VecScatterEnd(VecScatter ctx,Vec x,Vec y,INSERT VALUES,SCATTER FORWARD);<br><br>The vector is still unbalanced.<br></div></blockquote><div><br></div><div>You have not sent the elements to the places that you really wanted. VecScatter moves the elements that you ask for</div><div>to the place you tell it. If you want them to be balanced, you must send them to balanced locations using iy.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Any suggestion?<br><br>Kind regards.</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>