![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Runtime selection of the 2D surface solver backend (Phase 4). More...
#include <memory>#include <string>Go to the source code of this file.
Namespaces | |
| namespace | openswmm |
| namespace | openswmm::twoD |
Functions | |
| std::unique_ptr< ISurfaceSolver > | openswmm::twoD::makeSurfaceSolver (const SolverOptions2D &opts, std::string *chosen=nullptr, int n_cells=0) |
| Construct the 2D surface solver per the runtime backend policy. | |
Runtime selection of the 2D surface solver backend (Phase 4).
Resolves which ISurfaceSolver to construct based on the OPENSWMM_2D_BACKEND policy, discovering and dlopen()ing a GPU plugin when one is present and usable, and falling back to the serial CPU CvodeSurfaceSolver otherwise. This is the runtime half of docs/2D_GPU_PORTABLE_CVODE_STRATEGY.md §4.2 — the core stays Kokkos/GPU-free; the device backend lives entirely in a separately built plugin loaded here at runtime.
Selection policy (env OPENSWMM_2D_BACKEND, case-insensitive): unset / "auto" : try device plugins (cuda, hip, sycl) in order; if none load with a usable device, use the CPU solver. The CPU-threaded "omp" plugin is NOT auto-selected (it would change numerics on a machine that merely has it installed) — request it explicitly. "cpu" : always the serial CPU solver (no discovery). "omp"|"cuda"|"hip"|"sycl" : load exactly that plugin; if it is absent or has no usable device, warn and fall back to CPU (never hard-fail on GPU absence).
Plugin search path: OPENSWMM_GPU_PLUGIN_PATH (os-separated list), then the directory of the engine shared library, then its gpu subdirectory.