trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.19k stars 564 forks source link

Trilinos no longer builds with Scalar=complex<float> #4196

Open mhoemmen opened 5 years ago

mhoemmen commented 5 years ago

@trilinos/tpetra @trilinos/amesos2

I found this out when testing Amesos2. See e.g., #4194.

Current Behavior

Tpetra and downstream classes do not build with Scalar=complex<float>. I get errors of the form discussed here: https://github.com/kokkos/kokkos/issues/1964 . The case Scalar=Kokkos::complex<double> still works, because it uses a different overload of these Kokkos functions that does not attempt to put the output type in a union with unsigned long long int.

Motivation and Context

Sierra currently enables complex<float> in its Trilinos build. This error also showed up in #4194, since Amesos2 was incorrectly attempting to build with Scalar=complex<float>, even though it was not enabled in Tpetra.

Possible Solution

I am working on a work-around, namely to overload Kokkos::Impl::atomic_fetch_oper and Kokkos::Impl::atomic_oper_fetch specifically for Kokkos::complex<float>.

Steps to Reproduce

Set the CMake option Trilinos_ENABLE_COMPLEX_FLOAT:BOOL=ON.

Related Issues

mhoemmen commented 5 years ago
mhoemmen commented 5 years ago

@dsunder is working on a fix in Kokkos. See discussion here: https://github.com/kokkos/kokkos/issues/1964 . For now, I plan on just submitting fixes to Tpetra's tests (e.g., 42.0*z doesn't compile if z is complex<float>; that breaks some tests). I don't want code to compile unless I know that it works, so I'd rather not submit the compilation work-around for now.

crdohrm commented 5 years ago

Hi guys, Salinas uses Tpetra with complex matrices for frequency domain analyses.

crdohrm commented 5 years ago

Oops, hit the wrong button. Will Reopen and comment.

mhoemmen commented 5 years ago

@crdohrm wrote:

Hi guys, Salinas uses Tpetra with complex matrices for frequency domain analyses.

complex<double>, complex<float>, or both?

Answer carefully -- every Scalar type you want adds to the build time.

crdohrm commented 5 years ago

Looks like we only use complex<double> for Tpetra

mhoemmen commented 5 years ago

@crdohrm wrote:

Looks like we only use complex for Tpetra

complex<double> or complex<float>?

theguruat12 commented 5 years ago

I show build errors both with Trilinos_ENABLE_COMPLEX=OFF (which I expect based on @crdohrm's responses).

Building with Trilinos_ENABLE_COMPLEX_DOUBLE=ON causes the previously discussed (with @mhoemmen) issues with UMFPACK built without complex support.

crdohrm commented 5 years ago

Sorry about that. Only complex<float> for Tpetra.

crdohrm commented 5 years ago

Looks like the text inside <> gets omitted in my comments.

What I meant to say is that we only use Tpetra with complex double. We do not use Tpetra with complex float. Sorry for the confusion.

mhoemmen commented 5 years ago

Thanks @crdohrm !

Best practice is to enclose code-like text in backquotes. For example: complex<double>.

mhoemmen commented 5 years ago

@rrdrake @theguruat12 @trilinos/framework Please note Clark's comments above.

srajama1 commented 5 years ago

@ndellingwood

github-actions[bot] commented 3 years ago

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity. If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label. If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE. If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

mhoemmen commented 3 years ago

revive?

csiefer2 commented 2 years ago

Is anyone actually using complex+float ?