define ice diag_ functions for multi_CUDA backend#485
define ice diag_ functions for multi_CUDA backend#485pdziekan wants to merge 1 commit intoigfuw:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the multi_CUDA backend diagnostics surface to match existing ice-related diagnostics available in the single-GPU (CUDA) backend, by adding the missing wrapper methods that dispatch via pimpl->mcuda_run(...).
Changes:
- Added
multi_CUDAwrappers for ice shape range-selection diagnostics (diag_ice_a_rng,diag_ice_c_rng) and their consecutive-selection variants. - Added
multi_CUDAwrappers for ice shape moment diagnostics (diag_ice_a_mom,diag_ice_c_mom) and ice mixing ratio (diag_ice_mix_ratio). - Added a
multi_CUDAwrapper fordiag_precip_rate_ice_mass.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const real_t &r_mi, const real_t &r_mx | ||
| ) | ||
| { | ||
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_a_rng, r_mi, r_mx); | ||
| } | ||
|
|
||
| template <typename real_t> | ||
| void particles_t<real_t, multi_CUDA>::diag_ice_c_rng( | ||
| const real_t &r_mi, const real_t &r_mx | ||
| ) | ||
| { | ||
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_c_rng, r_mi, r_mx); |
There was a problem hiding this comment.
In these ice selection helpers, the parameters are named r_mi/r_mx, but they represent ice shape radii ("a" equatorial and "c" polar). Renaming them (e.g., a_mi/a_mx and c_mi/c_mx) would make the intent clearer and match the naming used in the public declarations in particles.hpp and the single-GPU implementation.
| const real_t &r_mi, const real_t &r_mx | |
| ) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_a_rng, r_mi, r_mx); | |
| } | |
| template <typename real_t> | |
| void particles_t<real_t, multi_CUDA>::diag_ice_c_rng( | |
| const real_t &r_mi, const real_t &r_mx | |
| ) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_c_rng, r_mi, r_mx); | |
| const real_t &a_mi, const real_t &a_mx | |
| ) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_a_rng, a_mi, a_mx); | |
| } | |
| template <typename real_t> | |
| void particles_t<real_t, multi_CUDA>::diag_ice_c_rng( | |
| const real_t &c_mi, const real_t &c_mx | |
| ) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_c_rng, c_mi, c_mx); |
| void particles_t<real_t, multi_CUDA>::diag_ice_c_mom(const int &k) | ||
| { | ||
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_c_mom, k); | ||
| } | ||
|
|
||
| template <typename real_t> | ||
| void particles_t<real_t, multi_CUDA>::diag_ice_a_mom(const int &k) | ||
| { | ||
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_a_mom, k); |
There was a problem hiding this comment.
The moment diagnostics are implemented in c-then-a order here, while the rest of the API and the single-GPU implementation use a-then-c ordering. Reordering these two wrappers to keep diag_ice_a_mom adjacent and before diag_ice_c_mom would make the file easier to scan and keep the multi-GPU backend consistent with other backends.
| void particles_t<real_t, multi_CUDA>::diag_ice_c_mom(const int &k) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_c_mom, k); | |
| } | |
| template <typename real_t> | |
| void particles_t<real_t, multi_CUDA>::diag_ice_a_mom(const int &k) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_a_mom, k); | |
| void particles_t<real_t, multi_CUDA>::diag_ice_a_mom(const int &k) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_a_mom, k); | |
| } | |
| template <typename real_t> | |
| void particles_t<real_t, multi_CUDA>::diag_ice_c_mom(const int &k) | |
| { | |
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_c_mom, k); |
| template <typename real_t> | ||
| void particles_t<real_t, multi_CUDA>::diag_ice_mix_ratio() | ||
| { | ||
| pimpl->mcuda_run(&particles_t<real_t, CUDA>::diag_ice_mix_ratio); | ||
| } |
There was a problem hiding this comment.
New multi-GPU wrappers are added for ice-related diagnostics (e.g., diag_ice_mix_ratio, diag_precip_rate_ice_mass, and the new diag_ice_[ac]_rng[_cons] / diag_ice_[ac]_mom). There don't appear to be any tests exercising these diagnostics on the multi_CUDA backend; consider adding a GPU-optional test (skip when multi_CUDA is unavailable) that enables ice_switch and smoke-tests these calls and their basic output invariants (e.g., non-negative, non-NaN).
No description provided.