<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Great !<br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>"Hong" <hzhang@mcs.anl.gov><br><b>À: </b>"Franck Houssen" <franck.houssen@inria.fr><br><b>Cc: </b>"Stefano Zampini" <stefano.zampini@gmail.com>, "petsc-dev" <petsc-dev@mcs.anl.gov><br><b>Envoyé: </b>Vendredi 23 Juin 2017 18:08:08<br><b>Objet: </b>Re: [petsc-dev] [petsc-users] How to compute RARt with A and R as distributed (MPI) matrices ?<br><div><br></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Franck:</div><div class="gmail_quote">See</div><div class="gmail_quote"><a href="https://bitbucket.org/petsc/petsc/commits/f3dcd100076caffe0af33a424f0d06cb26a76989" target="_blank" data-mce-href="https://bitbucket.org/petsc/petsc/commits/f3dcd100076caffe0af33a424f0d06cb26a76989">https://bitbucket.org/petsc/petsc/commits/f3dcd100076caffe0af33a424f0d06cb26a76989</a><br data-mce-bogus="1"></div><div class="gmail_quote"><br></div><div class="gmail_quote">Hong<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" data-mce-style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;"><div><div style="font-family:"times new roman","new york",times,serif;font-size:12pt;color:rgb(0,0,0)" data-mce-style="font-family: 'times new roman','new york',times,serif; font-size: 12pt; color: #000000;"><div><br></div><hr id="gmail-m_110663948843201625zwchr"><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>"Hong" <<a href="mailto:hzhang@mcs.anl.gov" target="_blank" data-mce-href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>><br><b>À: </b>"Stefano Zampini" <<a href="mailto:stefano.zampini@gmail.com" target="_blank" data-mce-href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</a>><br><b>Cc: </b>"Franck Houssen" <<a href="mailto:franck.houssen@inria.fr" target="_blank" data-mce-href="mailto:franck.houssen@inria.fr">franck.houssen@inria.fr</a>>, "petsc-dev" <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank" data-mce-href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>><br><b>Envoyé: </b>Vendredi 23 Juin 2017 16:59:42<span class="gmail-"><span class="gmail-"><br><b>Objet: </b>Re: [petsc-dev] [petsc-users] How to compute RARt with A and R as distributed (MPI) matrices ?<br></span></span><div><br></div><div dir="ltr">Due to petsc sparse matrix block row distribution among processes,<div>we do not have an efficient way to implement parallel R * A * R^T </div><div>(explicit transpose of R is very expensive).</div></div></blockquote><div><br></div><div>This sentence above is a perfect candidate to add in the doc : 1 line, 1 sentence that enables the user to understand WHY he must not use matRARt if he has a distributed matrix in hand (= to understand WHY this is not implemented and will throw an error).<br></div><div><div class="gmail-h5"><div><br></div><div><br></div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div dir="ltr"><div><br></div><div>For P^t * A * P=P^t *(AP), we do local transpose P^t and sum (partical P^t_local *(AP). </div><div><br></div><div>I agree that a completed documentation would help users; but in reality, with so few developers, so many PETSc functions collected over the years, each of function has various implementations, implementations are changes frequently ....</div><div><br></div><div>We keep object operation tables in PETSc. When user invokes a non-supported implementation, the execution throughs an error message. User is informed from testing instead of reading user manual to find out which detailed implementation is supported. We also provide instant email support for user's request. </div><div><br></div><div>We'll try to maintain an update user manual and welcome bug/error report. I'll check the manual on <span style="font-size:12.8px" data-mce-style="font-size: 12.8px;">MatRARt/PtAP to make it clear to users.</span></div><div><span style="font-size:12.8px" data-mce-style="font-size: 12.8px;"><br></span></div><div><span style="font-size:12.8px" data-mce-style="font-size: 12.8px;">Hong<br></span><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 7:13 AM, Stefano Zampini <span dir="ltr"><<a href="mailto:stefano.zampini@gmail.com" target="_blank" data-mce-href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" data-mce-style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;"><span class="gmail-m_110663948843201625gmail-"><br> > On Jun 23, 2017, at 10:10 AM, Franck Houssen <<a href="mailto:franck.houssen@inria.fr" target="_blank" data-mce-href="mailto:franck.houssen@inria.fr">franck.houssen@inria.fr</a>> wrote:<br> ><br> > By the way, I noticed this is exactly the same for MatRARt/PtAPNumeric/Symbolic: pages of the documentation are identical, so the user can not understand why to use the RARt or the PtAP.<br> <br> </span>MatRARt computes: R * A * R^T<br> MatPtAP computes: P^t * A * P<br><div><br></div>they perform different operations<br><span class="gmail-m_110663948843201625gmail-"><br> > I believe adding a short note in MatRARt/PtAP pages and MatRARt/PtAPNumeric/Symbolic would be welcome to say "this method is meant to do/support this but not that”.<br> <br> </span>An operation like RARt (or PtAP) may have a specialized implementation, or be available though composition of operatotions, i.e. PtAP = P^t * (A * P) or compute transpose of P (explicitly) and then call the triple matrix product.<br> It’s not possible to keep track of all the possible cases.<br><div class="gmail-m_110663948843201625gmail-HOEnZb"><div class="gmail-m_110663948843201625gmail-h5"><br> ><br><div><br></div>> Franck<br> ><br> > ----- Mail original -----<br> >> De: "Jed Brown" <<a href="mailto:jed@jedbrown.org" target="_blank" data-mce-href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>><br> >> À: "Hong" <<a href="mailto:hzhang@mcs.anl.gov" target="_blank" data-mce-href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>><br> >> Cc: "petsc-dev" <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank" data-mce-href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>>, "PETSc users list" <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" data-mce-href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br> >> Envoyé: Jeudi 22 Juin 2017 18:17:33<br> >> Objet: Re: [petsc-dev] [petsc-users] How to compute RARt with A and R as distributed (MPI) matrices ?<br> >><br> >> Hong <<a href="mailto:hzhang@mcs.anl.gov" target="_blank" data-mce-href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>> writes:<br> >><br> >>> Jed:<br> >>>><br> >>>>>> Is it better this way or as a fallback when !A->ops->rart? MatPtAP<br> >>>>>> handles other combinations like MAIJ.<br> >>>>>><br> >>>>><br> >>>>> Do you mean<br> >>>>> if ( !A->ops->rart) {<br> >>>>> Mat Rt;<br> >>>>> ierr = MatTranspose(R,MAT_INITIAL_MATRIX,&Rt);CHKERRQ(ierr);<br> >>>>> ierr = MatMatMatMult(R,A,Rt,scall,fill,C);CHKERRQ(ierr);<br> >>>>> ierr = MatDestroy(&Rt);CHKERRQ(ierr);<br> >>>>> }<br> >>>>> This does NOT work for most matrix formats because we do not have<br> >>>> fallbacks<br> >>>>> for MatTranspose() and MatMatMult().<br> >>>><br> >>>> That's fine; they'll trigger an error and we'll be able to see from the<br> >>>> stack that it can be made to work by either implementing the appropriate<br> >>>> MatRARt or MatTranspose and MatMatMatMult.<br> >>>><br> >>><br> >>> You prefer adding this default, even though it gives error in either<br> >>> MatTranspose() or MatMatMatMult() depends on input matrix format?<br> >><br> >> Yeah, in the sense that it gives more opportunities to succeed.<br> >><br> >>> If so, we need add this type of 'default' to all mat operations --<br> >>> currently, all routines do<br> >>> if (!mat->ops-> )<br> >>> SETERRQ1(PetscObjectComm((PetscObject)mat),PETSC_ERR_SUP,"Mat type<br> >>> %s",((PetscObject)mat)->type_name);<br> >><br> >> Probably.<br> >><br><div><br></div></div></div></blockquote></div><br></div></div></div></blockquote><div><br></div></div></div></div></div></blockquote></div><br></div></div></blockquote><div><br></div></div></body></html>