[petsc-users] Any workarounds for TAO in a complex scalar type code?

Dener, Alp adener at anl.gov
Thu Jun 24 15:25:26 CDT 2021


Hi Lucas,

In theory, you can attempt to solve complex-valued problems by concatenating the real and imaginary parts into a single real-valued solution vector and solving it as if it’s a real-valued problem.

There’s a more practical issue of the PETSc build excluding the TAO source code entirely for complex builds. I think this is done because we cannot guarantee that TAO code has been completely rigorous in its distinction of PetscReal from PetscScalar. There may be places where we used Scalar and assumed it’s Real. The methods developed in the last few years have paid more attention to this but there’s a lot of older code floating around that might break even if you hacked the build into compiling TAO for complex configurations.

I’m not entirely sure what’s necessary to enable TAO builds for complex PETSc. Perhaps Todd, Satish or Barry will have a better idea. If you want to give it a try though I’d be happy to help you resolve the errors as they come up so that it can be compiled for complex builds. Can’t provide convergence guarantees but it would at least let you attempt a solution.

Alp

On Jun 24, 2021, at 2:44 PM, Lucas Banting <bantingl at myumanitoba.ca<mailto:bantingl at myumanitoba.ca>> wrote:

Hi,

I have a complex valued optimization code that requires non-linear least squares curve fitting at each iteration. I wanted to use Tao to do the non-linear least squares problem, but just discovered that Tao can only be used with real scalar types. Is there any workarounds?

I was wondering if maybe I could somehow use two different Petsc installations at once, or is there any other ways to hack tao into working?

Thanks,
Lucas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210624/6b8391df/attachment-0001.html>


More information about the petsc-users mailing list