<div dir="ltr">Thank you very much for your inputs.<div><br></div><div>Matthew, this LS is a part of a rSVD algorithm (Halko et al, SIAM Review, 2009), hence I need to compute direct and adjoints system solutions.</div><div><br></div><div>Hong, that is the option I'll be using. I am explicitly setting a transpose for now and this works (at a cost, as you said).</div><div><br></div><div>Barry, I'll also try this solution here, thanks!</div><div><br></div><div>Best,</div><div>Jean</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 9, 2022 at 6:37 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"><div style="overflow-wrap: break-word;"><div><br></div> It would also be very straightforward for you to provide a merge request that adds support for PETSc to directly use SuperLU_DIST and Strumpacks transpose solver capability. Just add the support to superlu_dist.c (and for strumpack) mimicking the style in mumps.c More specifically add a <div><br></div><div>PetscErrorCode MatSolveTranspose_SuperLU_DIST(Mat A,Vec b,Vec x) function almost identical to MatSolveTranspose_MUMPS() but setting </div><div><br></div><div> Mat_SuperLU_DIST *lu=(Mat_SuperLU_DIST*)A->data;</div><div>lu->options.trans = TRANS; </div><div><br></div><div>and register it where the solve is registered later in the file (seach for ops->solve) </div><div><br></div><div>Detailed instructions on making a PETSc MR can be found at <a href="https://petsc.org/release/developers/integration/#getting-your-code-and-documentation-into-petsc" target="_blank">https://petsc.org/release/developers/integration/#getting-your-code-and-documentation-into-petsc</a></div><div><br></div><div><br><div><br><div><br><blockquote type="cite"><div>On Apr 9, 2022, at 8:57 PM, Zhang, Hong 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="overflow-wrap: break-word;">
Jean,
<div><br>
</div>
<div>You can use -ksp_use_explicittranspose to make KSP transpose the system explicitly in the transposed solve. This option was designed to enable more choices of linear solvers and preconditions in adjoint solves, of course, at a cost.</div>
<div><br>
</div>
<div>Hong (Mr.)<br>
<div><br>
<blockquote type="cite">
<div>On Apr 8, 2022, at 4:52 PM, Jean Marques <<a href="mailto:jeanmarques.eng@gmail.com" target="_blank">jeanmarques.eng@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Hi all,
<div><br>
</div>
<div></div>
<div>This may be a naive question, and I hope this is the right place to ask about it.</div>
<div>I need to solve a direct linear system with a sparse matrix R, then an adjoint system the hermitian of R.</div>
<div><br>
</div>
<div>I use a petsc4py, so what I do is this:</div>
<div>self.R.setUp()</div>
<div>to set up the PETSc KSP variable R, then I do:</div>
<div>self.R.solve(f, q)</div>
<div>and later:</div>
<div>self.R.solveTranspose(f, q)<br>
</div>
<div><br>
</div>
<div>However, 'solveTranspose()' only works when I use MUMPS. If I try STRUMPACK or SUPERLU_DIST it fails, it seems that 'solveTranpose()' is not defined for them? or is there a specific way to call them with these libraries?</div>
<div>Maybe the approach would be to define another 'self.R' variable but then set it as a transpose().conjugate() before setUp()?</div>
<div>I was trying STRUMPACK because it has a low-memory approach and that's my main bottleneck.</div>
<div><br>
</div>
<div>I appreciate any help you can provide.</div>
<div><br>
</div>
<div>Best,</div>
<div>Jean<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div style="font-size:12.8px">
<div dir="ltr">
<div style="font-size:12.8px">
<div><b><i>Jean Helder Marques Ribeiro</i></b><br>
</div>
<font>Ph.D. Candidate</font></div>
<div><font>University of California, Los Angeles</font></div>
<font>420 Westwood Plaza, Los Angeles, CA 90095<br>
</font></div>
<div><span style="font-size:12.8px"><font>phone: (310) 689-6593</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div></blockquote></div><br></div></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><div dir="ltr"><div style="font-size:12.8px"><div><b><i>Jean Helder Marques Ribeiro</i></b><br></div><font color="#000000">Ph.D. Candidate</font></div><div><font color="#000000">University of California, Los Angeles</font></div><font color="#000000">420 Westwood Plaza, Los Angeles, CA 90095<br></font></div><div><span style="font-size:12.8px"><font color="#000000">phone: (310) 689-6593</font></span></div></div></div></div></div></div></div></div></div></div></div></div>