OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
SurfaceSolverFactory.hpp File Reference

Runtime selection of the 2D surface solver backend (Phase 4). More...

#include <memory>
#include <string>
Include dependency graph for SurfaceSolverFactory.hpp:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::twoD
 

Functions

std::unique_ptr< ISurfaceSolveropenswmm::twoD::makeSurfaceSolver (const SolverOptions2D &opts, std::string *chosen=nullptr, int n_cells=0)
 Construct the 2D surface solver per the runtime backend policy.
 

Detailed Description

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.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License