<p dir="ltr">Hi Barry,</p>
<p dir="ltr">I'm sorry, I should have provided more details. </p>
<p dir="ltr">Matrix A defined in my problem is of size NxN and I have N vectors v_i, each of length N, which are to be multiplied by A. N is fairly small 10000-50000. Ideally speaking, it doesn't require parallel storage. But I will soon exhaust memory by storing both A and v_i's sequentially. So I planned to implement it through a sub-communiator as this Mat-Vec(s) operation(s) is part of a bigger problem which requires a greater degree of parallelization. </p>
<p dir="ltr">My ghost points are physical grid points, FEM nodal points to be exact. So I have a list of nodes whose data is required on a given processor to perform evaluation of any physical quantity. It is through this list that I decide the ghost points (I check if the global ids of these nodes are within the ownership range for the PETSc partioning or not).  </p>
<p dir="ltr">Now depending upon the number of processors I put into my sub-communicator, the percentage of non-local data I'll require will range from 5-10%.</p>
<p dir="ltr">I hope I'm able to put forth my problem properly and adequately.</p>
<p dir="ltr">Thanks,<br>
Bikash<br>
</p>
<div class="gmail_quote">On Oct 16, 2015 11:49 AM, "Barry Smith" <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Oct 16, 2015, at 7:52 AM, Bikash Kanungo <<a href="mailto:bikash@umich.edu">bikash@umich.edu</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I need to multiply a matrix A with several vectors v_i's and use the resultant vectors in my calculation which involves access to non-local nodes.<br>
<br>
   What percentage of the "non-local" results do you need in "your calculation", a few percent, all of them? How do you know which "non-local" results you will need for "your calculation"? Are they ghost points on a grid? Something else?<br>
<br>
    What is "several vectors"? 5? 100? 1000?<br>
<br>
  Barry<br>
<br>
> I can think of two possible ways to do it:<br>
><br>
> 1. Store the vectors v_i's into an MPIDENSE matrix and perform MatMatMult with A to get a resultant dense matrix B. I can now use MatGetSubMatrices on B to access the non-local part required in my subsequent calculations.<br>
><br>
> 2. Use MatMult to evaluate A*v_i for each of the vectors and provide ghost padding through VecCreateGhost for the resultant vector.<br>
><br>
> Which of the two is a more efficient way to perform the task? Also, if there is a better way possible to achieve the same, then kindly let me know.<br>
><br>
> Thanks,<br>
> Bikash<br>
><br>
> --<br>
> Bikash S. Kanungo<br>
> PhD Student<br>
> Computational Materials Physics Group<br>
> Mechanical Engineering<br>
> University of Michigan<br>
><br>
<br>
</blockquote></div>