You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They are well-designed and cleanly separate the "physics" (the right-hand-side) from the "math" (the ODE solver itself). The advantage of these solvers is that are all templated on the number of equations to solve (plus other parameters, like the floating point datatype), so we don't need to set any compile-time parameters like we have to do for Microphysics.
For example, the Newton solver can be called for each cell like this:
Big caveat: this would add a dependency on Kokkos, which might be tricky, since Kokkos is designed to interact with the GPU in a similar way to AMReX. We need to check whether it's possible to call Kokkos::ODE from within amrex::ParallelFor.
Alternatively, we could AMReXify the Kokkos-Kernels source code: we need to replace the KOKKOS_* macros with their AMREX_* equivalents, and replace Kokkos:: functions with AMReX equivalents, and then copy these headers into src/math. The difficult part is that we also need to do this for the Kokkos BLAS functions, which are highly nontrivial.
Describe alternatives you've considered
Keep using our custom ODE solvers.
Additional context
We can use the Kokkos ODE solvers to replace:
the Runge-Kutta ODE solver for cooling
the Newton-Raphson solver we use for radiation, and
the VODE ODE solver we use for chemistry
The text was updated successfully, but these errors were encountered:
Describe the proposal
It should clean up the code a lot if we switch to using the Kokkos-Kernels ODE solvers (https://github.com/kokkos/kokkos-kernels/tree/develop/ode) and Newton-Raphson solver (https://github.com/kokkos/kokkos-kernels/blob/develop/ode/impl/KokkosODE_Newton_impl.hpp).
They are well-designed and cleanly separate the "physics" (the right-hand-side) from the "math" (the ODE solver itself). The advantage of these solvers is that are all templated on the number of equations to solve (plus other parameters, like the floating point datatype), so we don't need to set any compile-time parameters like we have to do for Microphysics.
For example, the Newton solver can be called for each cell like this:
Big caveat: this would add a dependency on Kokkos, which might be tricky, since Kokkos is designed to interact with the GPU in a similar way to AMReX. We need to check whether it's possible to call
Kokkos::ODE
from withinamrex::ParallelFor
.Alternatively, we could AMReXify the Kokkos-Kernels source code: we need to replace the
KOKKOS_*
macros with theirAMREX_*
equivalents, and replaceKokkos::
functions with AMReX equivalents, and then copy these headers intosrc/math
. The difficult part is that we also need to do this for the Kokkos BLAS functions, which are highly nontrivial.Describe alternatives you've considered
Keep using our custom ODE solvers.
Additional context
We can use the Kokkos ODE solvers to replace:
The text was updated successfully, but these errors were encountered: