<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi, Hong<br>
<br>
Thank you. If there is no bug for using PLAPACK for matrix-matrix multiplications, I will try :-) Thanks again.<br>
<br>
Cheers<br>
<br>
Gao<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF979655"><font color="#000000" face="Tahoma" size="2"><b>From:</b> Hong Zhang [hzhang@mcs.anl.gov]<br>
<b>Sent:</b> Thursday, April 05, 2012 5:39 PM<br>
<b>To:</b> Gao Bin<br>
<b>Cc:</b> PETSc users list<br>
<b>Subject:</b> Re: [petsc-users] question about MatMatMultTranspose<br>
</font><br>
</div>
<div></div>
<div>Bin :
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-size:10pt; font-family:Tahoma"><br>
Thank you! From <font><span style="font-size:10pt">Barry's email, </span></font>I have learned that PETSc aims at sparse matrix. Therefore, I may consider using MatGetArray() for further parallel calculations, or using Elemental/PLAPACK for dense matrix calculations.
 I notice PETSc could use PLAPACK, but if I understand correctly, that has only been implemented for LU, Cholesky decomposition, not matrix-matrix multiplications (although it looks to be simple).<span class="Apple-style-span" style="font-family:arial; font-size:small">&nbsp;</span></div>
</div>
</blockquote>
<div>&nbsp;</div>
<div>We do have</div>
<div>MatMatMult_MPIDense_MPIDense() in ~petsc/src/mat/impls/dense/mpi/mpidense.c.</div>
<div>i.e., we tried to interface&nbsp;<span class="Apple-style-span" style="font-family:Tahoma; font-size:14px">PLAPACK's dense&nbsp;</span><span class="Apple-style-span" style="font-family:Tahoma; font-size:14px">matrix-matrix multiplication.</span></div>
<div>However, in&nbsp;MatMatMultSymbolic_MPIDense_MPIDense():</div>
<div>SETERRQ(((PetscObject)A)-&gt;comm,PETSC_ERR_LIB,&quot;Due to apparent bugs in PLAPACK,this is not currently supported&quot;);</div>
<div>Therefore, this does not work.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-size:10pt; font-family:Tahoma"><br>
As regards my question, I am sorry that I need<br>
<br>
<div><span style="font-family:Tahoma; font-size:14px"><span style="font-family:arial; font-size:small"><font face="Tahoma">C_seqdense =</font>&nbsp;<span style="font-family:Tahoma; font-size:14px">A_seqdense*B_seqdense^T<br>
</span></span></span>
<div><span style="font-family:Tahoma; font-size:14px"><span style="font-family:arial; font-size:small"><font face="Tahoma">C_seqdense =</font>&nbsp;<span style="font-family:Tahoma; font-size:14px">A_seqdense^T*B_seqdense<br>
</span></span></span></div>
</div>
</div>
</div>
</blockquote>
<div>&nbsp;</div>
<div>These are purely dense computation, &nbsp;<span class="Apple-style-span" style="font-family:Tahoma; font-size:14px">Elemental/PLAPACK should be used.</span></div>
<div><span class="Apple-style-span" style="font-family:Tahoma; font-size:14px">Hong</span></div>
<div><font class="Apple-style-span" face="Tahoma"><br>
</font></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-size:10pt; font-family:Tahoma">
<div>
<div><span style="font-family:Tahoma; font-size:14px"><span style="font-family:arial; font-size:small"><span style="font-family:Tahoma; font-size:14px"><br>
<br>
Gao</span></span></span><br>
</div>
</div>
<div style="font-size:16px; font-family:Times New Roman">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma"><b>From:</b> Hong Zhang [<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>]<br>
<b>Sent:</b> Thursday, April 05, 2012 4:30 PM<br>
<b>To:</b> Gao Bin<br>
<b>Cc:</b> PETSc users list
<div>
<div class="h5"><br>
<b>Subject:</b> Re: [petsc-users] question about MatMatMultTranspose<br>
</div>
</div>
</font><br>
</div>
<div>
<div class="h5">
<div></div>
<div>Bin :
<div>We do not have plan for supporting parallel (mpiaij format)
<div>C =&nbsp;<span style="font-family:Tahoma; font-size:14px">A*B^T</span></div>
<div><span style="font-family:Tahoma; font-size:14px">because sparse inner product is too expensive, and we have parallel C = A^T*B.</span></div>
<div><span style="font-family:Tahoma; font-size:14px"><br>
</span></div>
<div><font face="Tahoma">For sequential&nbsp;</font>C =&nbsp;<span style="font-family:Tahoma; font-size:14px">A*B^T, currently we only support&nbsp;</span></div>
<div><font face="Tahoma"><span style="font-family:arial">C_seqaij =&nbsp;<span style="font-family:Tahoma; font-size:14px">A_seqaij*B_seqaij^T</span></span></font></div>
<div><font face="Tahoma"><span style="font-family:arial"><span style="font-family:Tahoma; font-size:14px"><br>
</span></span></font></div>
<div><font face="Tahoma">Do you want&nbsp;</font></div>
<div><font face="Tahoma">C_seqdense =</font>&nbsp;<span style="font-family:Tahoma; font-size:14px">A_seqaij*B_seqaij^T</span></div>
<div><span style="font-family:Tahoma; font-size:14px">or&nbsp;</span></div>
<div><span style="font-family:Tahoma; font-size:14px"><span style="font-family:arial; font-size:small"><font face="Tahoma">C_seqdense =</font>&nbsp;<span style="font-family:Tahoma; font-size:14px">A_seqaij*B_seqdense^T?</span></span></span></div>
<div><font face="Tahoma"><br>
</font></div>
<div><font face="Tahoma">Hong</font></div>
<div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-size:10pt; font-family:Tahoma"><br>
Good to know it is simpler ;-) I am switching to the developed version and try it. Again, thank you very much.<br>
<br>
P.S., Moreover, I notice that some functions is not for MATMPIDENSE. May I ask if they are too difficult to implement (for instance, C=A*B^T and C=A^T*B for MATMPIDENSE)? Thank you.<br>
<br>
Cheers<br>
<br>
Gao<br>
<div style="font-size:16px; font-family:Times New Roman">
<hr>
<div style="direction:ltr"><font color="#000000" face="Tahoma">
<div><b>From:</b> <a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">
petsc-users-bounces@mcs.anl.gov</a> [<a href="mailto:petsc-users-bounces@mcs.anl.gov" target="_blank">petsc-users-bounces@mcs.anl.gov</a>] on behalf of Jed Brown [<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>]<br>
</div>
<b>Sent:</b> Thursday, April 05, 2012 2:32 PM<br>
<b>To:</b> PETSc users list; Hong Zhang
<div><br>
<b>Subject:</b> Re: [petsc-users] question about MatMatMultTranspose<br>
</div>
</font><br>
</div>
<div>
<div>
<div></div>
<div>
<div class="gmail_quote">On Thu, Apr 5, 2012 at 05:16, Gao Bin <span dir="ltr">&lt;<a href="mailto:bin.gao@uit.no" target="_blank">bin.gao@uit.no</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div style="direction:ltr; font-size:10pt; font-family:Tahoma">Thank you for your quick reply. But as pointed out at
<a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatMatTransposeMult.html" target="_blank">
http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatMatTransposeMult.html</a>:<br>
<br>
This routine is currently only implemented for pairs of SeqAIJ matrices. C will be of type MATSEQAIJ.<br>
<br>
Therefore I can not use it for dense matrix, am I right? If so, will MatMatTransposeMult be extended for other types of matrix later on? Thank you very much.</div>
</blockquote>
</div>
<br>
<div>This is much simpler than the sparse case. Hong, did you intend to get around to this?</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>