ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SBMOwnership.H
Go to the documentation of this file.
1 #ifndef ERF_SBM_OWNERSHIP_H_
2 #define ERF_SBM_OWNERSHIP_H_
3 
4 #include "ERF_IndexDefines.H"
5 
6 #include <string>
7 
8 namespace erf_sbm {
9 
10 enum class HostWritePath {
11  Advection,
12  Diffusion,
13  Source,
14  Positivity,
16  Wall,
17  Boundary
18 };
19 
20 [[nodiscard]] const char* host_write_path_name (HostWritePath path) noexcept;
21 
22 /** The native host retains qv; SBM exclusively owns the compact liquid lanes. */
23 [[nodiscard]] bool host_write_allowed (bool sbm_active, int component) noexcept;
24 
25 /** Check every component in a native writer's complete, non-empty write range. */
26 [[nodiscard]] bool host_write_range_allowed (bool sbm_active, int start_component,
27  int num_components) noexcept;
28 
29 /** Fail closed when a native host writer reaches a component owned by SBM. */
30 void require_host_write_allowed (bool sbm_active, int component, HostWritePath path);
31 
32 /** Fail closed when any component in a native writer's range is owned by SBM. */
33 void require_host_write_range_allowed (bool sbm_active, int start_component,
34  int num_components, HostWritePath path);
35 
36 } // namespace erf_sbm
37 
38 #endif
Definition: ERF.H:108
HostWritePath
Definition: ERF_SBMOwnership.H:10
bool host_write_range_allowed(const bool sbm_active, const int start_component, const int num_components) noexcept
Definition: ERF_SBMOwnership.cpp:28
bool host_write_allowed(const bool sbm_active, const int component) noexcept
Definition: ERF_SBMOwnership.cpp:23
void require_host_write_allowed(const bool sbm_active, const int component, const HostWritePath path)
Definition: ERF_SBMOwnership.cpp:41
void require_host_write_range_allowed(const bool sbm_active, const int start_component, const int num_components, const HostWritePath path)
Definition: ERF_SBMOwnership.cpp:47
const char * host_write_path_name(const HostWritePath path) noexcept
Definition: ERF_SBMOwnership.cpp:9