<div dir="ltr"><div dir="ltr">On Mon, Nov 9, 2020 at 9:44 AM Antoine Côté <<a href="mailto:Antoine.Cote3@usherbrooke.ca">Antoine.Cote3@usherbrooke.ca</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">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Hi,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
I would like to retrieve the values of a column in a sparse Mat created with DMCreateMatrix(). I currently use MatGetColumnVector() to store values in a Vec "A". A computation is later made on each value in <span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">"A",
and the results are stored in another Vec "B" (that was initialized at "0.0" using VecSet()).</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Code works fine on a single process. When I try multiple processes, some values are ignored i.e. Vec "B" contains the right results for some positions, while others stay at "0.0". I suspect it is because MatGetColumnVector() is "Not Collective".</div></div></blockquote><div><br></div><div>I do not think that is it. It looks like GetColumnVector() works in parallel, but it is just not optimal:</div><div><br></div><div> <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/mat/utils/getcolv.c.html#MatGetColumnVector">https://www.mcs.anl.gov/petsc/petsc-current/src/mat/utils/getcolv.c.html#MatGetColumnVector</a></div><div><br></div><div>I would</div><div><br></div><div> 1) Check that the column vector you get back is the one you expect</div><div><br></div><div> 2) Check that your computation on A is parallelized</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">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
What would be the best workaround?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Thank you very much,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Antoine Côté</div>
</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>