<div dir="ltr"><div dir="ltr"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 17, 2023 at 2:22 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><div><br></div><div>   <a href="https://petsc.org/release/manualpages/Mat/MatPtAP/" target="_blank">https://petsc.org/release/manualpages/Mat/MatPtAP/</a>  also note that PETSc has a large infrastructure for efficient ways to compute various matrix-matrix operations with a variety of algorithms that can be all accessed by starting with <a href="https://petsc.org/release/manualpages/Mat/MatProductCreate/" target="_blank">https://petsc.org/release/manualpages/Mat/MatProductCreate/</a></div><div><br></div><div><br><blockquote type="cite"><div>On Jul 17, 2023, at 1:13 PM, Karthikeyan Chockalingam - STFC UKRI via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div><br><div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Hello,<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">I would like to perform the following operation<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">[P^T A P] x’ = P^T f</div></div></div></blockquote></div></blockquote><div>If P is thin, you might want to consider making a MatLRC and passing that to a Krylov method, probably with a small precondition matrix (like P^T diag(A) P).</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><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Where P is a rectangular matrix and A is a square matrix.  All the matrixes are constructed using MPIAIJ.<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Should I be concerned about the parallel partitioning of the matrix P and A?<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Or can I just go ahead and use MatMatMult to compute [P^T A P]?<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Is there any in-built functionality to perform this operation?<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Kind regards,<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif">Karthik.<u></u><u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></div><div><div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span>-- <u></u><u></u></span></div></div><div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(45,45,98)">Dr. Karthik Chockalingam</span></b><span style="color:rgb(33,33,33)"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(65,65,65)">High-Performance Software Engineer</span><span style="color:rgb(33,33,33)"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(65,65,65)">Hartree Centre | Science and Technology Facilities Council</span><span style="color:rgb(33,33,33)"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(33,33,33)"><a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank"><span style="color:rgb(5,99,193)">karthikeyan.chockalingam@stfc.ac.uk</span></a></span><span style="color:rgb(33,33,33)"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:"Times New Roman",serif"> </span><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(65,65,65)"> </span><span style="color:rgb(33,33,33)"><u></u><u></u></span></div><div style="margin:0cm;font-size:11pt;font-family:Calibri,sans-serif"><b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(65,65,65)"> </span></b><span style="font-size:12pt;font-family:"Times New Roman",serif;color:rgb(31,73,125)"><span id="m_1569987541381583975cid:image001.png@01D9B8D7.C690AD30"><image001.png></span></span></div></div></div></div></div></blockquote></div><br></blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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>