<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></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 class=""><br class=""></div><div class="">PetscErrorCode MatSolveTranspose_SuperLU_DIST(Mat A,Vec b,Vec x) function almost identical to MatSolveTranspose_MUMPS() but setting </div><div class=""><br class=""></div><div class=""> Mat_SuperLU_DIST      *lu=(Mat_SuperLU_DIST*)A->data;</div><div class="">lu->options.trans = TRANS; </div><div class=""><br class=""></div><div class="">and register it where the solve is registered later in the file (seach for ops->solve) </div><div class=""><br class=""></div><div class="">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" class="">https://petsc.org/release/developers/integration/#getting-your-code-and-documentation-into-petsc</a></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 9, 2022, at 8:57 PM, Zhang, Hong via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class="">

<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Jean,
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Hong (Mr.)<br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 8, 2022, at 4:52 PM, Jean Marques <<a href="mailto:jeanmarques.eng@gmail.com" class="">jeanmarques.eng@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi all,
<div class=""><br class="">
</div>
<div class=""></div>
<div class="">This may be a naive question, and I hope this is the right place to ask about it.</div>
<div class="">I need to solve a direct linear system with a sparse matrix R, then an adjoint system the hermitian of R.</div>
<div class=""><br class="">
</div>
<div class="">I use a petsc4py, so what I do is this:</div>
<div class="">self.R.setUp()</div>
<div class="">to set up the PETSc KSP variable R, then I do:</div>
<div class="">self.R.solve(f, q)</div>
<div class="">and later:</div>
<div class="">self.R.solveTranspose(f, q)<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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 class="">Maybe the approach would be to define another 'self.R' variable but then set it as a transpose().conjugate() before setUp()?</div>
<div class="">I was trying STRUMPACK because it has a low-memory approach and that's my main bottleneck.</div>
<div class=""><br class="">
</div>
<div class="">I appreciate any help you can provide.</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Jean<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div style="font-size:12.8px" class="">
<div dir="ltr" class="">
<div style="font-size:12.8px" class="">
<div class=""><b class=""><i class="">Jean Helder Marques Ribeiro</i></b><br class="">
</div>
<font class="">Ph.D. Candidate</font></div>
<div class=""><font class="">University of California, Los Angeles</font></div>
<font class="">420 Westwood Plaza, Los Angeles, CA 90095<br class="">
</font></div>
<div class=""><span style="font-size:12.8px" class=""><font class="">phone: (310) 689-6593</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>

</div></blockquote></div><br class=""></div></div></body></html>