![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Functions | |
| int | logicalCpus () |
| Query OS-visible logical CPU concurrency. | |
| int | ompMaxThreads () |
| Query the current calling-context OpenMP maximum. | |
| int | ompAvailable () |
| Report whether engine OpenMP support was compiled. | |
| int | perfCores () |
| Query macOS performance-cluster logical CPU count. | |
| int | kokkosOmpThreads () |
| Read the engine-recorded Kokkos OpenMP team hint. | |
| void | setKokkosOmpThreads (int n) |
| Store the engine-recorded Kokkos OpenMP team hint. | |
| int | hostReservedThreads () |
| Read host thread reservation from the current environment. | |
| bool | isOversubscribed (int threads) |
| Compare a team plus host reservation with known logical concurrency. | |
| int | resolveRequested (int requested, const char *what, std::vector< std::string > *warnings) |
| Resolve a thread request and optionally append oversubscription diagnostics. | |
| int | dwThreads (int requested, int n_conduits, std::vector< std::string > *warnings) |
| Resolve a dynamic-wave team request with model-size and automatic core caps. | |
| int | twoDThreads (int requested, int n_triangles, std::vector< std::string > *warnings) |
| Resolve a 2D marcher team request using core and triangle-count heuristics. | |
Variables | |
| constexpr int | kMinConduitsPerThread = 100 |
| int openswmm::threadinfo::dwThreads | ( | int | requested, |
| int | n_conduits, | ||
| std::vector< std::string > * | warnings ) |
Resolve a dynamic-wave team request with model-size and automatic core caps.
Applies model-size cap to explicit and automatic requests, warning only for explicit reductions. Exactly requested=0 additionally caps to performance cores minus two on macOS when that count exceeds two. Negative requests use OpenMP maximum without that auto-only clamp.
| [in] | requested | Requested team size; <=0 resolves from OpenMP maximum. Exactly zero additionally enables automatic core-clamp heuristics. |
| [in] | n_conduits | Conduit count used in floor(count/100), normalized to a minimum one-worker cap. |
| [in,out] | warnings | Optional caller-owned sink; new messages append without clearing existing entries. |
| int openswmm::threadinfo::hostReservedThreads | ( | ) |
Read host thread reservation from the current environment.
Value is read on every call; trailing nonnumeric bytes accepted by atoi are not separately rejected. Caller avoids environment mutation races and out-of-int-range tokens.
| bool openswmm::threadinfo::isOversubscribed | ( | int | threads | ) |
Compare a team plus host reservation with known logical concurrency.
| [in] | threads | Team count; caller keeps threads+hostReservedThreads() representable as int. |
| int openswmm::threadinfo::kokkosOmpThreads | ( | ) |
Read the engine-recorded Kokkos OpenMP team hint.
Does not query or initialize the plugin/runtime.
| int openswmm::threadinfo::logicalCpus | ( | ) |
Query OS-visible logical CPU concurrency.
| int openswmm::threadinfo::ompAvailable | ( | ) |
Report whether engine OpenMP support was compiled.
| int openswmm::threadinfo::ompMaxThreads | ( | ) |
Query the current calling-context OpenMP maximum.
Does not create a team or guarantee that the runtime will provide this many workers.
| int openswmm::threadinfo::perfCores | ( | ) |
Query macOS performance-cluster logical CPU count.
| int openswmm::threadinfo::resolveRequested | ( | int | requested, |
| const char * | what, | ||
| std::vector< std::string > * | warnings ) |
Resolve a thread request and optionally append oversubscription diagnostics.
For positive requests, warns when request+host reservation exceeds known logical CPUs; otherwise warns above the current OpenMP maximum. On macOS can additionally warn above performance-cluster size. No actual runtime team is changed. Caller keeps request+reservation representable as int.
| [in] | requested | Requested team size; <=0 resolves from OpenMP maximum. Exactly zero additionally enables automatic core-clamp heuristics. |
| [in] | what | Borrowed non-null NUL-terminated activity label used in formatted warnings. |
| [in,out] | warnings | Optional caller-owned sink; new messages append without clearing existing entries. |
| void openswmm::threadinfo::setKokkosOmpThreads | ( | int | n | ) |
Store the engine-recorded Kokkos OpenMP team hint.
Uses relaxed atomic storage; provides no synchronization for plugin initialization or other engine state.
| [in] | n | Team count; nonpositive values store zero. |
| int openswmm::threadinfo::twoDThreads | ( | int | requested, |
| int | n_triangles, | ||
| std::vector< std::string > * | warnings ) |
Resolve a 2D marcher team request using core and triangle-count heuristics.
Exactly requested=0 applies the macOS performance-core-minus-two cap before the mesh test. Positive requests reduced by the mesh test append a diagnostic. Negative requests skip the auto-only core cap.
| [in] | requested | Requested team size; <=0 resolves from OpenMP maximum. Exactly zero additionally enables automatic core-clamp heuristics. |
| [in] | n_triangles | Triangle count; recommends one worker when n_triangles<4*resolved team. Caller keeps that product representable as int. |
| [in,out] | warnings | Optional caller-owned sink; new messages append without clearing existing entries. |
|
constexpr |
Minimum conduits of momentum work per dynamic-wave team thread before an extra thread pays for its barriers (PERFORMANCE-ONLY; bit-identical).