include/pops/runtime/program/module_metadata.hpp Source FileΒΆ
|
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
|
module_metadata.hpp
Go to the documentation of this file.
5// alongside ``GeneratedProgram`` (the installed step), a ``GeneratedModule`` descriptor: the typed
6// operator registry the Python codegen emits (pops.time.Program._emit_module_metadata) as a set of
7// ``extern "C"`` accessors. This header reads that descriptor from an already-dlopen'd handle, for
8// INTROSPECTION and install-time requirement validation. It is read ONCE at install; the step body
12// read_module_metadata returns ``present == false`` and the caller simply skips module introspection.
121 detail::module_names(dl_handle, "pops_module_state_space_count", "pops_module_state_space_name");
123 detail::module_names(dl_handle, "pops_module_field_space_count", "pops_module_field_space_name");
170inline std::string requirement_string(const std::string& requirements_json, const std::string& key) {
172 // @p key is the quoted JSON key (e.g. "\"solver\""). Match it as a genuine KEY, not as an array
174 // first non-space char after it must be ':'. (Without this, an aux field literally named "solver"
std::string module_str(void *handle, const char *symbol, int i)
Call a const char* (int) accessor at index i; empty string if the symbol is absent.
Definition module_metadata.hpp:63
std::vector< std::string > module_names(void *handle, const char *count_symbol, const char *name_symbol)
Read a (count, name) string table (state/field spaces) from the handle.
Definition module_metadata.hpp:75
std::uint32_t OperatorId
Integer id of an operator within a module: its registration index.
Definition module_metadata.hpp:27
std::string required_solver(const std::string &requirements_json)
Solver name a field operator requires (the scalar "solver" value), e.g.
Definition module_metadata.hpp:222
std::vector< std::string > required_aux(const std::string &requirements_json)
Aux-field names an operator requires (the "aux" array).
Definition module_metadata.hpp:207
ModuleMetadata read_module_metadata(void *dl_handle)
Read the GeneratedModule metadata from an already-dlopen'd problem.so dl_handle.
Definition module_metadata.hpp:95
std::string requirement_string(const std::string &requirements_json, const std::string &key)
Read a single quoted JSON string value keyed by key inside the operator's flat requirements JSON,...
Definition module_metadata.hpp:170
std::vector< std::string > required_string_list(const std::string &requirements_json, const std::string &key)
Collect the quoted tokens of a JSON string array keyed by key inside the operator's flat requirements...
Definition module_metadata.hpp:134
std::uint32_t SpaceId
Integer id of a state or field space within a module.
Definition module_metadata.hpp:30
std::vector< std::string > required_blocks(const std::string &requirements_json)
Block-instance names an operator requires (the "block" array), e.g.
Definition module_metadata.hpp:214
Definition amr_hierarchy.hpp:29
The GeneratedModule descriptor read from a problem.so.
Definition module_metadata.hpp:43
std::vector< std::string > field_spaces
Definition module_metadata.hpp:47
std::vector< std::string > state_spaces
Definition module_metadata.hpp:46
std::vector< OperatorMetadata > operators
Definition module_metadata.hpp:45
const OperatorMetadata * find(const std::string &name) const
The operator with this name, or nullptr if none.
Definition module_metadata.hpp:50
One operator's metadata, as exported by the .so.
Definition module_metadata.hpp:33
std::string requirements
JSON, e.g. {"kind":"local_source","aux":["grad_x","grad_y"]}.
Definition module_metadata.hpp:38
std::string signature
human-readable typed signature
Definition module_metadata.hpp:37
std::string kind
one of the Spec-2 operator kinds (local_rate, field_operator, ...)
Definition module_metadata.hpp:36
Generated by