NCAR / micm

A model-independent chemistry module for atmosphere models
https://ncar.github.io/micm/
Apache License 2.0
6 stars 4 forks source link

Backware Euler with vectorizable matrix types #596

Closed mattldawson closed 1 month ago

mattldawson commented 1 month ago

Adapts the Backward Euler solver to work with vectorizable matrices.

closes #500

Also:

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.17%. Comparing base (46d0a74) to head (0792e9d). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #596 +/- ## ========================================== - Coverage 93.27% 93.17% -0.11% ========================================== Files 49 49 Lines 3464 3500 +36 ========================================== + Hits 3231 3261 +30 - Misses 233 239 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sjsprecious commented 1 month ago

Running on Derecho with NVHPC, I got the following failed tests:

         34 - analytical_rosenbrock_integration (Failed)
         35 - analytical_backward_euler (Failed)
         38 - cuda_analytical_rosenbrock_integration (Subprocess aborted)

Looking at the output log, the difference is slightly above the given tolerance. I wonder whether we can add a check to the relative error (like https://github.com/NCAR/micm/blob/main/test/unit/solver/test_rosenbrock.cpp#L138-L139) and pass the test if the relative error is small enough (say < 1.e-14?).

mattldawson commented 1 month ago

Running on Derecho with NVHPC, I got the following failed tests:

         34 - analytical_rosenbrock_integration (Failed)
         35 - analytical_backward_euler (Failed)
         38 - cuda_analytical_rosenbrock_integration (Subprocess aborted)

Looking at the output log, the difference is slightly above the given tolerance. I wonder whether we can add a check to the relative error (like https://github.com/NCAR/micm/blob/main/test/unit/solver/test_rosenbrock.cpp#L138-L139) and pass the test if the relative error is small enough (say < 1.e-14?).

I modified the analytical policy tests to include a relative error check and the two CPU tests pass now. Still waiting on the CUDA analytical test to run.

mattldawson commented 1 month ago

Running on Derecho with NVHPC, I got the following failed tests:

         34 - analytical_rosenbrock_integration (Failed)
         35 - analytical_backward_euler (Failed)
         38 - cuda_analytical_rosenbrock_integration (Subprocess aborted)

Looking at the output log, the difference is slightly above the given tolerance. I wonder whether we can add a check to the relative error (like https://github.com/NCAR/micm/blob/main/test/unit/solver/test_rosenbrock.cpp#L138-L139) and pass the test if the relative error is small enough (say < 1.e-14?).

I modified the analytical policy tests to include a relative error check and the two CPU tests pass now. Still waiting on the CUDA analytical test to run.

The CUDA tests now pass with some slightly adjusted tolerances.