<div dir="ltr"><span style="font-size:12.8px">Bikash,</span><br><div><span style="font-size:12.8px">I implemented </span><span style="color:rgb(80,0,80);font-size:12.8px">MatTransposeMatMult_MPIDense_</span><span style="color:rgb(80,0,80);font-size:12.8px">MPIDense() </span></div><div><span style="color:rgb(80,0,80);font-size:12.8px">in the branch </span><font color="#500050"><span style="font-size:12.8px">hzhang/mattransmatmult_dense.</span></font></div><div><font color="#500050"><span style="font-size:12.8px">Once it passes our nightly tests, I'll merge it to petsc master branch.</span></font></div><div><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div><font color="#500050"><span style="font-size:12.8px">See petsc/src/mat/examples/tests/ex104.c, in which I added a simple </span></font></div><div><font color="#500050"><span style="font-size:12.8px">example doing</span></font></div><div><span style="font-size:12.8px">B = P^T * A * P, where P is an MPIDENSE matrix and A is an MPIAIJ matrix. </span><font color="#500050"><span style="font-size:12.8px"><br></span></font></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Let us know if you see any bug or performance issues.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Hong</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 16, 2015 at 10:25 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Hong <<a href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>> writes:<br>
<br>
> Jed:<br>
>><br>
>><br>
>> > I plan to implement MatTransposeMatMult_MPIDense_MPIDense via<br>
>> ><br>
>> > 1. add MatTransposeMatMult_elemental_elemental()<br>
>> > 2. C_dense = P_dense^T * B_dense<br>
>> >     via MatConvert_dense_elemental() and MatConvert_elemental_dense()<br>
>><br>
>> The above involves a ton of data movement and MPIDense is a logical<br>
>> distribution for matrices with a modest number of columns.  I think I<br>
>> would just do the local GEMM and then MPI_Reduce_scatter it.<br>
>><br>
> This would work.<br>
><br>
> However, I recall that you did a smart ordering which allows<br>
> MatConvert_mpidense_elemental() uses same physical matrix storage for petsc<br>
> and elemental,<br>
<br>
</span>Same storage for vectors.  This is your code, but I think you'll find<br>
that it moves the matrix entries around.  (Note that Elemental [MC,MR]<br>
is a 2D distribution while MPIDense is 1D.)  Also, I think it would be<br>
better if this particular operation did not depend on Elemental.<br>
<br>
You could write a conversion to Elemental [VC,*], which would then match<br>
the MPIDense distribution and thus not need to move any matrix entries.<br>
</blockquote></div><br></div>