|
NGen
|
Classes | |
| struct | Config |
| Structure representing the configuration for a general Formulation. More... | |
| struct | Forcing |
| Structure for holding forcing configuration information. More... | |
| struct | Formulation |
| struct | Layer |
| Layer configuration information. More... | |
| struct | Output |
| Parsed representation of a realization config's output settings. More... | |
| struct | OutputDomain |
| Settings for one output domain (catchment or nexus). More... | |
| struct | Routing |
| struct | Time |
| Simple structure for holding time bounds and output interval (seconds) More... | |
Enumerations | |
| enum class | OutputFormat { csv , netcdf } |
| Serialization format for an output domain. More... | |
| enum class | OutputGrouping { per_feature , per_formulation } |
| How a domain's records are distributed across files (the file-*granularity* axis): per_feature - one file per feature (one CSV per catchment / per nexus) per_formulation - the features of a formulation aggregate into one file (a feature-id column distinguishes their rows). More... | |
Functions | |
| std::shared_ptr< utils::CatchmentOutputsMgr > | make_catchment_output_mgr (const Output &output_config, std::vector< utils::FeatureDescriptor > descriptors, const std::string &aggregated_filename=DEFAULT_AGGREGATED_FILENAME) |
| Build the catchment output manager from the parsed output configuration. | |
| OutputFormat | parse_output_format (const std::string &s) |
| OutputGrouping | parse_output_grouping (const std::string &s) |
| std::string | rank_output_root (const std::string &base_root, const OutputDomain &domain, int mpi_rank, int mpi_num_procs) |
The output root for a rank's files in this domain: appends "rank_<N>/" to base_root when the domain requests per-rank subdirectories, or when it aggregates per formulation (which requires per-rank separation so ranks don't write the same file). | |
Variables | |
| static const std::string | DEFAULT_AGGREGATED_FILENAME = "cat_output.csv" |
| Default file name for an aggregated (per_formulation) catchment file. | |
| static const std::string | OUTPUT_CONFIG_KEY = "output" |
| Key for the dedicated output configuration block in a realization config. | |
| static const std::string | LEGACY_OUTPUT_ROOT_KEY = "output_root" |
| Deprecated top-level keys this block replaces. | |
| static const std::string | LEGACY_DISABLE_CATCHMENT_KEY = "disable_catchment_output" |
| static const std::string | LEGACY_PER_FORMULATION_KEY = "per_formulation_nexus_files" |
| static const std::string | ROUTING_CONFIG_KEY = "t_route_config_file_with_path" |
|
strong |
|
strong |
How a domain's records are distributed across files (the file-*granularity* axis): per_feature - one file per feature (one CSV per catchment / per nexus) per_formulation - the features of a formulation aggregate into one file (a feature-id column distinguishes their rows).
Fewer, larger files; columns are uniform within a file by construction. Orthogonal to this is OutputDomain::rank_subdir, the filesystem-*layout* axis.
| Enumerator | |
|---|---|
| per_feature | |
| per_formulation | |
|
inline |
Build the catchment output manager from the parsed output configuration.
Grouping and precision come from output_config; the resolved root comes from output_config.root, which the caller is expected to have already adjusted for rank layout (see rank_output_root) so any rank_<N>/ subdirectory is baked into the root.
The manager is constructed with the full set of descriptors (every catchment and its columns), so the backend lays out its files up front and is ready to receive data on return.
Side effect: constructing the manager creates the output directory tree it writes into (config parsing only normalizes the root – it does not touch the filesystem). Each output manager owns creating what it writes, so no caller need pre-create the directory.
Only the CSV format is implemented today; any other configured format is rejected here (the branch on output_config.catchment.format is where an added format would slot in). Layout follows the grouping: per_formulation aggregates each formulation's catchments into one file (leading catchment_id column) named aggregated_filename; per_feature writes one file per catchment.
| std::runtime_error | if a catchment output format other than CSV is configured. |
References realization::config::Output::catchment, csv, realization::config::OutputDomain::format, realization::config::OutputDomain::grouping, per_formulation, realization::config::Output::precision, and realization::config::Output::root.
|
inline |
Referenced by realization::config::OutputDomain::OutputDomain().
|
inline |
References per_feature, and per_formulation.
Referenced by realization::config::OutputDomain::OutputDomain().
|
inline |
The output root for a rank's files in this domain: appends "rank_<N>/" to base_root when the domain requests per-rank subdirectories, or when it aggregates per formulation (which requires per-rank separation so ranks don't write the same file).
Only distributed (mpi_num_procs > 1) runs are affected; in serial base_root is returned unchanged. The directory is created lazily by the backend when it opens files.
References realization::config::OutputDomain::grouping, per_formulation, and realization::config::OutputDomain::rank_subdir.
|
static |
Default file name for an aggregated (per_formulation) catchment file.
The rank, when applicable, is carried in the resolved root (a rank_<N>/ subdirectory), not the file name.
|
static |
Referenced by realization::config::Output::parse_legacy().
|
static |
Deprecated top-level keys this block replaces.
Referenced by realization::config::Output::parse_legacy().
|
static |
Referenced by realization::config::Output::parse_legacy().
|
static |
Key for the dedicated output configuration block in a realization config.
Referenced by realization::config::Output::from_realization().
|
static |
Referenced by realization::config::Routing::Routing().