AMReX-Astro / Microphysics

common astrophysical microphysics routines with interfaces for the different AMReX codes
https://amrex-astro.github.io/Microphysics
Other
34 stars 33 forks source link

Update `autodiff::dual` to give the same results as `amrex::Real` #1612

Closed yut23 closed 1 month ago

yut23 commented 1 month ago

In my testing with converting the aprox* rates to use autodiff, I found a lot of instances where code templated with autodiff::dual would give slightly different values than the same code templated with amrex::Real. It turns out to be due to some optimizations autodiff makes to speed up evaluation, which this PR disables to avoid any weird inconsistencies in the future.

zingale commented 1 month ago

this is upstreamed here: https://github.com/autodiff/autodiff/pull/352

zingale commented 1 month ago

test suite: http://groot.astro.sunysb.edu/Microphysics/test-suite/gfortran/2024-07-16-001/index.html

zingale commented 1 month ago

all of the test_rhs diffs are roundoff error level