Data Structures | |
| class | _LazyNumpyProxy |
Module-like proxy that preserves picurv.np without eager import. More... | |
| class | CheckpointIndexWidthError |
| A committed checkpoint written by a PETSc of the other index width than the driven solver's. More... | |
| class | CommandExecutionError |
| Raised when an external command exits unsuccessfully. More... | |
| class | PlotDependencyError |
| Raised when plot.gen reports a missing optional dependency. More... | |
Functions | |
| _prune_incompatible_python_site_paths (paths) | |
| Remove site-package paths for a different Python major/minor version. | |
| _drop_imported_package (str package_name) | |
| Remove a failed/partial import package tree from sys.modules. | |
| require_numpy () | |
| Import NumPy only for commands that need numeric reductions. | |
| optional_matplotlib_pyplot () | |
| Import matplotlib.pyplot lazily for study plot generation. | |
| str | _read_release_version () |
| Read the single release version shared by every PICurv executable. | |
| "str | None" | _git_output (*arguments) |
| Run one git command in the source checkout. | |
| dict | _source_build_identity (str release_version) |
| Resolve reproducible release, commit, and dirty-tree build identity. | |
| dict | picurv_build () |
| The conductor's own build identity, resolved on first use and kept for the process. | |
| _find_named_file_upwards (str start, str filename) | |
| Find a named file at or above an arbitrary filesystem anchor. | |
| find_workspace_root (*anchors) | |
| Locate the nearest initialized PICurv workspace for supplied anchors. | |
| dict | load_workspace_config (str workspace_root) |
| Load and validate the immutable workspace identity/configuration file. | |
| dict | enforce_workspace_version (str workspace_root) |
| Enforce an optional workspace PICurv version requirement. | |
| dict | enforce_reproducibility_policy (str workspace_root) |
| Enforce an optional workspace policy demanding a clean, released build. | |
| str | resolve_workspace_path (str anchor_file, str candidate, *bool allow_external=False) |
| Resolve a user path against its workspace and reject implicit escapes. | |
| None | ensure_workspace_layout (str workspace_root) |
| Materialize the uniform, cheap directory skeleton for one workspace. | |
| str | initialize_workspace_root (str workspace_root, str template_name) |
| Create the workspace skeleton and its identity file at one root. | |
| None | ensure_run_layout (str run_dir) |
| Materialize the uniform, cheap directory skeleton for one run. | |
| tuple | validate_run_directory_structure (str run_dir) |
| Refuse a run whose root has grown a directory the layout does not define. | |
| None | enforce_run_directory_structure (str run_dir) |
Apply validate_run_directory_structure() as a refusal at run time. | |
| str | case_run_label (dict case_cfg, str case_path) |
| Resolve the stable human-facing portion of a generated run identifier. | |
| str | allocate_generated_run_id (str runs_root, dict case_cfg, str case_path) |
| Build the generated run identity, disambiguating a same-second collision. | |
| bool | discard_unused_run_directory (str run_dir, *bool created, bool staged=False) |
| Remove a generated run directory that never received any content. | |
| _file_sha256 (str path) | |
| Content digest of one file, or None when it cannot be read. | |
| dict | build_software_lock ("str | None" run_dir=None) |
| Capture the exact software identity a run is about to execute with. | |
| dict | _toolchain_identity () |
| Best-effort record of the PETSc, MPI, and compiler in the shell staging the run. | |
| str | write_software_lock (str run_dir) |
| Write the run's software lock beside its asset lock. | |
| str | workspace_artifact_root (str workspace_root, str kind) |
| Return the canonical workspace-owned root for runs or studies. | |
| _relative_to_workspace (str path, str workspace_root) | |
| Return a portable workspace-relative path when possible. | |
| dict | snapshot_run_configuration (str run_dir, dict source_paths, bool continuation=False) |
| Snapshot editable YAML inputs without erasing prior continuation state. | |
| dict | capture_continuation_records (str run_dir, str restart_dir) |
| Save what a continuation's staging changes, so a refusal can undo it. | |
| restore_continuation_records (str run_dir, dict saved, str revision) | |
| Undo a refused continuation's staging: restore its records, drop its revision. | |
| dict | load_active_run_configuration (str run_dir) |
| Load the active immutable configuration revision for a run. | |
| dict | load_run_executables (str run_dir) |
| Return the executables a run is pinned to, as recorded by its active configuration. | |
| str | run_executable_path ("str | None" run_dir, str name) |
| Resolve the executable a run launches: its pinned copy, else the installation's. | |
| dict | pin_run_executables (str run_dir, str revision) |
| Copy the installation's executables into a run's configuration revision. | |
| dict | plan_run_executable_paths (str run_dir, args, "str | None" workspace_root) |
| Predict, without writing, which executables staging would give a run. | |
| bool | resolve_executable_pinning (args, "str | None" workspace_root) |
| Decide whether staging pins the installation's executables into the run. | |
| dict | apply_run_executable_pinning (str run_dir, str revision, args, "str | None" workspace_root) |
| Pin, keep, or refuse the run's executables before anything records them. | |
| dict | archive_active_generated_configuration (str run_dir, list paths) |
| Preserve generated control sidecars beside a continuation's YAML revision. | |
| dict | _run_component_states (str run_dir, dict stages_requested) |
| Report each run component's home, retention class, and lifecycle state. | |
| dict | build_run_lineage (str parent_run_dir, int checkpoint_step, *workspace_root=None, statistics_state=None, requested_source=None) |
| Record which run and which checkpoint a branched run was started from. | |
| dict | build_run_manifest (str run_dir, str run_id, *workspace_root=None, str launch_mode="local", int num_procs=1, int post_num_procs=1, stages_requested=None, stages_completed=None, inputs=None, asset_lock=None, submission=None, lineage=None, str artifact_type="run", study_id=None, case_id=None) |
| Build the authoritative run identity, topology, and lifecycle manifest. | |
| _recorded_run_root (str run_dir) | |
| Return the location a run's generated files refer to. | |
| int | adopt_relocated_artifact (str root, str kind="run", bool dry_run=False) |
| Point a moved run's or study's generated files at where it now lives. | |
| str | _checkpoint_bundle_path (str source_dir, int step) |
| Resolve a run/output root or an exact checkpoint bundle. | |
| dict | _read_checkpoint_options (str metadata_path) |
| Parse the deliberately small PETSc-options checkpoint manifest. | |
| dict | validate_committed_checkpoint (str source_dir, int step, bool require_particles=False) |
| Validate one committed bundle using the same manifest contract as C. | |
| "set[int]" | _scan_committed_checkpoint_steps (str source_dir, bool require_particles=False) |
| Return only fully validated, committed checkpoint steps. | |
| int | parse_slurm_time_limit_to_seconds (str time_text) |
| Parse a Slurm time-limit string into total seconds. | |
| "dict | None" | resolve_walltime_guard_policy ("dict | None" cluster_cfg) |
| Resolve the effective Slurm walltime-guard policy for generated solver jobs. | |
| dict | build_walltime_guard_exports ("dict | None" cluster_cfg) |
| Build shell-evaluated environment exports for the runtime walltime guard. | |
| str | resolve_runtime_executable (str executable_name) |
| Resolve solver/post executable path, preferring local sibling binaries. | |
| "dict | None" | _parse_binary_petsc_line (str line) |
| Parse the PETSc build line a native executable reports. | |
| "dict | None" | read_binary_petsc_stamp (str executable_path) |
| Read the PETSc build stamp from an executable's bytes, without running it. | |
| "str | None" | resolved_petsc_library (str executable_path) |
| The PETSc shared library the dynamic loader would give this executable when picurv launches it. | |
| bool | petsc_library_mismatch ("dict | None" petsc, "str | None" library) |
| Whether the library the loader resolves lies outside the PETSc the binary was built against. | |
| "dict | None" | _read_binary_build_stamp (str executable_path) |
| Read the build identity stamped into an executable's bytes, without running it. | |
| dict | read_binary_build_identity (str executable_path) |
| Read the build identity a native executable was compiled with. | |
| dict | runtime_build_identities ("dict | None" source_identity=None, "str | None" run_dir=None) |
| Read the build identity of every native executable a run would launch. | |
| str | rebuild_command (str name, dict identity) |
| The command that rebuilds one native executable. | |
| list | build_identity_problems (dict identities, workspace_requirement=None, "dict | None" source_identity=None) |
| Report every reason the active build identity is not internally coherent. | |
| list | warn_on_stale_runtime_binaries (dict identities) |
| Report native executables whose build identity is not the active source. | |
| str | _sanitize_error_field (value) |
| Normalize error fields into a single-line string. | |
| emit_structured_error (str code, str key="-", str file_path="-", str message="", str hint=None, stream=None) | |
| Emit one standardized error line for tooling and users. | |
| fail_cli_usage (str message, str hint=None) | |
| Emit a structured CLI usage error and exit with code 2. | |
| _split_error_file_and_message (str raw_error) | |
| Separate a validation error into its source-file and message fields when possible. | |
| str | _extract_key_path (str message) |
| Best-effort key-path extraction from free-form validation messages. | |
| str | _classify_error_code (str message) |
| Map existing validation/error messages to the standardized code set. | |
| dict | read_yaml_file (str filepath) |
| Safely reads a YAML file and returns its content. | |
| write_yaml_file (str filepath, dict data) | |
| Write YAML with stable ordering for generated study artifacts. | |
| write_json_file (str filepath, dict payload) | |
| Write JSON metadata/manifests with a stable, readable format. | |
| str | write_runtime_execution_file (str filepath, str template_source_path=None) |
| Write a default runtime execution config, copying a source template when available. | |
| bool | _launcher_arg_contains_whitespace (token) |
| Return True when a launcher arg token contains embedded whitespace and should be split. | |
| "str | None" | resolve_runtime_execution_seed_source (str source_project_root) |
| Prefer repo-local ignored runtime config, then tracked example, then built-in defaults. | |
| dict | ensure_case_runtime_execution_config (str case_dir, str source_project_root, bool overwrite=False) |
| Create case-local runtime execution config if missing, seeded from repo-local config when available. | |
| bool | is_project_root (str candidate) |
| Return True when a directory looks like the PICurv source repository root. | |
| _iter_parent_dirs (str start_path) | |
| Yield a path and all of its parents up to filesystem root. | |
| find_project_root_upwards (str start_path) | |
| Search upward from an anchor and return the first matching project root. | |
| discover_local_project_root (*extra_anchors) | |
| Best-effort source repo discovery from runtime anchors. | |
| find_case_origin_metadata_file (str case_dir_hint=None) | |
| Find the nearest case-origin metadata file from known runtime anchors. | |
| load_case_origin_metadata (str case_dir_hint=None) | |
| Load case-origin metadata if present, returning (case_dir, metadata_path, payload). | |
| find_runtime_execution_config_file (*anchors) | |
| Find the nearest optional execution config from runtime/case anchors. | |
| dict | _normalize_execution_override_section (dict payload, str section_name, str config_path, str config_label) |
| Validate one execution override section while preserving missing-vs-empty semantics. | |
| load_runtime_execution_config (str config_search_anchor=None, extra_search_anchors=None) | |
| Load optional shared execution launcher config from the nearest runtime config file. | |
| dict | merge_execution_overrides ("dict | None" base, "dict | None" override) |
| Merge execution overrides, letting explicit override values win key-by-key. | |
| dict | resolve_runtime_execution_context (dict runtime_execution_cfg, str context) |
| Resolve default plus context-specific execution overrides. | |
| str | get_git_commit (str repo_root=None) |
| Best-effort git commit lookup for run/study manifests and case metadata. | |
| write_case_origin_metadata (str case_dir, str source_project_root, str template_name=None, dict existing=None, template_managed_files=None) | |
| Create or refresh case-origin metadata for repo-aware case maintenance commands. | |
| bool | make_args_include_explicit_goal ("list[str]" make_args) |
| Return True when make args contain an explicit target rather than only options/assignments. | |
| resolve_case_origin_context (str case_dir_hint=None, str source_root_override=None, str template_name_override=None) | |
| Resolve case directory, source repo root, and optional template metadata. | |
| require_project_root (str candidate, str purpose) | |
| Validate that a source repo root was resolved and is structurally valid. | |
| require_existing_case_dir (str case_dir, str purpose, str source_project_root=None) | |
| Validate that a target case directory exists and is not the source repo root. | |
| resolve_template_directory (str source_project_root, str template_name) | |
| Resolve an example template directory inside the source repository. | |
| list_template_relative_files (str template_dir, excluded_rel_paths=None) | |
| List all files in a template directory as case-relative paths. | |
| dict | render_template_workspace (str template_dir, str template_name, str destination) |
| Render an example template into the canonical workspace layout at a new path. | |
| list | list_rendered_template_files (str rendered_root) |
| List the template-managed files of a rendered workspace, workspace-relative. | |
| list_source_binaries (str source_project_root) | |
| List binary artifacts currently available in the source repo bin directory. | |
| sync_case_binaries (str case_dir, str source_project_root) | |
| Copy current source-repo binaries into a case directory for version-pinning. | |
| sync_case_template_files (str case_dir, str template_dir, bool overwrite=False, bool prune=False, managed_rel_paths=None, str template_name=None) | |
| Sync template files into a case directory, preserving modified files unless overwrite is requested. | |
| compute_case_source_status (str case_dir, str source_project_root, str template_name=None, dict metadata=None) | |
| Compute source/case drift across commits, binaries, and template-managed files. | |
| print_case_source_status (dict status) | |
| Render human-readable source/case drift details. | |
| status_source_command (args) | |
| Report source/case drift for an initialized case directory. | |
| str | resolve_path (str anchor_file, str candidate) |
| Resolve a potentially relative path against a source YAML file path. | |
| _mapping_value_with_aliases (dict mapping, *keys, default=None) | |
| Return the first defined value from a mapping across alias keys. | |
| get_post_run_control_value (dict post_cfg, str canonical_key, default=None) | |
| Resolve post run_control values with backwards-compatible legacy aliases. | |
| None | warn_on_grid_generator_hyphen_keys (dict generator, str case_path, list warnings) |
| Warn when grid.generator uses unsupported hyphenated wrapper keys. | |
| str | retired_destination_message (str label, str key) |
| Explain why a generator may not choose its own output destination. | |
| list | reject_generator_destination_keys (generator, str case_path, str label) |
| Reject generator settings that try to choose their own output destination. | |
| get_post_source_data (dict post_cfg) | |
| Return source_data as a mapping when valid, else an empty mapping. | |
| str | get_post_source_directory_template (dict post_cfg, str default="<solver_output_dir>") |
| Resolve the source directory template from source_data with a safe default. | |
| get_post_input_extensions (dict post_cfg) | |
| Return post input_extensions, preferring io. | |
| get_post_statistics_task_tokens (dict post_cfg) | |
| Return normalized statistics pipeline tokens that will be written into post.run. | |
| str | get_monitor_output_directory (dict monitor_cfg, str default="output") |
| Resolve the solver output root from monitor.yml, preserving the default layout. | |
| str | get_post_statistics_output_prefix (dict post_cfg, str default="Stats") |
| Resolve the statistics CSV prefix, preserving legacy top-level override support. | |
| str | resolve_post_statistics_output_prefix (dict post_cfg, monitor_cfg=None, str default="Stats") |
| Resolve the runtime statistics prefix, routing bare basenames under the monitor output root. | |
| get_post_statistics_output_artifacts (dict post_cfg, str run_dir, monitor_cfg=None) | |
| Predict statistics CSV output paths relative to the postprocessor runtime cwd. | |
| dict | resolve_scalar_transport (dict case_cfg, dict solver_cfg, bool warn=False) |
| Resolve the scalar-transport parameters from case.yml or their deprecated location. | |
| dict | normalize_post_spectra_config (dict post_cfg) |
| Validate and canonicalize the spectra block of post.yml. | |
| list | validate_post_spectra_preconditions (dict spectra_cfg, dict case_cfg, str post_path) |
| Check spectra tasks against what the case can actually support. | |
| str | _resolve_spectra_payload (dict bundle, str kind, str field, int block) |
| Locate one checkpoint payload by its inventory entry rather than by path shape. | |
| list | _spectra_mean_arguments (dict task_cfg, dict bundle, dict mean_bundle=None) |
| Build the generator arguments implementing a task's fluctuation choice. | |
| set | resolve_post_stage_selection (only) |
Resolve the --only selector into the set of post stages to execute. | |
| dict | run_post_spectra_stage (str run_dir, dict post_cfg, dict monitor_cfg, str source_dir, steps, bool quiet=False, "dict | None" plan=None, bool recompute=False) |
| Measure spectra for every requested task across a window of committed steps. | |
| dict | normalize_post_reducers_config (dict post_cfg) |
| Validate and canonicalize the reducers block of post.yml. | |
| list | run_post_reducers_stage (str run_dir, dict post_cfg, bool quiet=False) |
| Run every reducer task over the profiles the recipe has written. | |
| list | _merge_spectra_rows (str path, tuple fieldnames, set remeasured, list new_rows) |
| Combine newly measured spectra rows with those already written for other steps. | |
| str | compute_post_spectra_signature (dict spectra_cfg) |
| Reduce a normalized spectra recipe to a stable identity string. | |
| str | resolve_post_spectra_output_dir (monitor_cfg=None) |
| Resolve the run-relative directory spectra CSVs are written to. | |
| str | resolve_recipe_spectra_output_dir (dict post_cfg, monitor_cfg=None) |
| Resolve the canonical spectra directory for one versioned recipe. | |
| list | get_post_spectra_output_artifacts (dict post_cfg, str run_dir, monitor_cfg=None) |
| Predict the spectra CSV paths a recipe will write. | |
| str | post_spectra_task_basename (dict task_cfg, str output_prefix) |
| Build the file basename one normalized spectra task writes. | |
| list | _normalize_post_statistics_ensembles (raw) |
| Validate and canonicalize the ensembles a post recipe defines. | |
| dict | normalize_post_field_statistics_config (dict post_cfg) |
| Validate and canonicalize the field_statistics block of post.yml. | |
| int | _post_window_derived_field_count (dict window_cfg, list outputs, dict eligible=None) |
| Count the derived fields one window would produce for a set of outputs. | |
| bool | _post_requests_field_statistics (dict post_cfg) |
| Return whether the current post recipe derives accumulated field statistics. | |
| get_post_field_statistics_artifacts (dict post_cfg, str run_dir) | |
| Predict the per-window statistics artifacts a recipe will produce. | |
| dict | build_post_recipe_config (dict post_cfg, monitor_cfg=None) |
| Build the flat key=value mapping consumed by the C post-processor. | |
| str | compute_post_recipe_id (dict post_cfg) |
| Compute a stable human-readable identity for one post recipe. | |
| "tuple[dict, str]" | apply_canonical_post_paths (dict post_cfg, str run_dir) |
| Route every post artifact into its fixed analysis or visualization home. | |
| dict | normalize_post_recipe_signature (dict recipe_cfg) |
| Normalize post recipe settings into a stable signature mapping. | |
| "tuple[dict, str]" | compute_post_recipe_fingerprint (dict recipe_cfg) |
| Return normalized recipe signature plus SHA-256 fingerprint. | |
| str | get_post_resume_state_path (str run_dir, dict post_cfg=None) |
| Return the JSON resume metadata path for a run directory. | |
| str | get_post_recipe_root (str run_dir, dict post_cfg) |
| Return the versioned run-local control directory for one post recipe. | |
| dict | get_post_lock_paths (str run_dir, str recipe_id=None) |
| Return lock-wrapper related paths for a run directory. | |
| str | _post_output_directory_abs (str run_dir, dict post_cfg) |
| Resolve the absolute post output directory for the current recipe. | |
| bool | _post_requests_eulerian_output (dict post_cfg) |
| Return whether the current post recipe expects Eulerian VTK output artifacts. | |
| bool | _post_requests_particle_output (dict post_cfg) |
| Return whether the current post recipe expects particle VTP output artifacts. | |
| dict | normalize_post_paraview_series_config (dict post_cfg) |
| Normalize the optional ParaView collection policy in a post recipe. | |
| str | _resolve_lineage_parent_run (str child_run_dir, dict lineage) |
| Resolve and identity-check one recorded lineage parent. | |
| list | resolve_run_lineage (str run_dir, str scope="lineage") |
| Return root-to-leaf run segments, for a ParaView collection or a reducer's metrics. | |
| dict | _existing_pvd_times (str pvd_path) |
| Read step-to-time fallbacks from an existing PVD collection. | |
| float | _checkpoint_time_for_series (str run_dir, int step, dict fallback, float time_scale=1.0) |
| Read the authoritative time of one visualization frame. | |
| None | _write_pvd_collection (str path, list entries) |
| Atomically write one VTK Collection file. | |
| int | _lineage_reset_index (list segments, str family) |
| Return the first segment belonging to one continuous artifact family. | |
| list | finalize_post_paraview_series (str run_dir, dict post_cfg) |
| Build physical-time ParaView collections from current or lineage VTK output. | |
| str | _post_finalize_python_source () |
| Return the importable serial finalizer used by generated jobs. | |
| list | build_post_finalize_command (str run_dir, str archived_post_path, dict post_cfg, post_stages=POST_STAGE_NAMES) |
| Build the serial post-success command for staged execution. | |
| None | finalize_post_outputs (str run_dir, dict post_cfg, stages) |
| Run every serial step that reads a successful field stage's output. | |
| bool | _post_requests_statistics (dict post_cfg) |
| Return whether the current post recipe expects statistics CSV artifacts. | |
| bool | _post_needs_particle_source (dict post_cfg) |
| Return whether the current post recipe requires particle source files to be present. | |
| _iter_post_steps (int start_step, int end_step, int step_interval) | |
| Yield configured post-processing steps inclusively. | |
| "tuple[int, int, int]" | resolve_post_requested_window (dict post_cfg, dict case_cfg=None) |
| Resolve post requested start/end/interval, expanding end=-1 via case.yml when available. | |
| int | resolve_post_owned_start (str run_dir, dict post_cfg, int requested_start, int step_interval) |
| Intersect a recipe's logical cadence with this run's branch. | |
| dict | prepare_effective_post_config (dict post_cfg, str resolved_source_dir, int start_step=None, int end_step=None) |
| Return a copy of post_cfg with resolved source dir and optional effective bounds. | |
| "dict[int, str]" | _scan_post_vtk_steps (str prefix_path, str extension) |
| Collect the VTK files named with a prefix, step suffix, and extension. | |
| "set[int]" | _scan_post_statistics_csv_steps (str csv_path) |
| Scan step ids from the first CSV column of a statistics artifact. | |
| "list[tuple]" | collect_post_completion_families (str run_dir, dict post_cfg, monitor_cfg=None) |
| Collect the output files each output family of the current recipe holds per step. | |
| _field_statistics_window_samples (str run_dir, int step) | |
| Read each field-statistics window's sample count from one committed checkpoint. | |
| post_step_outputs (str run_dir, dict post_cfg, monitor_cfg=None) | |
| Return a lookup of the output files one step of the current recipe holds. | |
| _nearest_step ("set[int]" steps, int target) | |
| Return the complete source step nearest to a target step. | |
| str | _format_optional_step (step) |
| Format an optional step number for user-facing diagnostics. | |
| "tuple[set[int], dict]" | _scan_complete_source_steps (str source_dir, dict monitor_cfg, dict post_cfg) |
| Scan source artifacts and return steps with every file required by the recipe. | |
| "list[str]" | _expected_source_paths_for_step (int step, dict source_scan, dict post_cfg) |
| Build required source file paths for a single post-processing step. | |
| dict | detect_post_source_frontier (str source_dir, dict monitor_cfg, dict post_cfg, int start_step, int end_step, int step_interval) |
| Detect the highest contiguous fully available source step for live post-processing. | |
| "tuple[dict, dict]" | _read_post_records (str state_path) |
| Read the per-step output records a recipe's state holds. | |
| persist_post_resume_state (str run_dir, dict plan, steps=None, spectra=None) | |
| Write a recipe's state: the window last planned and its per-step output records. | |
| _checkpoint_commit (str source_dir, int step) | |
| Identify one committed checkpoint by its commit marker. | |
| "str | None" | classify_post_step (record, files, commit, str recipe, bool recompute=False) |
| Decide whether one step's existing output is still valid. | |
| None | warn_overlapping_post_recipes (str run_dir, dict post_cfg, dict plan, post_stages) |
| Warn when another recipe in this run already produced outputs this one repeats. | |
| str | _build_post_lock_wrapper_source () |
| Return the Python wrapper that runs one post job under an exclusive lock. | |
| str | ensure_post_lock_wrapper (str run_dir) |
| Ensure the lock wrapper exists for a run directory and return its path. | |
| "tuple[list, dict]" | build_post_locked_command (str run_dir, str recipe_fingerprint, list wrapped_command, bool create_wrapper=True, "list | None" success_command=None, "str | None" post_recipe=None, "str | None" postprocessor=None, bool recompute=False) |
| Wrap a postprocessor command behind the run-dir-scoped lock wrapper. | |
| None | run_post_finalize_locked (str run_dir, str recipe_fingerprint, list finalize_command) |
| Refresh a collection-only result under the ordinary post writer lock. | |
| dict | build_post_execution_plan (str run_dir, str run_id, dict case_cfg, dict monitor_cfg, dict post_cfg, bool recompute=False, bool allow_source_frontier_scan=True, "str | None" postprocessor_sha=None) |
| Decide which steps of a recipe's window one invocation processes. | |
| None | report_post_plan (dict plan) |
| Print which steps a post plan processes, keeps, and waits for. | |
| str | get_post_step_list_path (str run_dir, dict post_cfg) |
| Return the file naming the steps a launched post job processes. | |
| "tuple[dict, dict, dict]" | _load_post_job_configs (str run_dir, str post_recipe_path) |
| Load the configuration a post job needs from the run it runs in. | |
| int | prepare_post_job (str run_dir, str post_recipe_path, str postprocessor, bool recompute=False) |
| Decide, as a post job starts, which steps it processes. | |
| int | finish_post_job (str run_dir, str post_recipe_path, bool exited_cleanly=False) |
| Record, after a post job ends, which steps it produced. | |
| bool | needs_restart_source (dict case_cfg, dict solver_cfg) |
| Return True when the solver requires restart data from disk. | |
| str | resolve_run_output_dir (str run_dir, dict monitor_cfg) |
| Resolve the output data directory within a run directory. | |
| str | resolve_run_restart_dir (str run_dir, dict monitor_cfg) |
| Resolve the restart staging directory within a run directory. | |
| str | compute_physical_case_identity (dict case_cfg) |
| Compute the hidden identity used to guard in-place continuation. | |
| None | validate_continue_case_identity (str run_dir, dict case_cfg) |
| Reject in-place continuation when the physical case has changed. | |
| populate_restart_directory (str source_output, str target_restart, int start_step, dict monitor_cfg, "int | None" end_step=None, bool materialize=True) | |
| Atomically materialize an immutable checkpoint interval into a run. | |
| validate_eulerian_checkpoint (str source_dir, int step, dict monitor_cfg) | |
Validate the mandatory Eulerian field set required by ReadSimulationFields(). | |
| detect_last_checkpoint_step (str output_dir) | |
| Scan output directory for the highest step number available. | |
| dict | detect_case_completion_status (str run_dir, dict monitor_cfg, int target_final_step) |
| Determine whether a study case is complete, partially complete, or empty. | |
| validate_load_mode_step_range (str source_output, int start_step, int total_steps, dict monitor_cfg) | |
| Validate that all required eulerian step files exist for "load" mode. | |
| validate_particle_checkpoint (str source_dir, int start_step, dict monitor_cfg) | |
| Validate that particle checkpoint files exist for the given step. | |
| dict | read_monitor_from_run (str run_dir) |
| Read the monitor.yml from a run directory's config/ subdirectory. | |
| str | resolve_latest_restart_run (dict case_cfg, str case_path, int start_step) |
| Select the newest local workspace run compatible with a requested restart. | |
| resolve_restart_source (args, dict case_cfg, dict solver_cfg, dict monitor_cfg, str run_dir, bool materialize=True) | |
| Resolve the restart source directory based on –restart-from or –continue CLI flags. | |
| absolutize_case_external_paths (dict case_cfg, str case_anchor_path) | |
| Convert external grid/generator paths in case config to absolute paths. | |
| prepare_case_for_continuation (str run_dir, str case_id, int last_step, int target_final_step, dict cluster_cfg) | |
| Set up a partially-completed study case for continuation in-place. | |
| bool | is_valid_email (str email) |
| Lightweight email validation for scheduler notifications. | |
| str | normalize_statistics_task (str task_name) |
| Normalizes user-facing statistics task names to C pipeline keywords. | |
| _iter_nonempty_noncomment_lines (file_obj) | |
| Yield (lineno, stripped_line) for non-empty, non-comment lines. | |
| str | format_picgrid_coordinate (float value) |
| Format a coordinate with round-trip-safe binary64 precision. | |
| dict | validate_and_nondimensionalize_picgrid (str source_grid, str dest_grid, float L_ref, int expected_nblk=None) |
| Validates PICGRID payload and writes a non-dimensionalized copy. | |
| list | read_picgrid_header_dimensions (str source_grid, int expected_nblk=None) |
| Read only the canonical PICGRID header dimensions. | |
| dict | validate_and_nondimensionalize_picslice (str source_slice, str dest_slice, float U_ref, tuple expected_dims=None) |
| Validate a canonical PICSLICE payload and write a solver-scale copy. | |
| str | _face_artifact_token (str face) |
| Convert a BC face token into a filesystem-friendly artifact token. | |
| str | _resolve_run_artifact_path (str run_dir, str configured_path, str default_path, bool default_to_config_dir=False) |
| Resolve a run artifact path with run-dir-relative defaults. | |
| str | _resolve_generator_script (str configured_script, str case_path, str default_name) |
| Resolve an optional generator script override or repository default. | |
| dict | _normalize_square_duct_poiseuille_params (params, str field_name) |
| Validate square-duct Poiseuille generator parameters. | |
| dict | _normalize_field_slice_source (source, str field_name) |
| Validate a prescribed_flow field_slice source block. | |
| dict | _normalize_field_slice_selector (slice_cfg, str field_name) |
| Validate the field_slice slice selector. | |
| dict | generate_square_duct_poiseuille_picslice (str output_path, tuple dims, dict params, str target_grid=None, int target_block=0, str target_face=None, str script=None, str case_path=None) |
| Generate a dimensional canonical PICSLICE for square-duct Poiseuille flow. | |
| dict | generate_field_slice_picslice (str output_path, tuple expected_dims, dict source, str target_grid, str target_face, int target_block, str case_path) |
| Invoke profile.gen to extract a field_slice PICSLICE artifact. | |
| str | _resolve_case_relative_path (str path_value, str case_dir) |
| Resolve a path relative to the current case directory. | |
| float | _resolve_field_slice_velocity_scale (dict source, str case_dir) |
| Resolve field_slice dimensional velocity scale. | |
| str | resolve_target_grid_for_field_slice (dict case_cfg, str case_path, str run_dir) |
| Resolve the target canonical PICGRID path needed for field_slice normals. | |
| str | resolve_target_grid_for_generated_profile (dict case_cfg, str case_path, str run_dir) |
| Resolve the target canonical PICGRID for generated profile sampling. | |
| str | write_profile_info (str config_dir, list summaries) |
| Write a profile.info summary for generated inlet profiles. | |
| list | validate_grid_generator_cli_args (cli_args, str case_path) |
| Check closed-choice values inside the generator's opaque token list. | |
| str | run_grid_generator (str case_path, str run_dir, dict grid_cfg, dict case_cfg=None) |
| Runs generators/grid.gen to produce a PICGRID file for this run. | |
| dict | _normalize_prescribed_flow_source (source, str field_name) |
| Validate the structured source block for prescribed_flow BCs. | |
| tuple | _bc_profile_expected_dims (str face, tuple block_dims) |
| Return expected PICSLICE dimensions for a face and block node dimensions. | |
| list | resolve_grid_block_dimensions_for_profiles (dict case_cfg, str case_path, str run_dir=None) |
| Resolve per-block node dimensions for prescribed inlet profile validation. | |
| list | materialize_generated_prescribed_flow_profiles (str run_dir, dict case_cfg, str case_path, list profile_grid_dims=None) |
| Generate dimensional PICSLICE artifacts for generated/field_slice prescribed_flow sources. | |
| float | _to_float (value, str field_name) |
| Convert a YAML scalar to float with a clear error message. | |
| float | _to_finite_float (value, str field_name) |
| Convert a non-boolean YAML scalar to a finite float. | |
| bool | _to_bool (value, str field_name) |
| Convert a YAML scalar/string to bool with a clear error message. | |
| normalize_boundary_conditions_layout (all_blocks_bcs, int num_blocks) | |
| Normalize boundary_conditions to list-of-lists form and validate block count. | |
| set | _les_periodic_axes (dict case_cfg) |
| Reports which logical axes a case declares periodic on both faces. | |
| validate_wall_model_pairing (dict case_cfg, les_cfg, wall_cfg, str case_path, list errors, list warnings) | |
| Rejects wall-model selections that no turbulence treatment can support. | |
| _case_reynolds_number (dict case_cfg) | |
| Reynolds number implied by a case's scaling and fluid properties. | |
| validate_les_configuration (dict case_cfg, dict les_cfg, str case_path, list errors, list warnings) | |
| Checks the structured LES block for values the closure cannot honour. | |
| validate_and_prepare_boundary_conditions (dict case_cfg) | |
| Validate BC entries against currently supported C-side handlers/types and. | |
| str | _schema_path_text (tuple path) |
| Render an internal schema path tuple as a user-facing YAML path. | |
| _lookup_allowed_schema_keys (dict schema, tuple path) | |
| Return allowed keys for a path, honoring '*' dynamic mapping entries. | |
| str | _schema_key_hint (dict schema, tuple path, str key, set allowed) |
| Build a concise typo or hierarchy hint for an unsupported YAML key. | |
| None | _validate_yaml_schema_keys (cfg, dict schema, str file_path, list errors, tuple path=()) |
| Reject unsupported YAML keys before they can be silently ignored by staging. | |
| dict | _ensemble_source_fields (str source) |
| Return the field table an ensemble of one source names its fields from. | |
| tuple | input_quantity (tuple path) |
Return the (dimension, conversion site) recorded for one configuration input. | |
| float | reference_scale (tuple dimension, dict scales) |
| Return the factor that turns a physical quantity of this dimension into solver units. | |
| float | input_reference_scale (tuple path, dict scales) |
| Return the reference scale of one recorded input, for converting a whole payload. | |
| quantity_to_solver_units (value, tuple quantity, dict scales, str label) | |
| Convert a physical value, or a list of them, by one recorded quantity entry. | |
| to_solver_units (value, tuple path, dict scales) | |
| Convert one physical configuration value, or a list of them, to solver units. | |
| dict | resolve_reference_scales (dict case_cfg) |
| Resolve the reference length and velocity (and density, when given) of a case. | |
| str | directory_value_charset_problem (str value) |
| Describe why a directory value cannot be written to a PETSc options line. | |
| str | classify_run_directory_value (value) |
| Classify a configured run directory value. | |
| str | normalized_run_directory (str value) |
| Normalized, comparable form of a contained run directory value. | |
| bool | paths_overlap (str first, str second) |
| Whether two run-relative directories are the same or nested in one another. | |
| tuple | resolve_unsafe_paths_override (dict dirs, str monitor_path) |
| Resolve the unsafe-paths override, requiring a real YAML boolean. | |
| tuple | evaluate_run_directories (dict values, bool override, set explicit=None) |
| Apply every run-directory safety rule to a set of effective directory values. | |
| list | classify_physical_containment (str run_dir, dict values) |
| Classify where each run-owned directory physically lands. | |
| list | check_physical_containment (str run_dir, dict values) |
| Human-readable physical containment violations. | |
| dict | effective_run_directories (dict configured) |
| Fill in defaults for run-owned directories that were not configured. | |
| tuple | validate_run_directory_containment (dict monitor_cfg, str monitor_path) |
| Classify legacy directory values as defense-in-depth during validation. | |
| list | validate_reserved_directory_flags (dict config, str config_path, str label) |
| Reject raw PETSc passthrough options that set run-owned directories. | |
| list | physical_units_transition_notices (dict case_cfg, dict solver_cfg, dict monitor_cfg) |
| Name the inputs whose meaning changed when every input became physical. | |
| validate_simulation_configs (dict case_cfg, dict solver_cfg, dict monitor_cfg, str case_path, str solver_path, str monitor_path, bool restart_source_given=False) | |
| Validates every configuration a simulation run consumes, before any work is done. | |
| "tuple[list, list]" | check_post_checkpoint_cadence_alignment (dict post_cfg, dict monitor_cfg, str post_path, str monitor_path="monitor.yml") |
| Report post step selections that cannot land on a committed checkpoint. | |
| validate_post_config (dict post_cfg, str post_path, dict monitor_cfg=None, dict case_cfg=None) | |
| Validates the post-processing config before running the post-processor. | |
| validate_cluster_config (dict cluster_cfg, str cluster_path) | |
| Validate Slurm scheduler configuration from cluster.yml. | |
| validate_study_config (dict study_cfg, str study_path, bool skip_base_file_check=False) | |
| Validate sweep/study specification from study.yml. | |
| _deep_set (dict container, str dotted_path, value) | |
| Set nested dictionary value, creating intermediate maps when needed. | |
| list | expand_parameter_matrix (dict parameters) |
| Expand study parameter lists into cartesian-product combinations. | |
| list | expand_study_parameter_combinations (dict study_cfg) |
| Expand either cartesian-study parameters or explicit parameter sets. | |
| dict | flatten_study_parameters (dict parameters) |
| Flatten grouped study overrides into scalar dotted-path columns. | |
| list | get_study_parameter_keys (dict study_cfg) |
| Collect ordered parameter keys from either cross-product parameter expansions or explicit parameter sets. | |
| int | get_cluster_total_tasks (dict cluster_cfg) |
| Return cluster total tasks. | |
| str | normalize_extension (str ext) |
| Canonicalize a user-supplied filename extension by trimming whitespace and leading dots. | |
| list | resolve_conductor_entry_point () |
| Resolve how to invoke this conductor again from a batch script. | |
| list | build_spectra_follow_command (str run_dir, str post_path, dict post_cfg, bool recompute=False) |
| Build the batch-script step that measures spectra after the field stage. | |
| "str | None" | executable_petsc_library_dir (str executable_path) |
| The lib/ directory of the PETSc an executable was built against, from its stamp. | |
| list | petsc_library_path_lines ("str | None" library_dir) |
| Shell lines putting one PETSc's lib/ first on LD_LIBRARY_PATH, after module setup. | |
| list | executable_identity_check_lines (str executable, "str | None" expected_version_line, bool pinned=False) |
| Shell lines that compare an executable's reported identity with the staged one. | |
| render_slurm_script (str script_path, str job_name, dict cluster_cfg, list command, str workdir, str stdout_path, str stderr_path=None, dict env_vars=None, dict shell_env_vars=None, str array_spec=None, list follow_commands=None, "tuple | None" identity_check=None) | |
| Render a Slurm batch script for a single command. | |
| "tuple[str | None, list[str]]" | split_launcher_tokens ("str | None" launcher, "list | None" launcher_args=None, str label="launcher") |
| Canonicalize launcher config into executable token plus argv-style flags. | |
| "tuple[str | None, list[str]]" | normalize_cluster_launcher (dict execution) |
| Canonicalize cluster launcher config into executable token plus argv-style flags. | |
| "list[str]" | strip_launcher_size_flags (str launcher_name, "list[str]" launcher_args) |
| Remove explicit MPI task-count flags from known launchers. | |
| list | build_local_launch_command (str executable, list executable_args, int num_procs, str config_search_anchor=None, bool allow_single_rank_launcher_override=False, "int | None" force_num_procs=None) |
| Build local launcher command, allowing env or shared config overrides for login-node MPI quirks. | |
| dict | restart_grid_inputs (str run_dir, dict case_cfg) |
| The inputs a run's geometry is derived from, to compare across a restart. | |
| warn_on_restart_grid_change (dict source_inputs, dict branch_inputs) | |
| Warn at staging when a restart's grid inputs differ from its source run's. | |
| check_restart_continuation (str solver_exe, list solver_args, str run_dir, str config_search_anchor=None) | |
| Ask the simulator whether a staged restart's carried statistics windows can continue. | |
| dict | resolve_cluster_execution (dict cluster_cfg, str config_search_anchor=None, extra_search_anchors=None) |
| Resolve cluster execution launcher settings from shared runtime config plus cluster.yml overrides. | |
| list | build_cluster_launch_command (dict cluster_cfg, str executable, list executable_args, str config_search_anchor=None, extra_search_anchors=None, "int | None" force_num_procs=None) |
| Build scheduler launcher command from cluster config plus optional shared execution defaults. | |
| str | parse_slurm_job_id (str sbatch_output) |
| Extract numeric job id from standard sbatch output. | |
| "tuple[str, str | None]" | slurm_job_end_state (str job_id) |
| Whether a recorded Slurm job (or array) is still queued, and how it ended if not. | |
| dict | submit_sbatch (str script_path, str dependency=None, str dependency_type="afterok") |
| Submit sbatch script and return submission metadata. | |
| _print_validation_errors (list errors) | |
| Prints validation errors and exits. | |
| str | generate_header (str run_id, dict source_files) |
| Creates a standard header block for all generated files. | |
| str | generate_simple_list_file (str run_dir, str run_id, dict cfg, str section, str key, str filename, dict header_sources, str config_dir=None) |
| Generic function to create a file containing a simple list of strings. | |
| list | normalize_monitor_function_names (list names, str field_name) |
| Translate renamed solver functions in a monitor.yml function list. | |
| bool | has_explicit_monitor_whitelist (dict monitor_cfg) |
| Return True when logging.enabled_functions contains at least one entry. | |
| dict | resolve_profiling_config (dict monitor_cfg) |
| Resolve profiling reporting config from monitor.yml. | |
| dict | _diagnostic_info (value) |
| Validate PETSc info logging configuration. | |
| _diagnostic_bool_or_path (value, str key) | |
| Validate a diagnostics value that can be false, true, or a path/viewer string. | |
| bool | _diagnostic_bool (value, str key) |
| Validate a diagnostics boolean value. | |
| _diagnostic_bool_or_all (value, str key) | |
| Validate a diagnostics value that can be false, true, or "all". | |
| str | _diagnostic_default_file (str run_dir, str filename) |
| Return an absolute run-local diagnostics file path. | |
| _diagnostic_resolve_path_or_default (value, str run_dir, str default_filename) | |
| Resolve true/string diagnostics values to a concrete file path. | |
| dict | resolve_diagnostics_config (dict monitor_cfg, "str | None" run_dir=None, str stage_label="Solver") |
| Resolve monitor diagnostics config and default run-local log paths. | |
| list | build_petsc_diagnostics_args (dict monitor_cfg, str run_dir, str stage_label) |
| Build PETSc diagnostics command-line arguments for a run stage. | |
| bool | _statistics_subsystem_available (dict case_cfg, requirement) |
| Report whether the subsystem a statistics field depends on is active. | |
| dict | normalize_field_statistics_config (dict monitor_cfg, dict case_cfg=None) |
| Validate and canonicalize the field-statistics block of monitor.yml. | |
| _normalize_statistics_requests (str label, fields_raw, covariances_raw, dict eligible, case_cfg=None) | |
| Validate and canonicalize the fields and covariances one window or ensemble requests. | |
| list | resolve_field_statistics_flags (dict monitor_cfg, dict case_cfg=None) |
| Serialize field-statistics configuration into control-file option lines. | |
| "int | None" | resolve_statistics_console_output_frequency (dict io_cfg) |
| Resolve the statistics console cadence, mirroring the particle one. | |
| dict | normalize_solution_monitoring_config (dict monitor_cfg) |
| Validate and canonicalize physical-solution convergence monitoring. | |
| dict | resolve_solution_monitoring_flags (dict monitor_cfg) |
| Translate solution-monitoring YAML into the existing C convergence flags. | |
| dict | prepare_monitor_files (str run_dir, str run_id, dict monitor_cfg, dict source_files, str config_dir=None) |
| Generate monitor sidecar files and resolve profiling reporting behavior. | |
| list | generate_multi_block_bcs (str run_dir, str run_id, dict case_cfg, dict source_files, str config_dir=None) |
| Parses multi-block BCs from YAML, generates a .run file for each block, and returns a list of their absolute paths. | |
| format_flag_value (value) | |
| Converts Python types to C-style command-line flag values. | |
| dict | translate_programmatic_grid_settings (dict grid_settings) |
| Return programmatic-grid settings translated to the C node-count contract. | |
| None | validate_programmatic_bridge_grid_settings (dict raw_settings) |
| Validate the scalar programmatic grid settings the bridge PICGRID is built from. | |
| dict | generate_picgrid_from_programmatic_settings (dict raw_settings, str dest_path, float L_ref) |
| Generate a canonical PICGRID file from programmatic Cartesian grid settings. | |
| dict | resolve_grid_da_processor_layout (dict grid_cfg) |
| Resolve optional global DMDA layout, preferring grid-level keys over legacy nested keys. | |
| "list | None" | resolve_grid_node_dims (dict case_cfg, str case_path, "str | None" staged_grid=None) |
| Per-block (IM, JM, KM) node counts the solver will read, without building the grid. | |
| bool | case_declares_periodic_axis (dict case_cfg) |
| Whether any face of any block is PERIODIC, which sets the DMDA stencil width. | |
| list | da_processor_layout_problems (dict grid_cfg, "int | None" num_procs, "list | None" block_dims=None, "dict | None" solver_cfg=None, bool any_periodic=False, "str | None" source=None) |
| Problems with a user-set DMDA layout that would abort grid setup. | |
| None | normalize_decomposition_args (args) |
Resolve -n and the optional --ni/--nj/--nk of picurv run into one rank count. | |
| dict | _decomposition_layout (layout) |
| Express an (ni, nj, nk) tuple as the da_processors mapping the layout checks read. | |
| choose_decomposition (int num_procs, list block_dims, "dict | None" solver_cfg, bool any_periodic) | |
| Choose the MPI decomposition of a structured grid for a rank count. | |
| dict | resolve_decomposition (int num_procs, dict grid_cfg, "list | None" block_dims, "dict | None" solver_cfg, bool any_periodic, explicit=None, "dict | None" cluster_cfg=None) |
| Resolve the MPI decomposition a stage launches with. | |
| "dict | None" | _decomposition_record ("dict | None" resolved) |
| The JSON-serializable record of a resolved decomposition for run metadata. | |
| str | describe_decomposition (dict resolved, int num_procs) |
| One line stating the decomposition a stage launches with. | |
| dict | append_grid_da_processor_layout (list control_lines, dict grid_cfg, int num_procs, "list | None" block_dims=None, "dict | None" solver_cfg=None, bool any_periodic=False, explicit=None, "dict | None" cluster_cfg=None) |
| Resolve the solver's MPI decomposition, report it, and append its flags. | |
| str | normalize_momentum_solver_type (str value) |
| Maps canonical user-facing momentum solver names to C-enum CLI values. | |
| dict | validate_newton_krylov_config (dict cfg) |
| Validate and normalize the structured Newton–Krylov solver block. | |
| str | normalize_solution_convergence_mode (str value) |
| Normalizes the solution-convergence mode selector to the C-side canonical string. | |
| int | normalize_field_init_mode (str value) |
| Maps canonical field init mode names to C enum/int codes (-finit). | |
| "tuple[str, int]" | normalize_initial_condition_field (str value) |
| Normalize a file IC field selector to its staged basename and C enum value. | |
| dict | resolve_ic_payload_provenance (dict ic, int field_code) |
| Resolve which scales a file-backed initial condition was written in. | |
| float | ic_payload_divisor (dict resolved_ic, str case_dir) |
| Return the factor a file-backed initial condition is divided by when staged. | |
| bool | is_generated_ic_provider (dict resolved_ic) |
| Return whether a resolved IC is backed by a registered file generator. | |
| dict | resolve_fluid_scaling (dict case_cfg) |
| Resolve the shared physical and nondimensional fluid scaling contract. | |
| load_generator_module (str script_name, str module_name) | |
Load one of the extensionless scripts under generators/ as a module. | |
| load_ic_generator_module () | |
Load generators/ic.gen, which owns the expression language and the IC providers. | |
| list | normalize_particle_fields (fields_cfg) |
Validate models.physics.particles.fields and lower each value to expressions. | |
| dict | ic_provider_params_to_solver_units (str generator, dict params, dict scales) |
| Convert a provider's validated physical parameters to solver units. | |
| dict | resolve_resampled_velocity_params (dict params, prepared_blocks, dict scales, provider_context=None) |
Validate resampled_velocity parameters and convert them to the provider contract. | |
| normalize_ic_initial_spectra (requested, excluded_axes, generator, required) | |
| Validate the spectra a structured IC provider measures on its own output. | |
| dict | resolve_initial_condition_config (dict ic, prepared_blocks, dict scales, provider_context=None) |
| Resolve legacy and structured initial-condition YAML into one launcher contract. | |
| int | runtime_petsc_index_bytes () |
| Bytes of a PetscInt in the PETSc the solver this conductor drives was built on. | |
| "int | None" | requested_petsc_index_bytes (args=None) |
The index width a command was told to use: --petsc-index-bits, else PICURV_PETSC_INDEX_BITS. | |
| "tuple[int, str]" | required_petsc_index_bytes (dict case_cfg, str case_path, "dict | None" monitor_cfg, "str | None" staged_grid=None) |
| The PetscInt width a new run needs, from its particle count and grid size. | |
| "int | None" | checkpoint_source_petsc_index_bytes (str source_dir) |
| PetscInt width the committed checkpoints under a run output root were written with. | |
| int | select_petsc_index_bytes (int index_bytes, str reason) |
| Make the current command drive the build of one PetscInt width. | |
| int | select_run_petsc_index_bytes (args, dict case_cfg, str case_path, "dict | None" monitor_cfg, "str | None" restart_source_dir=None) |
| Choose and select the PetscInt width a run's solve stage needs. | |
| int | select_existing_run_petsc_index_bytes (str run_dir, args=None) |
| Select the PetscInt width an existing run was staged with, for its later stages. | |
| None | record_run_petsc_index_bytes (str run_dir) |
Record in config/active.json the PetscInt width the current command selected. | |
| int | payload_petsc_index_bytes (str path) |
| PetscInt width of a PETSc payload: as its checkpoint recorded it, else the driven solver's. | |
| list | petsc_index_arguments (int index_bytes) |
| Generator arguments naming a PetscInt width; none for PETSc's default 32-bit. | |
| dict | validate_petsc_vec_binary (str path, "int | None" index_bytes=None) |
| Validate the basic PETSc binary VecView envelope used by ReadFieldData. | |
| dict | write_scaled_petsc_vec_binary (str source, str destination, float divisor) |
| Copy a PETSc binary Vec, dividing every scalar by one factor. | |
| initial_condition_diagnostic_paths (run_dir, resolved_ic) | |
| Resolve spectral IC artifacts through the canonical run layout, also for dry runs. | |
| str | run_initial_spectrum_generator (str field_path, str staged_grid, str spectrum_path, str case_dir, task_cfg=None) |
| Measure the shell-averaged spectrum of a staged initial condition. | |
| str | run_initial_condition_generator (str case_path, str run_dir, dict resolved_ic) |
| Run the repository IC generator. | |
| None | _check_file_ic_matches_grid (dict payload, str staged_grid, dict resolved_ic) |
Refuse a mode: file payload sized for another grid, and say what imports one. | |
| dict | stage_initial_condition_file (str run_dir, str case_path, dict resolved_ic) |
| Materialize and stage one file-backed IC in ReadFieldData's expected layout. | |
| int | normalize_flow_direction_token (str value) |
| Maps a face-token flow direction string to the C FlowDirection enum integer. | |
| bool | _ic_has_inlet (prepared_blocks) |
| Return True if any prepared BC block contains an INLET face. | |
| dict | resolve_ic_cli_params (dict ic, int finit_code, prepared_blocks, dict scales) |
| Resolve all IC parameters and return a dict of PETSc option values. | |
| str | normalize_eulerian_field_source (str value) |
| Normalizes the Eulerian field source selector to the C-side canonical string. | |
| bool | initial_condition_is_authoritative (dict case_cfg, dict solver_cfg) |
| Whether the configured initial condition is the field the solver starts from. | |
| tuple | unused_asset_kinds (dict case_cfg, dict solver_cfg) |
| Asset kinds a run with these configurations would build but never read. | |
| str | normalize_analytical_type (str value) |
| Normalizes the analytical solution selector to the C-side canonical string. | |
| "tuple[float, float, float]" | parse_initial_velocity_components (dict initial_conditions, int finit_code, *bool require_explicit) |
| Parse initial-condition velocity components with mode-aware defaults. | |
| "str | None" | infer_unique_inlet_axis_from_prepared_bcs (list prepared_blocks) |
| Infer the unique inlet axis across all blocks using C-side "primary inlet" ordering. | |
| int | normalize_particle_init_mode (str value) |
| Maps canonical particle init mode names to C enum/int codes (-pinit). | |
| int | normalize_interpolation_method (str value) |
| Maps interpolation method names to C enum/int codes (-interpolation_method). | |
| int | normalize_les_model (value) |
| Maps LES model selectors to C enum/int codes (-les). | |
| int | normalize_les_test_filter (value) |
| Maps LES test-filter kernel names to the C -les_test_filter_kernel flag. | |
| int | normalize_les_filter_width (value) |
| Maps LES grid-filter-width model names to the C -les_filter_width flag. | |
| int | normalize_les_averaging_mode (value) |
| Maps LES coefficient-averaging mode names to the C -les_averaging_mode flag. | |
| int | normalize_les_clip_mode (value) |
| Maps LES coefficient-limiting mode names to the C -les_clip_mode flag. | |
| str | normalize_les_averaging_directions (value) |
| Maps a list of homogeneous logical directions to the C flag's string form. | |
| int | normalize_wall_function_model (value) |
| Maps wall-function model selectors to the C -wallfunction flag. | |
| bool | resolve_enabled_flag (dict cfg, str path, bool default=True) |
Resolves a structured enabled flag and rejects non-boolean values. | |
| append_les_parameter_flags (dict les_cfg, list control_lines) | |
| Appends the LES closure parameter flags from a structured les block. | |
| "dict | None" | resolve_les_diagnostics (dict case_cfg, dict monitor_cfg, bool warn=False) |
| Resolve the LES diagnostic log settings from monitor.yml or their deprecated location. | |
| append_les_diagnostics_flags ("dict | None" diagnostics, list control_lines) | |
| Append the LES diagnostic log flags resolved by resolve_les_diagnostics(). | |
| append_turbulence_flags (dict models, list control_lines, dict scales=None) | |
| Appends turbulence model flags from legacy or structured case.yml blocks. | |
| control_value (value, str context) | |
| Guard a value that is written verbatim into the generated control file. | |
| append_passthrough_flags (list control_lines, dict options) | |
| Appends raw CLI flags to the control list from a {flag: value} dict. | |
| dict | resolve_solver_monitoring_flags (dict monitor_cfg) |
| Resolve human-readable solver monitoring YAML to raw control flags. | |
| list | resolve_traced_particle_ids (dict monitor_cfg) |
Return the sorted, distinct particle IDs of logging.trace_particles. | |
| "int | None" | resolve_particle_console_output_frequency (dict io_cfg) |
| Return the effective particle-console snapshot cadence from monitor.yml. | |
| parse_and_add_model_flags (dict case_cfg, list control_lines) | |
| Parses the 'models' section of case.yml and adds corresponding C-solver flags. | |
| dict | parse_solver_config (dict solver_cfg, dict scales=None, dict case_cfg=None) |
| Parses the structured solver.yml into a flat dictionary of {flag: value}. | |
| generate_solver_control_file (run_dir, run_id, configs, num_procs, monitor_files, restart_source_dir=None, continue_mode=False, str config_dir=None) | |
| Generates the main .control file for the C-solver. | |
| dict | resolve_post_decomposition (str run_dir, int num_procs, explicit=None, "dict | None" cluster_cfg=None) |
| Resolve the postprocessor's MPI decomposition from the run's staged configuration. | |
| str | generate_post_recipe_file (str run_dir, str run_id, dict post_cfg, dict source_files, monitor_cfg=None, "dict | None" decomposition=None) |
| Generates a key=value config file (post.run) for the C post-processor. | |
| execute_command (list command, str run_dir, str log_filename, dict monitor_cfg=None) | |
| Executes a command, streaming its output to the console and a log file. | |
| str | format_command_for_display (list command) |
| Render a shell-safe command string for console and log output. | |
| str | resolve_command_log_path (str run_dir, str log_filename) |
| Resolve a command log filename relative to the run directory. | |
| subprocess.CompletedProcess | _run_captured_command (list command, str run_dir) |
| Run a command and capture combined stdout/stderr details for later inspection. | |
| _require_successful_command (list command, subprocess.CompletedProcess result) | |
Raise CommandExecutionError when a captured command failed. | |
| str | _capture_command_stdout (list command, str run_dir) |
| Run a command, require success, and return stripped stdout text. | |
| _stream_command_to_console_and_log (list command, str run_dir, log_file) | |
| Stream command output to stdout and an already-open log file. | |
| dict | _get_git_head_state (str run_dir) |
| Capture the current git HEAD branch name and commit hash. | |
| "list[tuple[str, str | None]]" | _get_local_branches_with_upstreams (str run_dir) |
| Return local branch names plus their configured upstreams. | |
| bool | _working_tree_has_tracked_changes (str run_dir) |
Return True when the repository has staged or unstaged tracked changes. | |
| _attempt_pull_cleanup (str run_dir, bool rebase, log_file) | |
Best-effort cleanup after a failed git pull so the original branch can be restored. | |
| _restore_git_head (str run_dir, dict original_head, log_file) | |
| Restore the repository back to the branch or detached commit it started on. | |
| None | _refuse_detached_source_checkout (str source_project_root, str action) |
| Refuse a branch pull when the source checkout is pinned to a detached commit. | |
| pull_all_source_branches (str run_dir, str log_filename, bool rebase=True) | |
| Refresh every local tracking branch in the source repository, then restore the starting branch. | |
| auto_identify_run_inputs (str config_dir) | |
| Auto-detect case.yml, monitor.yml, and *.control in a run config directory. | |
| str | resolve_post_source_directory (str run_dir, dict monitor_cfg, dict post_cfg, bool strict=True) |
| Resolve post source directory token and optionally enforce existence. | |
| render_slurm_array_stage_script (str script_path, str job_name, dict cluster_cfg, str array_spec, str case_index_tsv, str stage, str solver_exe, str post_exe, str stdout_path, str stderr_path, "str | None" expected_version_line=None) | |
| Render array script that maps SLURM_ARRAY_TASK_ID to per-case run artifacts. | |
| render_metrics_aggregate_script (str script_path, str job_name, dict cluster_cfg, str study_dir, str picurv_path) | |
| Generate a single-node sbatch script that runs metrics aggregation. | |
| reduce_metric_values (values, str reduction) | |
| Reduce a metric series to one scalar according to the requested reducer. | |
| extract_metric_from_csv (str case_dir, dict spec) | |
| Extract a scalar metric from a CSV source. | |
| extract_metric_from_log (str case_dir, dict spec) | |
| Extract a scalar metric from a log file using regex. | |
| normalize_metric_spec (metric) | |
| Normalize study metric definitions to a common dictionary form. | |
| dict | _read_previous_metric_rows (str results_dir) |
| Read the metrics table an earlier aggregation wrote, keyed by case id. | |
| str | aggregate_study_metrics (dict study_cfg, list cases, str results_dir) |
| Collect metric values from generated case directories into one CSV. | |
| str | _study_parameter_label (str key) |
| Return a concise report label for a study parameter path. | |
| str | _study_metric_label (dict study_cfg, str metric) |
| Resolve an optional configured metric label or humanize its name. | |
| "list | None" | _numeric_study_column (list rows, str key) |
| Parse one complete, finite numeric study-table column. | |
| "dict | None" | _infer_study_plot_axis (dict study_cfg, list rows) |
| Infer the scientifically meaningful independent variable of a study. | |
| infer_plot_x_axis (dict study_cfg, list rows) | |
| Infer x-axis key/values for study plots. | |
| str | _format_study_group_value (value) |
| Format a secondary study parameter compactly for a legend. | |
| list | _study_plot_groups (dict study_cfg, list rows, dict axis, str metric) |
| Group metric points by any secondary varied study parameters. | |
| bool | _study_use_log_scale (list values, bool semantic_hint=False) |
| Use log scaling only for positive data spanning a meaningful range. | |
| "tuple[float, float] | None" | _study_linear_y_limits (list values) |
| Build padded linear limits that include zero for non-negative metrics. | |
| generate_study_plots (dict study_cfg, str metrics_csv, str plots_dir) | |
| Generate metric-vs-parameter plots for completed studies. | |
| str | _command_to_string (list command_tokens) |
| Render a command list as a shell-safe display string. | |
| str | _resolve_post_source_directory_preview (str run_dir, dict monitor_cfg, dict post_cfg) |
| Resolve post source directory without side effects or stdout/stderr output. | |
| dict | build_run_dry_plan (args) |
Build a no-write execution plan for run --dry-run. | |
| None | add_planned_grid_artifacts (dict plan, dict case_cfg, str run_dir) |
| Add grid-mode-specific staged artifacts to a dry-run plan. | |
| None | add_planned_profile_artifacts (dict plan, dict case_cfg, str run_dir) |
| Add generated prescribed-flow profile artifacts to a dry-run plan. | |
| None | add_planned_initial_condition_artifacts (dict plan, dict case_cfg, dict solver_cfg, str run_dir) |
| Add authoritative file-backed initial-condition artifacts to a dry-run plan. | |
| render_run_dry_plan (dict plan, str output_format="text") | |
| Render dry-run plan in human or JSON format. | |
| validate_workflow (args) | |
Implements picurv validate without launching solver/post workflows. | |
| str | _asset_file_sha256 (str path) |
| Hash an asset source or payload without loading it into memory. | |
| str | _stable_mapping_sha256 (payload) |
| Hash a JSON-compatible value with deterministic serialization. | |
| dict | _provider_source_fingerprints (value, str case_path, str key="") |
| Hash every existing file explicitly referenced by an asset provider. | |
| dict | build_case_asset_graph (dict case_cfg, str case_path) |
| Classify case inputs into precomputable or simulator-runtime providers. | |
| list | _asset_selection (dict graph, requested=None, *bool precomputable_only=False) |
| Resolve requested asset kinds plus dependency closure. | |
| list | _asset_payload_files (str build_root, str kind) |
| Enumerate canonical files belonging to one asset kind in a build tree. | |
| dict | _build_selected_asset_payloads (str build_root, dict case_cfg, str case_path, list selected) |
| Execute existing generators into one isolated run-like build tree. | |
| dict | _picgrid_geometry_summary (str path) |
| Read a canonical PICGRID and summarize what a user would want to check. | |
| bool | _write_structured_grid_preview (str picgrid_path, str destination, dims) |
| Write a single-block ASCII VTS preview of a staged PICGRID. | |
| dict | _build_asset_inspection (str kind, str build_root, dict provider, list payload_files) |
| Produce the inspection material published beside an asset's payload. | |
| dict | _publish_asset_object (str workspace_root, str build_root, dict provider, list payload_files) |
| Publish one immutable content-addressed asset object atomically. | |
| str | _workspace_asset_set_name (str workspace_root, str case_path) |
| Return a collision-free, readable mutable asset-set name. | |
| str | _write_workspace_asset_set (str workspace_root, str case_path, dict graph, dict references) |
| Atomically update the named asset set and workspace asset catalog. | |
| dict | precompute_case_assets (str workspace_root, dict case_cfg, str case_path, requested=None, bool precomputable_only=False) |
| Build and publish a selected deterministic asset dependency closure. | |
| str | _workspace_asset_set_path (str workspace_root, str case_path) |
| Return the mutable asset-set pointer associated with a case config name. | |
| _find_stored_asset (str workspace_root, dict provider) | |
| Find a published object built from exactly this provider's inputs. | |
| dict | plan_run_assets (dict case_cfg, str case_path, skip_kinds=()) |
| Plan reuse/build/runtime actions for all configured run providers. | |
| str | _materialize_asset_file (str source, str destination) |
| Expose one immutable shared-asset file through reflink, hardlink, or copy. | |
| dict | materialize_run_assets (str run_dir, dict case_cfg, str case_path, bool require_precomputed=False, bool fetch_missing=False, skip_kinds=()) |
| Resolve/build workspace assets and write the exact run input lock. | |
| precompute_workflow (args) | |
| Resolve, preflight, and atomically publish reusable workspace assets. | |
| run_workflow (args) | |
| Main orchestrator for the 'run' command (local and Slurm modes). | |
| list | parse_case_index_tsv (str tsv_path) |
| Parse a case_index.tsv file back into a list of case entry dicts. | |
| dict | resolve_sweep_stage_executables (list run_dirs) |
| Choose the executables an array stage launches for every member of a study. | |
| sweep_workflow (args) | |
| Study/sweep orchestration using Slurm job arrays. | |
| sweep_continue_workflow (args) | |
| Continue a partially-completed Slurm parameter sweep study. | |
| sweep_reaggregate_workflow (args) | |
| Re-run metrics aggregation and plot generation for an existing study. | |
| _read_yaml_if_exists (str filepath) | |
| Read YAML when present, otherwise return None. | |
| _read_json_if_exists (str filepath) | |
| Read JSON when present, otherwise return None. | |
| _parse_int_loose (value) | |
| Best-effort integer parsing for summary extraction. | |
| _parse_float_loose (value) | |
| Best-effort float parsing for summary extraction. | |
| _extract_numeric_tuple (str text) | |
| Extract a numeric tuple from a string like '(1, 2, 3)'. | |
| dict | _build_summary_context (str run_dir) |
| Resolve run-local config and artifact paths for summarize. | |
| dict | _require_summary_config (dict context, str name) |
| Return one explicitly requested copied config or fail with a structured error. | |
| dict | _build_run_overview (dict context) |
| Build timestep-independent run metadata for summarize. | |
| dict | _summarize_turbulence (dict turbulence_cfg) |
| Build compact turbulence and wall-model selections. | |
| dict | _build_case_overview (dict context) |
| Build a curated case.yml summary with useful derived quantities. | |
| dict | _summary_scalar_transport (dict context, dict solver_cfg) |
| Scalar-transport parameters as the run resolves them, wherever they are set. | |
| dict | _build_solver_overview (dict context) |
| Build a curated solver.yml summary with normalized selections. | |
| dict | _build_monitor_overview (dict context) |
| Build a curated monitor.yml summary with resolved defaults. | |
| "tuple[dict, list[int]]" | _parse_continuity_metrics_log (str log_dir) |
| Read the continuity record into rows by step (one per block) plus observed order. | |
| "tuple[dict, list[int]]" | _parse_particle_metrics_log (str log_dir, str metrics_dir) |
| Read the per-step particle record into rows by step plus observed order. | |
| "tuple[dict, dict, list[int]]" | _parse_momentum_convergence_logs (str log_dir) |
| Read the per-block momentum records (Picard history, Newton summary) into rows by step. | |
| "tuple[dict, dict, list[int]]" | _parse_poisson_convergence_logs (str log_dir) |
| Read the per-block Poisson histories into each step's last iteration. | |
| "tuple[dict, list[int]]" | _parse_profiling_timestep_csv (str filepath) |
| Parse profiling timestep CSV into latest rows by step plus observed order. | |
| "tuple[dict, list[int], dict]" | _parse_runtime_memory_log (str filepath) |
| Read the runtime memory record into rows by step and its final status. | |
| "tuple[dict, list[int]]" | _parse_solution_convergence_log (str log_dir) |
| Read the solution-convergence record into rows by step plus observed order. | |
| "list[str]" | _find_solver_stream_log_candidates (str run_dir, str log_dir) |
| Return plausible solver stream logs for local and Slurm runs. | |
| dict | _parse_particle_snapshot_file (str filepath) |
| Parse sampled particle snapshots from a solver stream log. | |
| "int | None" | _find_previous_snapshot_step ("list[int]" snapshot_steps, int step) |
| Return the nearest earlier snapshot step when available. | |
| dict | _compute_particle_snapshot_delta ("list[dict]" current_rows, "list[dict]" previous_rows) |
| Compute sampled deltas between two particle snapshot samples. | |
| dict | _build_particle_snapshot_summary (str source, int step, "list[dict]" rows, int preview_rows, particle_console_output_freq, particle_log_interval, "int | None" previous_step=None, "list[dict] | None" previous_rows=None) |
| Build sampled diagnostics for one particle console snapshot. | |
| dict | _find_particle_snapshot_for_step (str run_dir, str log_dir, int step, int preview_rows, particle_console_output_freq, particle_log_interval) |
| Locate and summarize a particle console snapshot for one step. | |
| _resolve_summary_step (requested_step, continuity_rows, particle_rows, momentum_rows, poisson_rows, profiling_rows, memory_rows=None, convergence_rows=None, step_orders=None, str selection_mode="latest") | |
| Select a step to summarize from available metric artifacts. | |
| str | _format_summary_float (value, str spec=".6e", str missing="n/a") |
| Format optional numeric values for summary text output. | |
| float | _summary_source_mtime (paths) |
| Return the newest modification time among one or more summary sources. | |
| "list[list[int]]" | _order_summary_step_orders ("list[tuple[list[int], object]]" sources) |
| Order observed step sequences by the recency of their source files. | |
| dict | build_run_summary_payload (str run_dir, "int | None" step=None, int snapshot_rows=5, str selection_mode="latest") |
| Build a read-only run-step summary from existing PICurv artifacts. | |
| render_run_summary (dict payload, str output_format="text") | |
| Render a run-step summary in human or JSON form. | |
| str | _summary_display_value (value) |
| Format one configuration-summary value for compact text output. | |
| _print_config_header (str title, "str | None" subtitle=None) | |
| Print a strong dashboard-style configuration summary header. | |
| _print_config_group (str title, list rows) | |
| Print an aligned configuration-summary field group. | |
| list | _flatten_summary_mapping (dict mapping, str prefix="") |
| Flatten nested summary mappings into readable dotted field rows. | |
| _render_run_overview_text (dict summary) | |
| Render run metadata as a compact dashboard. | |
| _render_case_summary_text (dict summary) | |
| Render the case summary as a glanceable simulation dashboard. | |
| _render_solver_summary_text (dict summary) | |
| Render the solver summary as a glanceable numerical-method dashboard. | |
| _render_monitor_summary_text (dict summary) | |
| Render the monitor summary as a glanceable observability dashboard. | |
| render_selected_summary (dict payload, str output_format="text") | |
| Render selected timestep-independent config views and optional health. | |
| str | _humanize_plot_identifier (str value) |
| Convert one machine-oriented identifier into a readable plot label. | |
| str | _summary_field_label (str field) |
| Return the report-facing label for one logged scalar field. | |
| "float | None" | _summary_physical_time (dict context, dict record) |
| Resolve a record's physical time from its artifact or copied case configuration. | |
| _read_runtime_diagnostics_csv (path) | |
Yields (segment, row) for each data line of one of the solver's CSV records. | |
| "str | None" | _log_family_path (str log_dir, str base) |
| Return a solver record's CSV, or the text log an older run wrote instead. | |
| "list[tuple[int, str]]" | _block_family_paths (str log_dir, *str bases) |
Return (block, path) for each per-block solver record, CSV preferred per block. | |
| "tuple[str | None, list]" | _continuity_rows (str log_dir) |
Return the continuity record's path and its (segment, row) pairs. | |
| "tuple[str | None, list]" | _particle_step_rows (str log_dir, str metrics_dir) |
Return the per-step particle record's path and its (segment, row) pairs. | |
| "list[tuple[int, str, list]]" | _picard_history_rows (str log_dir) |
Return (block, path, [(segment, row)]) for each Picard momentum history. | |
| "list[tuple[int, str, list]]" | _newton_history_rows (str log_dir) |
Return (block, path, [(segment, row)]) for each Newton iteration history. | |
| "list[tuple[int, str, list]]" | _newton_summary_rows (str log_dir) |
Return (block, path, [(segment, row)]) for each Newton per-step summary. | |
| "list[tuple[int, str, list]]" | _poisson_history_rows (str log_dir) |
Return (block, path, [(segment, row)]) for each Poisson iteration history. | |
| list | _runtime_memory_rows (str path) |
Return the runtime memory record's (segment, row) pairs (CSV, or an older run's text log). | |
| _typed_csv_value (str text) | |
| Return a CSV cell as a float (written with a point or exponent), an int, or the text. | |
| "tuple[str | None, list]" | _solution_convergence_rows (str log_dir) |
Return the solution-convergence record's path and its (segment, row) pairs. | |
| _append_summary_plot_record (list records, str source, step, str line, dict values, str source_path, int segment=0, dict coordinates=None) | |
| Append one numeric append-ordered record for summarize plotting. | |
| bool | _is_summary_plot_continuation_marker (str line) |
| Return whether a log line starts a new continuation segment. | |
| list | _collect_summary_plot_records (dict context) |
| Collect append-ordered numeric records from summarize-supported scalar logs. | |
| list | _collect_spectra_plot_records (dict context) |
| Collect the per-step scalar histories written by the spectra post stage. | |
| list | _collect_profile_plot_records (dict context) |
Collect the profile histories the profile_series reducer wrote. | |
| list | _build_summary_plot_catalog (list records) |
| Build available qualified-series metadata from plot records. | |
| list | _representative_indices (int count, int maximum=6) |
| Select evenly distributed indices while always retaining both endpoints. | |
| dict | _build_spectrum_plot_request (dict context, str task, bool reference, bool linear_y, "str | None" output_path) |
| Build a plot.gen request drawing representative measured spectra. | |
| dict | _build_summary_plot_request (dict context, list records, str series, "int | None" last_n, bool linear_y, "str | None" output_path) |
| Build one normalized plot.gen request from collected summarize records. | |
| _render_summary_plot_catalog (list catalog, str output_format) | |
| Render available summarize plot-series metadata. | |
| str | _summary_table_path (dict context, str name) |
Resolve a summarize --table name to the CSV it prints. | |
| _list_summary_tables (dict context, str output_format) | |
Print the summarize --table names whose CSV this run has, with row counts. | |
| _render_summary_table (dict context, str name, last_n, columns, str output_format) | |
| Print the last rows of one of the run's CSV records as aligned columns (or JSON). | |
| _invoke_plot_gen (dict request) | |
| Invoke standalone plot.gen with one normalized request over stdin. | |
| summarize_workflow (args) | |
| Build and render a read-only health summary for a run step. | |
| dict | _resolve_submission_target (str run_dir=None, str study_dir=None) |
| Resolve a run/study submission target from explicit directory flags. | |
| dict | _get_submission_stage_metadata (dict target_context, str stage_name) |
| Return stored metadata for one staged submission target. | |
| list | _get_recorded_submission_stages (dict target_context) |
| Return stage names explicitly recorded in scheduler submission metadata. | |
| str | _build_submit_missing_stage_hint (dict target_context, str requested_stage, list selected_stages) |
| Build an actionable hint for requested submit stages missing from metadata. | |
| _set_submission_stage_metadata (dict target_context, str stage_name, dict stage_meta) | |
| Persist one stage's metadata back into the submission payload. | |
| _write_submission_target_metadata (dict target_context) | |
| Write updated submission metadata back to disk. | |
| tuple | staged_control_directories (str control_path) |
| Read run-owned directory values from a staged control file. | |
| list | preflight_config_directories (str root_dir) |
| Every config directory under a run or study root that may hold a control file. | |
| tuple | preflight_staged_run_directories (str root_dir) |
| Re-check run-directory safety against an already-staged run or study. | |
| list | read_text_file_lines (str path) |
| Read a text file into a list of lines. | |
| submit_staged_jobs (args) | |
| Submit previously staged Slurm artifacts from an existing run/study directory. | |
| submit_staged_local_run (args, dict target_context, list selected_stages) | |
| Execute previously staged local run commands from scheduler/submission.json. | |
| cancel_run_jobs (args) | |
| Cancel Slurm-submitted jobs for an existing run directory. | |
| _workspace_yaml_role (str path) | |
| Infer the owned workspace role of one copied YAML file. | |
| _rewrite_workspace_path_values (value, dict replacements) | |
| Rewrite copied template path scalars to workspace-root-relative homes. | |
| _choose_primary_workspace_role (list candidates, str role, str template_name) | |
| Select the canonical role file from a template that may carry variants. | |
| dict | organize_initialized_workspace (str workspace_root, str template_name, str source_template_root=None) |
| Convert a copied example into the canonical editable workspace layout. | |
| dict | import_workspace_input (str workspace_root, str kind, str source, str name=None, str mode="copy") |
| Explicitly import or register one workspace input. | |
| inputs_workflow (args) | |
| Handle explicit workspace input management. | |
| version_workflow (args) | |
Report, and for the status action validate, the shared build identity. | |
| None | _print_petsc_build (dict identity) |
| Print the PETSc an executable was built against and the library it would load. | |
| None | _require_clean_source_checkout (str action) |
| Refuse version-changing Git operations in a dirty source checkout. | |
| subprocess.CompletedProcess | _git_source_command (list arguments) |
| Run a checked Git command against the active PICurv source checkout. | |
| source_workflow (args) | |
| Fetch source history without silently changing the active code. | |
| _workspace_requested_version (str workspace_root) | |
| Resolve an exact version requested by an initialized workspace. | |
| versions_workflow (args) | |
| List or activate a release using the existing source/build owners. | |
| str | _resolve_version_ref (str version) |
| Resolve a user-named version to a Git ref that exists in the source checkout. | |
| init_case (args) | |
| Implements the 'init' command. | |
| sync_case_config_command (args) | |
| Refresh template-managed config/docs files in a case directory. | |
| pull_source_repo (args) | |
| Refresh source branches in the repository resolved from a case directory. | |
| build_project (args) | |
| Implements the 'build' command. | |
| None | run_project_make (str source_project_root, "list[str]" make_args) |
Run the project Makefile with caller-supplied arguments, defaulting to all. | |
|
protected |
Remove site-package paths for a different Python major/minor version.
| [in] | paths | Candidate sys.path entries. |
Definition at line 101 of file core.py.
|
protected |
Remove a failed/partial import package tree from sys.modules.
| [in] | package_name | Top-level package name. |
Definition at line 121 of file core.py.
| picurv_cli.core.require_numpy | ( | ) |
Import NumPy only for commands that need numeric reductions.
Definition at line 132 of file core.py.
| picurv_cli.core.optional_matplotlib_pyplot | ( | ) |
Import matplotlib.pyplot lazily for study plot generation.
Definition at line 162 of file core.py.
|
protected |
Read the single release version shared by every PICurv executable.
Definition at line 208 of file core.py.
|
protected |
Run one git command in the source checkout.
| [in] | arguments | Git arguments. |
Definition at line 224 of file core.py.
|
protected |
Resolve reproducible release, commit, and dirty-tree build identity.
One git describe --long --dirty gives the commit, its distance from the release tag, and whether tracked files differ from it (untracked files are ignored, as git status --untracked-files=no did). Only when the tag is missing does it fall back to the commit, a dirty check, and the commit count. On a cold network filesystem each git call costs seconds, which is why this is reached lazily through picurv_build() rather than at import.
| [in] | release_version | Release version read from VERSION. |
Definition at line 238 of file core.py.
| dict picurv_cli.core.picurv_build | ( | ) |
The conductor's own build identity, resolved on first use and kept for the process.
Commands that only parse, validate, or scaffold never touch git; manifests, locks, and picurv version do, once. Callers that store it copy it.
Definition at line 291 of file core.py.
|
protected |
Find a named file at or above an arbitrary filesystem anchor.
| [in] | start | File or directory from which to search. |
| [in] | filename | Basename to locate. |
Definition at line 467 of file core.py.
| picurv_cli.core.find_workspace_root | ( | * | anchors | ) |
Locate the nearest initialized PICurv workspace for supplied anchors.
| [in] | anchors | Candidate config, run, study, or current-working-directory paths. |
Definition at line 487 of file core.py.
| dict picurv_cli.core.load_workspace_config | ( | str | workspace_root | ) |
Load and validate the immutable workspace identity/configuration file.
| [in] | workspace_root | Initialized workspace directory. |
Definition at line 502 of file core.py.
| dict picurv_cli.core.enforce_workspace_version | ( | str | workspace_root | ) |
Enforce an optional workspace PICurv version requirement.
| [in] | workspace_root | Initialized workspace directory. |
Definition at line 522 of file core.py.
| dict picurv_cli.core.enforce_reproducibility_policy | ( | str | workspace_root | ) |
Enforce an optional workspace policy demanding a clean, released build.
Exploratory work should stay frictionless, so this is opt-in: a workspace running a campaign that will be published sets it once, and PICurv then refuses to stage from a modified or untagged tree instead of recording the compromise in a manifest nobody reads until later.
| [in] | workspace_root | Initialized workspace directory, or None. |
| ValueError | when the active build does not satisfy the configured policy. |
Definition at line 560 of file core.py.
| str picurv_cli.core.resolve_workspace_path | ( | str | anchor_file, |
| str | candidate, | ||
| *bool | allow_external = False |
||
| ) |
Resolve a user path against its workspace and reject implicit escapes.
| [in] | anchor_file | Config file whose workspace owns the reference. |
| [in] | candidate | Workspace-relative path text. |
| [in] | allow_external | Whether an explicit import/reference operation permits an absolute path. |
Definition at line 621 of file core.py.
| None picurv_cli.core.ensure_workspace_layout | ( | str | workspace_root | ) |
Materialize the uniform, cheap directory skeleton for one workspace.
| [in] | workspace_root | Workspace root to initialize. |
Definition at line 658 of file core.py.
| str picurv_cli.core.initialize_workspace_root | ( | str | workspace_root, |
| str | template_name | ||
| ) |
Create the workspace skeleton and its identity file at one root.
| [in] | workspace_root | Workspace root to initialize. |
| [in] | template_name | Example template the workspace was created from. |
Definition at line 667 of file core.py.
| None picurv_cli.core.ensure_run_layout | ( | str | run_dir | ) |
Materialize the uniform, cheap directory skeleton for one run.
| [in] | run_dir | Run root to initialize. |
Definition at line 696 of file core.py.
| tuple picurv_cli.core.validate_run_directory_structure | ( | str | run_dir | ) |
Refuse a run whose root has grown a directory the layout does not define.
The run topology is a contract: manifest.json publishes it, the solver's reserved-directory guard defends it, and storage classifies against it. A directory beside output/ breaks all three at once - it is routed by nothing, classified as unclassified, and therefore archived forever and pruned never. Catching it when the run is staged or resumed is the only point where the answer is still "move it", rather than "it is already in
every archive of this run".
Unexpected files are reported and allowed. A stray note at a run root costs nothing and refusing to resume a long campaign over one would be a worse failure than the one being prevented.
| [in] | run_dir | Run root to check. |
Definition at line 716 of file core.py.
| None picurv_cli.core.enforce_run_directory_structure | ( | str | run_dir | ) |
Apply validate_run_directory_structure() as a refusal at run time.
| [in] | run_dir | Run root to check. |
Definition at line 761 of file core.py.
| str picurv_cli.core.case_run_label | ( | dict | case_cfg, |
| str | case_path | ||
| ) |
Resolve the stable human-facing portion of a generated run identifier.
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Source case YAML path. |
Definition at line 783 of file core.py.
| str picurv_cli.core.allocate_generated_run_id | ( | str | runs_root, |
| dict | case_cfg, | ||
| str | case_path | ||
| ) |
Build the generated run identity, disambiguating a same-second collision.
The identity is <run label>_<timestamp> at one-second resolution, so two runs of the same case launched back to back - a script, or a smoke sequence - would otherwise name the same directory. Creating a run never writes into an existing one, so the identity is advanced instead of the launch being refused for a clock artifact.
| [in] | runs_root | Directory generated runs are created beneath. |
| [in] | case_cfg | Parsed case configuration supplying the run label. |
| [in] | case_path | Case path, for the label's fallback. |
runs_root. Definition at line 801 of file core.py.
| bool picurv_cli.core.discard_unused_run_directory | ( | str | run_dir, |
| *bool | created, | ||
| bool | staged = False |
||
| ) |
Remove a generated run directory that never received any content.
Only a directory this invocation created, and which still holds no files, is removed: an existing run, or one that already produced output, is never touched by a staging failure. With staged the directory may hold the files this invocation staged, for a refusal after staging but before any launch.
| [in] | run_dir | Run directory that was about to be staged. |
| [in] | created | Whether this invocation created the directory. |
| [in] | staged | Whether files this invocation staged, and nothing else, may be present. |
Definition at line 823 of file core.py.
|
protected |
Content digest of one file, or None when it cannot be read.
| [in] | path | File to digest. |
Definition at line 845 of file core.py.
| dict picurv_cli.core.build_software_lock | ( | "str | None" | run_dir = None | ) |
Capture the exact software identity a run is about to execute with.
The release and commit say which source is checked out; they do not say which bytes ran. Hashing the executables and the generators pins that, so a queued job rebuilt out from under it is detectable afterwards rather than merely suspected.
| [in] | run_dir | Run whose pinned executables are hashed; the installation's when None. |
Definition at line 861 of file core.py.
|
protected |
Best-effort record of the PETSc, MPI, and compiler in the shell staging the run.
This is the staging environment, which need not be what the binaries were built against; each executable's own PETSc is recorded from its build stamp.
Definition at line 903 of file core.py.
| str picurv_cli.core.write_software_lock | ( | str | run_dir | ) |
Write the run's software lock beside its asset lock.
| [in] | run_dir | Run directory receiving the lock. |
Definition at line 948 of file core.py.
| str picurv_cli.core.workspace_artifact_root | ( | str | workspace_root, |
| str | kind | ||
| ) |
Return the canonical workspace-owned root for runs or studies.
| [in] | workspace_root | Initialized workspace, or None for standalone mode. |
| [in] | kind | Either runs or studies. |
Definition at line 960 of file core.py.
|
protected |
Return a portable workspace-relative path when possible.
| [in] | path | Path to normalize. |
| [in] | workspace_root | Optional initialized workspace root. |
Definition at line 974 of file core.py.
| dict picurv_cli.core.snapshot_run_configuration | ( | str | run_dir, |
| dict | source_paths, | ||
| bool | continuation = False |
||
| ) |
Snapshot editable YAML inputs without erasing prior continuation state.
| [in] | run_dir | Owning run directory. |
| [in] | source_paths | Role-to-source-path mapping. |
| [in] | continuation | Whether this is a continuation configuration revision. |
Definition at line 989 of file core.py.
| dict picurv_cli.core.capture_continuation_records | ( | str | run_dir, |
| str | restart_dir | ||
| ) |
Save what a continuation's staging changes, so a refusal can undo it.
Staging rewrites the records in CONTINUATION_STAGED_RECORDS and materializes the restart checkpoint into the run's restart input, so both are captured before restart resolution runs.
| [in] | run_dir | Existing run directory. |
| [in] | restart_dir | The run's restart input directory. |
Definition at line 1036 of file core.py.
| picurv_cli.core.restore_continuation_records | ( | str | run_dir, |
| dict | saved, | ||
| str | revision | ||
| ) |
Undo a refused continuation's staging: restore its records, drop its revision.
Removes the restart checkpoints staging materialized; everything else a continuation stages, including pinned executables, lives in the revision directory, so removing it leaves the run as it was.
| [in] | run_dir | Existing run directory. |
| [in] | saved | State returned by capture_continuation_records(). |
| [in] | revision | Configuration revision the refused staging created. |
Definition at line 1055 of file core.py.
| dict picurv_cli.core.load_active_run_configuration | ( | str | run_dir | ) |
Load the active immutable configuration revision for a run.
| [in] | run_dir | Run directory. |
Definition at line 1082 of file core.py.
| dict picurv_cli.core.load_run_executables | ( | str | run_dir | ) |
Return the executables a run is pinned to, as recorded by its active configuration.
| [in] | run_dir | Run directory. |
path made absolute; empty when the run launches the installation's executables. Definition at line 1107 of file core.py.
| str picurv_cli.core.run_executable_path | ( | "str | None" | run_dir, |
| str | name | ||
| ) |
Resolve the executable a run launches: its pinned copy, else the installation's.
| [in] | run_dir | Run directory, or None when no run exists yet. |
| [in] | name | simulator or postprocessor. |
| ValueError | when the run records a pinned copy that is no longer on disk. |
Definition at line 1125 of file core.py.
| dict picurv_cli.core.pin_run_executables | ( | str | run_dir, |
| str | revision | ||
| ) |
Copy the installation's executables into a run's configuration revision.
The installation's bin/ is rebuilt in place, so a job that resolves its executable there when it starts runs whatever was built last, not what was staged. The copy lives under config/, which storage retains as essential and the solver refuses to write into, and active.json records it so every later stage of the run - continuation, post-processing - launches the same build. Each copy is written beside its destination and renamed into place.
| [in] | run_dir | Run directory. |
| [in] | revision | Active configuration revision (initial or a continuation id). |
Definition at line 1144 of file core.py.
| dict picurv_cli.core.plan_run_executable_paths | ( | str | run_dir, |
| args, | |||
| "str | None" | workspace_root | ||
| ) |
Predict, without writing, which executables staging would give a run.
Mirrors apply_run_executable_pinning() for run --dry-run: an existing pin is kept unless re-pinned, a new pin lands in the configuration revision staging would create, and otherwise the installation's executables run.
| [in] | run_dir | Run directory the plan targets. |
| [in] | args | Parsed command arguments. |
| [in] | workspace_root | Owning workspace, or None. |
pinning (kept, new, or none) and per-executable paths. Definition at line 1194 of file core.py.
| bool picurv_cli.core.resolve_executable_pinning | ( | args, | |
| "str | None" | workspace_root | ||
| ) |
Decide whether staging pins the installation's executables into the run.
Pinning is opt-in: an explicit --pin-executables/--no-pin-executables wins, then the workspace's reproducibility.pin_executables. Unpinned jobs are still protected by the job-start identity check, which stops a job whose executable was rebuilt after staging instead of running the new build.
| [in] | args | Parsed command arguments. |
| [in] | workspace_root | Owning workspace, or None. |
Definition at line 1218 of file core.py.
| dict picurv_cli.core.apply_run_executable_pinning | ( | str | run_dir, |
| str | revision, | ||
| args, | |||
| "str | None" | workspace_root | ||
| ) |
Pin, keep, or refuse the run's executables before anything records them.
A run already pinned keeps its build unless the caller explicitly re-pins, so a continuation or post-processing pass cannot silently switch builds. Refusing --no-pin-executables on a pinned run keeps the run's records describing one build rather than a pin nobody launched.
| [in] | run_dir | Run directory. |
| [in] | revision | Active configuration revision. |
| [in] | args | Parsed command arguments. |
| [in] | workspace_root | Owning workspace, or None. |
| ValueError | when --no-pin-executables is given for a pinned run. |
Definition at line 1239 of file core.py.
| dict picurv_cli.core.archive_active_generated_configuration | ( | str | run_dir, |
| list | paths | ||
| ) |
Preserve generated control sidecars beside a continuation's YAML revision.
| [in] | run_dir | Owning run. |
| [in] | paths | Generated control and sidecar paths. |
Definition at line 1279 of file core.py.
|
protected |
Report each run component's home, retention class, and lifecycle state.
The skeleton is created whole, so an empty directory says nothing about whether its contents were requested. This is where that question is answered, and it is answered for every component whether or not it ran.
| [in] | run_dir | Run directory being described. |
| [in] | stages_requested | Mapping of requested stage names to booleans. |
{path, retention, state} mapping. Definition at line 1333 of file core.py.
| dict picurv_cli.core.build_run_lineage | ( | str | parent_run_dir, |
| int | checkpoint_step, | ||
| * | workspace_root = None, |
||
statistics_state = None, |
|||
requested_source = None |
|||
| ) |
Record which run and which checkpoint a branched run was started from.
Without this a branch is indistinguishable from a fresh run: the copied bundle under inputs/restart/ carries the parent's geometry and software identity but never says which run produced it, so the trajectory a result belongs to cannot be reconstructed after the fact.
The parent's own manifest is asked for its identity rather than its directory name, so a parent that was renamed or restored under another name is still named correctly here.
| [in] | parent_run_dir | Absolute path to the run being branched from. |
| [in] | checkpoint_step | Checkpoint step the branch starts from. |
| [in] | workspace_root | Optional workspace root, to record a portable path. |
| [in] | statistics_state | Resolved field-statistics decision for the branch. |
| [in] | requested_source | What the user asked for, e.g. "latest" or a path. |
Definition at line 1377 of file core.py.
| dict picurv_cli.core.build_run_manifest | ( | str | run_dir, |
| str | run_id, | ||
| * | workspace_root = None, |
||
| str | launch_mode = "local", |
||
| int | num_procs = 1, |
||
| int | post_num_procs = 1, |
||
stages_requested = None, |
|||
stages_completed = None, |
|||
inputs = None, |
|||
asset_lock = None, |
|||
submission = None, |
|||
lineage = None, |
|||
| str | artifact_type = "run", |
||
study_id = None, |
|||
case_id = None |
|||
| ) |
Build the authoritative run identity, topology, and lifecycle manifest.
| [in] | run_dir | Owning run directory. |
| [in] | run_id | Stable run identity. |
| [in] | workspace_root | Optional initialized workspace root. |
| [in] | launch_mode | Local or scheduler-backed launch mode. |
| [in] | num_procs | Effective solver process count. |
| [in] | post_num_procs | Effective post-process count. |
| [in] | stages_requested | Requested stage mapping. |
| [in] | stages_completed | Completed or submitted stage names. |
| [in] | inputs | Active configuration identities. |
| [in] | asset_lock | Resolved run asset lock. |
| [in] | submission | Scheduler submission metadata. |
| [in] | lineage | Where this run's initial state came from; see build_run_lineage(). |
| [in] | artifact_type | "run" for a standalone run, "study-case" for a study member. |
| [in] | study_id | Owning study identity, for a study member. |
| [in] | case_id | Member identity within its study. |
Definition at line 1412 of file core.py.
|
protected |
Return the location a run's generated files refer to.
Runs staged before the manifest recorded root_path are read from the active control file, whose generated input paths all start at the run root.
| [in] | run_dir | Current run directory. |
Definition at line 1494 of file core.py.
| int picurv_cli.core.adopt_relocated_artifact | ( | str | root, |
| str | kind = "run", |
||
| bool | dry_run = False |
||
| ) |
Point a moved run's or study's generated files at where it now lives.
Generated control files, recipes, scheduler scripts, and case indexes hold absolute paths, so a run or study moved or copied to another directory would otherwise launch against its old location. The rewrite is the one a relocated storage restore applies, after which the recorded root is updated.
| [in] | root | Current run or study directory. |
| [in] | kind | "run" or "study". |
| [in] | dry_run | Report the relocation without rewriting anything. |
Definition at line 1523 of file core.py.
|
protected |
Resolve a run/output root or an exact checkpoint bundle.
| [in] | source_dir | Run/output root or exact bundle path. |
| [in] | step | Checkpoint step to resolve. |
Definition at line 1561 of file core.py.
|
protected |
Parse the deliberately small PETSc-options checkpoint manifest.
| [in] | metadata_path | Path to checkpoint.meta. |
Definition at line 1574 of file core.py.
| dict picurv_cli.core.validate_committed_checkpoint | ( | str | source_dir, |
| int | step, | ||
| bool | require_particles = False |
||
| ) |
Validate one committed bundle using the same manifest contract as C.
| [in] | source_dir | Run/output root or exact bundle path. |
| [in] | step | Expected checkpoint step. |
| [in] | require_particles | Whether particle restart payloads are required. |
Definition at line 1605 of file core.py.
|
protected |
Return only fully validated, committed checkpoint steps.
| [in] | source_dir | Run/output root containing checkpoints. |
| [in] | require_particles | Whether particle restart payloads are required. |
Definition at line 1701 of file core.py.
| int picurv_cli.core.parse_slurm_time_limit_to_seconds | ( | str | time_text | ) |
Parse a Slurm time-limit string into total seconds.
| [in] | time_text | Argument passed to parse_slurm_time_limit_to_seconds(). |
parse_slurm_time_limit_to_seconds(). Definition at line 1728 of file core.py.
| "dict | None" picurv_cli.core.resolve_walltime_guard_policy | ( | "dict | None" | cluster_cfg | ) |
Resolve the effective Slurm walltime-guard policy for generated solver jobs.
| [in] | cluster_cfg | Argument passed to resolve_walltime_guard_policy(). |
resolve_walltime_guard_policy(). Definition at line 1785 of file core.py.
| dict picurv_cli.core.build_walltime_guard_exports | ( | "dict | None" | cluster_cfg | ) |
Build shell-evaluated environment exports for the runtime walltime guard.
| [in] | cluster_cfg | Argument passed to build_walltime_guard_exports(). |
build_walltime_guard_exports(). Definition at line 1815 of file core.py.
| str picurv_cli.core.resolve_runtime_executable | ( | str | executable_name | ) |
Resolve solver/post executable path, preferring local sibling binaries.
A command that selected the 64-bit-index build resolves simulator64 and postprocessor64, which make INDEX_BITS=64 installs beside the 32-bit pair.
| [in] | executable_name | simulator or postprocessor. |
Definition at line 1835 of file core.py.
|
protected |
Parse the PETSc build line a native executable reports.
| [in] | line | petsc <version> <debug|optimized> [int32|int64] <arch> <dir>. |
indices_stamped records whether the line named it, so the line can be rebuilt exactly. Definition at line 1868 of file core.py.
| "dict | None" picurv_cli.core.read_binary_petsc_stamp | ( | str | executable_path | ) |
Read the PETSc build stamp from an executable's bytes, without running it.
A binary built against one PETSc and started against another cannot run --version at all, which is exactly when knowing its PETSc matters.
| [in] | executable_path | Path to simulator or postprocessor. |
Definition at line 1885 of file core.py.
| "str | None" picurv_cli.core.resolved_petsc_library | ( | str | executable_path | ) |
The PETSc shared library the dynamic loader would give this executable when picurv launches it.
Uses ldd on the current shell's library path with the executable's own PETSc lib/ first, as launches and job scripts put it; returns None where ldd is unavailable or the executable links PETSc statically.
| [in] | executable_path | Path to simulator or postprocessor. |
not found, or None. Definition at line 1906 of file core.py.
| bool picurv_cli.core.petsc_library_mismatch | ( | "dict | None" | petsc, |
| "str | None" | library | ||
| ) |
Whether the library the loader resolves lies outside the PETSc the binary was built against.
| [in] | petsc | Stamp from read_binary_petsc_stamp() or the --version line. |
| [in] | library | Path from resolved_petsc_library(). |
Definition at line 1938 of file core.py.
|
protected |
Read the build identity stamped into an executable's bytes, without running it.
src/setup.c stores PICURV_BUILD:<version> <commit> <dirty> beside the PETSc stamp. Running --version on a login node starts the dynamic loader against a cold filesystem, tens of seconds; reading the file costs one read.
| [in] | executable_path | Path to simulator or postprocessor. |
read_binary_build_identity() returns, or None for a binary built before the stamp existed. Definition at line 1953 of file core.py.
| dict picurv_cli.core.read_binary_build_identity | ( | str | executable_path | ) |
Read the build identity a native executable was compiled with.
The Makefile stamps the release, commit, and dirty state into the binaries, and they are written into every checkpoint manifest. Reading it back is what makes the run manifest's provenance a statement about the binary that ran rather than about whatever source happens to be checked out when the conductor is invoked.
| [in] | executable_path | Path to simulator or postprocessor. |
available: False mapping when it cannot be read. Definition at line 1998 of file core.py.
| dict picurv_cli.core.runtime_build_identities | ( | "dict | None" | source_identity = None, |
| "str | None" | run_dir = None |
||
| ) |
Read the build identity of every native executable a run would launch.
| [in] | source_identity | Source identity to compare against; defaults to the identity this process computed at startup. |
| [in] | run_dir | Run whose pinned executables are read; the installation's when None, which also lists the 64-bit-index pair (simulator64, postprocessor64) when it is built. |
matches_source. Definition at line 2053 of file core.py.
| str picurv_cli.core.rebuild_command | ( | str | name, |
| dict | identity | ||
| ) |
The command that rebuilds one native executable.
The 64-bit-index pair needs INDEX_BITS=64 and its own PETSc, named from the executable's PETSc stamp when it has one; a plain build makes the 32-bit pair.
| [in] | name | Executable name, such as simulator64. |
| [in] | identity | Identity mapping from read_binary_build_identity(). |
Definition at line 2086 of file core.py.
| list picurv_cli.core.build_identity_problems | ( | dict | identities, |
workspace_requirement = None, |
|||
| "dict | None" | source_identity = None |
||
| ) |
Report every reason the active build identity is not internally coherent.
The conductor, the simulator, and the postprocessor are three artifacts that must agree before a run's provenance means anything. This states the disagreements rather than printing them, so version status can exit on them while ordinary staging only warns.
| [in] | identities | Mapping returned by runtime_build_identities(). |
| [in] | workspace_requirement | Optional software.picurv constraint to check. |
| [in] | source_identity | Source identity the executables must match; defaults to the identity this process computed at startup. |
Definition at line 2102 of file core.py.
| list picurv_cli.core.warn_on_stale_runtime_binaries | ( | dict | identities | ) |
Report native executables whose build identity is not the active source.
An executable whose identity cannot be read is reported too: the manifest would otherwise record "unavailable" for a run with no word at staging.
| [in] | identities | Mapping returned by runtime_build_identities(). |
Definition at line 2152 of file core.py.
|
protected |
Normalize error fields into a single-line string.
| [in] | value | Argument passed to _sanitize_error_field(). |
_sanitize_error_field(). Definition at line 2218 of file core.py.
| picurv_cli.core.emit_structured_error | ( | str | code, |
| str | key = "-", |
||
| str | file_path = "-", |
||
| str | message = "", |
||
| str | hint = None, |
||
stream = None |
|||
| ) |
Emit one standardized error line for tooling and users.
| [in] | code | Argument passed to emit_structured_error(). |
| [in] | key | Argument passed to emit_structured_error(). |
| [in] | file_path | Argument passed to emit_structured_error(). |
| [in] | message | Argument passed to emit_structured_error(). |
| [in] | hint | Argument passed to emit_structured_error(). |
| [in] | stream | Argument passed to emit_structured_error(). |
Definition at line 2232 of file core.py.
| picurv_cli.core.fail_cli_usage | ( | str | message, |
| str | hint = None |
||
| ) |
Emit a structured CLI usage error and exit with code 2.
Without a hint, the default names the command the user ran.
| [in] | message | Argument passed to fail_cli_usage(). |
| [in] | hint | Argument passed to fail_cli_usage(). |
Definition at line 2256 of file core.py.
|
protected |
Separate a validation error into its source-file and message fields when possible.
| [in] | raw_error | Validation error text, optionally beginning with a file path and colon. |
-) and the message text. Definition at line 2275 of file core.py.
|
protected |
Best-effort key-path extraction from free-form validation messages.
| [in] | message | Argument passed to _extract_key_path(). |
_extract_key_path(). Definition at line 2293 of file core.py.
|
protected |
Map existing validation/error messages to the standardized code set.
| [in] | message | Argument passed to _classify_error_code(). |
_classify_error_code(). Definition at line 2314 of file core.py.
| dict picurv_cli.core.read_yaml_file | ( | str | filepath | ) |
Safely reads a YAML file and returns its content.
| [in] | filepath | Path to the YAML file. |
| SystemExit | if the file is not found or cannot be parsed. |
Definition at line 2353 of file core.py.
| picurv_cli.core.write_yaml_file | ( | str | filepath, |
| dict | data | ||
| ) |
Write YAML with stable ordering for generated study artifacts.
| [in] | filepath | Argument passed to write_yaml_file(). |
| [in] | data | Argument passed to write_yaml_file(). |
Definition at line 2381 of file core.py.
| picurv_cli.core.write_json_file | ( | str | filepath, |
| dict | payload | ||
| ) |
Write JSON metadata/manifests with a stable, readable format.
| [in] | filepath | Argument passed to write_json_file(). |
| [in] | payload | Argument passed to write_json_file(). |
Definition at line 2396 of file core.py.
| str picurv_cli.core.write_runtime_execution_file | ( | str | filepath, |
| str | template_source_path = None |
||
| ) |
Write a default runtime execution config, copying a source template when available.
| [in] | filepath | Argument passed to write_runtime_execution_file(). |
| [in] | template_source_path | Argument passed to write_runtime_execution_file(). |
write_runtime_execution_file(). Definition at line 2413 of file core.py.
|
protected |
Return True when a launcher arg token contains embedded whitespace and should be split.
| [in] | token | Argument passed to _launcher_arg_contains_whitespace(). |
_launcher_arg_contains_whitespace(). Definition at line 2431 of file core.py.
| "str | None" picurv_cli.core.resolve_runtime_execution_seed_source | ( | str | source_project_root | ) |
Prefer repo-local ignored runtime config, then tracked example, then built-in defaults.
| [in] | source_project_root | Argument passed to resolve_runtime_execution_seed_source(). |
resolve_runtime_execution_seed_source(). Definition at line 2440 of file core.py.
| dict picurv_cli.core.ensure_case_runtime_execution_config | ( | str | case_dir, |
| str | source_project_root, | ||
| bool | overwrite = False |
||
| ) |
Create case-local runtime execution config if missing, seeded from repo-local config when available.
| [in] | case_dir | Argument passed to ensure_case_runtime_execution_config(). |
| [in] | source_project_root | Argument passed to ensure_case_runtime_execution_config(). |
| [in] | overwrite | Argument passed to ensure_case_runtime_execution_config(). |
ensure_case_runtime_execution_config(). Definition at line 2462 of file core.py.
| bool picurv_cli.core.is_project_root | ( | str | candidate | ) |
Return True when a directory looks like the PICurv source repository root.
| [in] | candidate | Argument passed to is_project_root(). |
is_project_root(). Definition at line 2488 of file core.py.
|
protected |
Yield a path and all of its parents up to filesystem root.
| [in] | start_path | Argument passed to _iter_parent_dirs(). |
Definition at line 2505 of file core.py.
| picurv_cli.core.find_project_root_upwards | ( | str | start_path | ) |
Search upward from an anchor and return the first matching project root.
| [in] | start_path | Argument passed to find_project_root_upwards(). |
find_project_root_upwards(). Definition at line 2521 of file core.py.
| picurv_cli.core.discover_local_project_root | ( | * | extra_anchors | ) |
Best-effort source repo discovery from runtime anchors.
| [in] | extra_anchors | Argument passed to discover_local_project_root(). |
discover_local_project_root(). Definition at line 2535 of file core.py.
| picurv_cli.core.find_case_origin_metadata_file | ( | str | case_dir_hint = None | ) |
Find the nearest case-origin metadata file from known runtime anchors.
An explicit case directory is the only anchor searched, so a wrong one cannot fall back to the case in the working directory.
| [in] | case_dir_hint | Argument passed to find_case_origin_metadata_file(). |
find_case_origin_metadata_file(). | ValueError | when case_dir_hint is given but is not a directory. |
Definition at line 2556 of file core.py.
| picurv_cli.core.load_case_origin_metadata | ( | str | case_dir_hint = None | ) |
Load case-origin metadata if present, returning (case_dir, metadata_path, payload).
| [in] | case_dir_hint | Argument passed to load_case_origin_metadata(). |
load_case_origin_metadata(). Definition at line 2583 of file core.py.
| picurv_cli.core.find_runtime_execution_config_file | ( | * | anchors | ) |
Find the nearest optional execution config from runtime/case anchors.
| [in] | anchors | Argument passed to find_runtime_execution_config_file(). |
find_runtime_execution_config_file(). Definition at line 2602 of file core.py.
|
protected |
Validate one execution override section while preserving missing-vs-empty semantics.
| [in] | payload | Argument passed to _normalize_execution_override_section(). |
| [in] | section_name | Argument passed to _normalize_execution_override_section(). |
| [in] | config_path | Argument passed to _normalize_execution_override_section(). |
| [in] | config_label | Argument passed to _normalize_execution_override_section(). |
_normalize_execution_override_section(). Definition at line 2634 of file core.py.
| picurv_cli.core.load_runtime_execution_config | ( | str | config_search_anchor = None, |
extra_search_anchors = None |
|||
| ) |
Load optional shared execution launcher config from the nearest runtime config file.
| [in] | config_search_anchor | Argument passed to load_runtime_execution_config(). |
| [in] | extra_search_anchors | Argument passed to load_runtime_execution_config(). |
load_runtime_execution_config(). Definition at line 2679 of file core.py.
| dict picurv_cli.core.merge_execution_overrides | ( | "dict | None" | base, |
| "dict | None" | override | ||
| ) |
Merge execution overrides, letting explicit override values win key-by-key.
| [in] | base | Argument passed to merge_execution_overrides(). |
| [in] | override | Argument passed to merge_execution_overrides(). |
merge_execution_overrides(). Definition at line 2727 of file core.py.
| dict picurv_cli.core.resolve_runtime_execution_context | ( | dict | runtime_execution_cfg, |
| str | context | ||
| ) |
Resolve default plus context-specific execution overrides.
| [in] | runtime_execution_cfg | Argument passed to resolve_runtime_execution_context(). |
| [in] | context | Argument passed to resolve_runtime_execution_context(). |
resolve_runtime_execution_context(). Definition at line 2751 of file core.py.
| str picurv_cli.core.get_git_commit | ( | str | repo_root = None | ) |
Best-effort git commit lookup for run/study manifests and case metadata.
| [in] | repo_root | Argument passed to get_git_commit(). |
get_git_commit(). Definition at line 2766 of file core.py.
| picurv_cli.core.write_case_origin_metadata | ( | str | case_dir, |
| str | source_project_root, | ||
| str | template_name = None, |
||
| dict | existing = None, |
||
template_managed_files = None |
|||
| ) |
Create or refresh case-origin metadata for repo-aware case maintenance commands.
| [in] | case_dir | Argument passed to write_case_origin_metadata(). |
| [in] | source_project_root | Argument passed to write_case_origin_metadata(). |
| [in] | template_name | Argument passed to write_case_origin_metadata(). |
| [in] | existing | Argument passed to write_case_origin_metadata(). |
| [in] | template_managed_files | Argument passed to write_case_origin_metadata(). |
write_case_origin_metadata(). Definition at line 2788 of file core.py.
| bool picurv_cli.core.make_args_include_explicit_goal | ( | "list[str]" | make_args | ) |
Return True when make args contain an explicit target rather than only options/assignments.
| [in] | make_args | Argument passed to make_args_include_explicit_goal(). |
make_args_include_explicit_goal(). Definition at line 2817 of file core.py.
| picurv_cli.core.resolve_case_origin_context | ( | str | case_dir_hint = None, |
| str | source_root_override = None, |
||
| str | template_name_override = None |
||
| ) |
Resolve case directory, source repo root, and optional template metadata.
| [in] | case_dir_hint | Argument passed to resolve_case_origin_context(). |
| [in] | source_root_override | Argument passed to resolve_case_origin_context(). |
| [in] | template_name_override | Argument passed to resolve_case_origin_context(). |
resolve_case_origin_context(). Definition at line 2849 of file core.py.
| picurv_cli.core.require_project_root | ( | str | candidate, |
| str | purpose | ||
| ) |
Validate that a source repo root was resolved and is structurally valid.
| [in] | candidate | Argument passed to require_project_root(). |
| [in] | purpose | Argument passed to require_project_root(). |
require_project_root(). Definition at line 2885 of file core.py.
| picurv_cli.core.require_existing_case_dir | ( | str | case_dir, |
| str | purpose, | ||
| str | source_project_root = None |
||
| ) |
Validate that a target case directory exists and is not the source repo root.
| [in] | case_dir | Argument passed to require_existing_case_dir(). |
| [in] | purpose | Argument passed to require_existing_case_dir(). |
| [in] | source_project_root | Argument passed to require_existing_case_dir(). |
require_existing_case_dir(). Definition at line 2905 of file core.py.
| picurv_cli.core.resolve_template_directory | ( | str | source_project_root, |
| str | template_name | ||
| ) |
Resolve an example template directory inside the source repository.
| [in] | source_project_root | Argument passed to resolve_template_directory(). |
| [in] | template_name | Argument passed to resolve_template_directory(). |
resolve_template_directory(). Definition at line 2925 of file core.py.
| picurv_cli.core.list_template_relative_files | ( | str | template_dir, |
excluded_rel_paths = None |
|||
| ) |
List all files in a template directory as case-relative paths.
| [in] | template_dir | Argument passed to list_template_relative_files(). |
| [in] | excluded_rel_paths | Argument passed to list_template_relative_files(). |
list_template_relative_files(). Definition at line 2942 of file core.py.
| dict picurv_cli.core.render_template_workspace | ( | str | template_dir, |
| str | template_name, | ||
| str | destination | ||
| ) |
Render an example template into the canonical workspace layout at a new path.
This is the one transformation init applies to a template: copy it, drop the execution example, then relocate and rewrite its files through organize_initialized_workspace(). sync-config and status-source render the current template the same way, so all three agree on where each file lives and what it contains.
| [in] | template_dir | Example template directory to render. |
| [in] | template_name | Example template identity. |
| [in] | destination | Path to render into; it must not exist. |
Definition at line 2964 of file core.py.
| list picurv_cli.core.list_rendered_template_files | ( | str | rendered_root | ) |
List the template-managed files of a rendered workspace, workspace-relative.
The workspace identity file is excluded: it records when and where the workspace was created, which is the workspace's own state, not the template's.
| [in] | rendered_root | Root produced by render_template_workspace(). |
Definition at line 2984 of file core.py.
| picurv_cli.core.list_source_binaries | ( | str | source_project_root | ) |
List binary artifacts currently available in the source repo bin directory.
| [in] | source_project_root | Argument passed to list_source_binaries(). |
list_source_binaries(). Definition at line 2998 of file core.py.
| picurv_cli.core.sync_case_binaries | ( | str | case_dir, |
| str | source_project_root | ||
| ) |
Copy current source-repo binaries into a case directory for version-pinning.
| [in] | case_dir | Argument passed to sync_case_binaries(). |
| [in] | source_project_root | Argument passed to sync_case_binaries(). |
sync_case_binaries(). Definition at line 3016 of file core.py.
| picurv_cli.core.sync_case_template_files | ( | str | case_dir, |
| str | template_dir, | ||
| bool | overwrite = False, |
||
| bool | prune = False, |
||
managed_rel_paths = None, |
|||
| str | template_name = None |
||
| ) |
Sync template files into a case directory, preserving modified files unless overwrite is requested.
| [in] | case_dir | Argument passed to sync_case_template_files(). |
| [in] | template_dir | Argument passed to sync_case_template_files(). |
| [in] | overwrite | Argument passed to sync_case_template_files(). |
| [in] | prune | Argument passed to sync_case_template_files(). |
| [in] | managed_rel_paths | Argument passed to sync_case_template_files(). |
| [in] | template_name | Template identity; defaults to the template directory name. |
sync_case_template_files().Files are compared with a fresh rendering of the template in the workspace layout init creates, so a case file is matched with the template file it was made from, under its workspace name and rewritten contents.
Definition at line 3035 of file core.py.
| picurv_cli.core.compute_case_source_status | ( | str | case_dir, |
| str | source_project_root, | ||
| str | template_name = None, |
||
| dict | metadata = None |
||
| ) |
Compute source/case drift across commits, binaries, and template-managed files.
| [in] | case_dir | Argument passed to compute_case_source_status(). |
| [in] | source_project_root | Argument passed to compute_case_source_status(). |
| [in] | template_name | Argument passed to compute_case_source_status(). |
| [in] | metadata | Argument passed to compute_case_source_status(). |
compute_case_source_status(). Definition at line 3103 of file core.py.
| picurv_cli.core.print_case_source_status | ( | dict | status | ) |
Render human-readable source/case drift details.
| [in] | status | Argument passed to print_case_source_status(). |
Definition at line 3203 of file core.py.
| picurv_cli.core.status_source_command | ( | args | ) |
Report source/case drift for an initialized case directory.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 3249 of file core.py.
| str picurv_cli.core.resolve_path | ( | str | anchor_file, |
| str | candidate | ||
| ) |
Resolve a potentially relative path against a source YAML file path.
| [in] | anchor_file | Argument passed to resolve_path(). |
| [in] | candidate | Argument passed to resolve_path(). |
resolve_path(). Definition at line 3277 of file core.py.
|
protected |
Return the first defined value from a mapping across alias keys.
| [in] | mapping | Argument passed to _mapping_value_with_aliases(). |
| [in] | default | Argument passed to _mapping_value_with_aliases(). |
| [in] | keys | Argument passed to _mapping_value_with_aliases(). |
_mapping_value_with_aliases(). Definition at line 3309 of file core.py.
| picurv_cli.core.get_post_run_control_value | ( | dict | post_cfg, |
| str | canonical_key, | ||
default = None |
|||
| ) |
Resolve post run_control values with backwards-compatible legacy aliases.
| [in] | post_cfg | Argument passed to get_post_run_control_value(). |
| [in] | canonical_key | Argument passed to get_post_run_control_value(). |
| [in] | default | Argument passed to get_post_run_control_value(). |
get_post_run_control_value(). Definition at line 3325 of file core.py.
| None picurv_cli.core.warn_on_grid_generator_hyphen_keys | ( | dict | generator, |
| str | case_path, | ||
| list | warnings | ||
| ) |
Warn when grid.generator uses unsupported hyphenated wrapper keys.
| [in] | generator | grid.generator mapping from case.yml. |
| [in] | case_path | Case file path for diagnostics. |
| [in,out] | warnings | Warning list to append to. |
Definition at line 3338 of file core.py.
| str picurv_cli.core.retired_destination_message | ( | str | label, |
| str | key | ||
| ) |
Explain why a generator may not choose its own output destination.
| [in] | label | Dotted configuration path of the mapping carrying the key. |
| [in] | key | The refused destination key. |
Definition at line 3359 of file core.py.
| list picurv_cli.core.reject_generator_destination_keys | ( | generator, | |
| str | case_path, | ||
| str | label | ||
| ) |
Reject generator settings that try to choose their own output destination.
| [in] | generator | Generator mapping from the case configuration. |
| [in] | case_path | Case file path for diagnostics. |
| [in] | label | Dotted configuration path being checked, for the message. |
Definition at line 3372 of file core.py.
| picurv_cli.core.get_post_source_data | ( | dict | post_cfg | ) |
Return source_data as a mapping when valid, else an empty mapping.
| [in] | post_cfg | Argument passed to get_post_source_data(). |
get_post_source_data(). Definition at line 3388 of file core.py.
| str picurv_cli.core.get_post_source_directory_template | ( | dict | post_cfg, |
| str | default = "<solver_output_dir>" |
||
| ) |
Resolve the source directory template from source_data with a safe default.
| [in] | post_cfg | Argument passed to get_post_source_directory_template(). |
| [in] | default | Argument passed to get_post_source_directory_template(). |
get_post_source_directory_template(). Definition at line 3400 of file core.py.
| picurv_cli.core.get_post_input_extensions | ( | dict | post_cfg | ) |
Return post input_extensions, preferring io.
| [in] | post_cfg | Argument passed to get_post_input_extensions(). |
get_post_input_extensions(). Definition at line 3410 of file core.py.
| picurv_cli.core.get_post_statistics_task_tokens | ( | dict | post_cfg | ) |
Return normalized statistics pipeline tokens that will be written into post.run.
| [in] | post_cfg | Argument passed to get_post_statistics_task_tokens(). |
get_post_statistics_task_tokens(). Definition at line 3428 of file core.py.
| str picurv_cli.core.get_monitor_output_directory | ( | dict | monitor_cfg, |
| str | default = "output" |
||
| ) |
Resolve the solver output root from monitor.yml, preserving the default layout.
| [in] | monitor_cfg | Argument passed to get_monitor_output_directory(). |
| [in] | default | Argument passed to get_monitor_output_directory(). |
get_monitor_output_directory(). Definition at line 3456 of file core.py.
| str picurv_cli.core.get_post_statistics_output_prefix | ( | dict | post_cfg, |
| str | default = "Stats" |
||
| ) |
Resolve the statistics CSV prefix, preserving legacy top-level override support.
| [in] | post_cfg | Argument passed to get_post_statistics_output_prefix(). |
| [in] | default | Argument passed to get_post_statistics_output_prefix(). |
get_post_statistics_output_prefix(). Definition at line 3467 of file core.py.
| str picurv_cli.core.resolve_post_statistics_output_prefix | ( | dict | post_cfg, |
monitor_cfg = None, |
|||
| str | default = "Stats" |
||
| ) |
Resolve the runtime statistics prefix, routing bare basenames under the monitor output root.
| [in] | post_cfg | Argument passed to resolve_post_statistics_output_prefix(). |
| [in] | monitor_cfg | Optional monitor configuration used to anchor the default statistics home. |
| [in] | default | Argument passed to resolve_post_statistics_output_prefix(). |
resolve_post_statistics_output_prefix(). Definition at line 3487 of file core.py.
| picurv_cli.core.get_post_statistics_output_artifacts | ( | dict | post_cfg, |
| str | run_dir, | ||
monitor_cfg = None |
|||
| ) |
Predict statistics CSV output paths relative to the postprocessor runtime cwd.
| [in] | post_cfg | Argument passed to get_post_statistics_output_artifacts(). |
| [in] | run_dir | Argument passed to get_post_statistics_output_artifacts(). |
| [in] | monitor_cfg | Optional monitor configuration used to anchor the default statistics home. |
get_post_statistics_output_artifacts(). Definition at line 3506 of file core.py.
| dict picurv_cli.core.resolve_scalar_transport | ( | dict | case_cfg, |
| dict | solver_cfg, | ||
| bool | warn = False |
||
| ) |
Resolve the scalar-transport parameters from case.yml or their deprecated location.
Each parameter is read from its case.yml location (SCALAR_TRANSPORT_CASE_PATHS) or, as a deprecated alias, from solver.yml scalar_transport. Setting one in both places is refused rather than resolved by precedence.
| [in] | case_cfg | Parsed case configuration. |
| [in] | solver_cfg | Parsed solver configuration. |
| [in] | warn | Print a deprecation warning for each parameter read from solver.yml. |
| ValueError | for a malformed, duplicated, or out-of-range parameter. |
Definition at line 3662 of file core.py.
| dict picurv_cli.core.normalize_post_spectra_config | ( | dict | post_cfg | ) |
Validate and canonicalize the spectra block of post.yml.
The recipe chooses what to measure; whether the case can support that measurement is a separate question answered by validate_post_spectra_preconditions(), which needs the grid and the boundary conditions. Keeping the two apart means a recipe stays valid on its own terms even when it is read without a case beside it.
| [in] | post_cfg | Parsed post-processing configuration. |
| ValueError | on a malformed or inconsistent recipe. |
Definition at line 3770 of file core.py.
| list picurv_cli.core.validate_post_spectra_preconditions | ( | dict | spectra_cfg, |
| dict | case_cfg, | ||
| str | post_path | ||
| ) |
Check spectra tasks against what the case can actually support.
Runs before any field is read, so a case with no homogeneous direction is refused rather than yielding a curve that means nothing. Only the checks the case file can answer are made here: periodicity and block count. Grid uniformity is enforced by generators/spectra.gen, which reads the staged PICGRID and is the only place the real node coordinates are known.
| [in] | spectra_cfg | Normalized spectra recipe. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | post_path | Post recipe path, for error messages. |
Definition at line 3903 of file core.py.
|
protected |
Locate one checkpoint payload by its inventory entry rather than by path shape.
| [in] | bundle | Validated checkpoint bundle mapping. |
| [in] | kind | Payload kind recorded in the inventory. |
| [in] | field | Payload field name recorded in the inventory. |
| [in] | block | Block index the payload belongs to. |
| ValueError | when the bundle carries no such payload. |
Definition at line 3982 of file core.py.
|
protected |
Build the generator arguments implementing a task's fluctuation choice.
| [in] | task_cfg | Normalized spectra task. |
| [in] | bundle | Validated checkpoint bundle for the step being transformed. |
| [in] | mean_bundle | Bundle supplying the window mean; defaults to bundle. |
| ValueError | when a named window is absent from the bundle. |
Definition at line 4002 of file core.py.
| set picurv_cli.core.resolve_post_stage_selection | ( | only | ) |
Resolve the --only selector into the set of post stages to execute.
| [in] | only | Comma-separated selector text, or None for every stage. |
| ValueError | when the selector names an unknown or empty stage. |
Definition at line 4034 of file core.py.
| dict picurv_cli.core.run_post_spectra_stage | ( | str | run_dir, |
| dict | post_cfg, | ||
| dict | monitor_cfg, | ||
| str | source_dir, | ||
| steps, | |||
| bool | quiet = False, |
||
| "dict | None" | plan = None, |
||
| bool | recompute = False |
||
| ) |
Measure spectra for every requested task across a window of committed steps.
One spectrum per step per task, because a spectrum is a property of one state: averaging across steps would be wrong for a decaying flow, where every step is a different statistical state. Results are written in long form so a family of curves stays one file, alongside a scalar history that plots through the ordinary series machinery.
| [in] | run_dir | Run directory receiving the output. |
| [in] | post_cfg | Parsed post-processing configuration. |
| [in] | monitor_cfg | Parsed monitor configuration anchoring the output root. |
| [in] | source_dir | Directory holding the committed checkpoints. |
| [in] | steps | Iterable of checkpoint steps to process, in order. |
| [in] | quiet | Suppress progress reporting. |
| [in] | plan | Post plan whose recipe state records each measured step; with it, a step whose rows are still valid (classify_post_step()) is not measured again. None measures every committed step given. |
| [in] | recompute | Measure every committed step even when its rows are valid. |
| ValueError | when the generator fails or a requested payload is absent. |
Definition at line 4055 of file core.py.
| dict picurv_cli.core.normalize_post_reducers_config | ( | dict | post_cfg | ) |
Validate and canonicalize the reducers block of post.yml.
A reducer reads the profiles field_statistics writes, so each task names a window or ensemble of the same recipe, and the recipe's homogeneous must leave the directions the task needs.
| [in] | post_cfg | Parsed post-processing configuration. |
Definition at line 4263 of file core.py.
| list picurv_cli.core.run_post_reducers_stage | ( | str | run_dir, |
| dict | post_cfg, | ||
| bool | quiet = False |
||
| ) |
Run every reducer task over the profiles the recipe has written.
Reducers read only small CSVs, so every profile present is reduced again on each invocation rather than tracked step by step. Inputs come from the run: the viscosity and reference scales from its case snapshot, the grid it was staged with, a window's effective bounds from each step's checkpoint.meta, and the runtime metrics CSVs.
| [in] | run_dir | Run directory. |
| [in] | post_cfg | Post recipe with canonical paths applied. |
| [in] | quiet | Suppress progress reporting. |
| ValueError | when a reducer fails. |
Definition at line 4335 of file core.py.
|
protected |
Combine newly measured spectra rows with those already written for other steps.
The file belongs to one recipe, whose identity covers the spectra settings, so its existing rows come from the same measurement. Rows for a re-measured step are replaced; rows for every other step are kept. A file whose columns differ is not merged: it was written by another format and is rewritten whole.
| [in] | path | Existing CSV path, which may be absent. |
| [in] | fieldnames | Columns the new rows carry. |
| [in] | remeasured | Steps measured in this invocation. |
| [in] | new_rows | Rows measured in this invocation. |
Definition at line 4443 of file core.py.
| str picurv_cli.core.compute_post_spectra_signature | ( | dict | spectra_cfg | ) |
Reduce a normalized spectra recipe to a stable identity string.
| [in] | spectra_cfg | Normalized spectra recipe. |
Definition at line 4467 of file core.py.
| str picurv_cli.core.resolve_post_spectra_output_dir | ( | monitor_cfg = None | ) |
Resolve the run-relative directory spectra CSVs are written to.
| [in] | monitor_cfg | Optional monitor configuration anchoring the output root. |
Definition at line 4477 of file core.py.
| str picurv_cli.core.resolve_recipe_spectra_output_dir | ( | dict | post_cfg, |
monitor_cfg = None |
|||
| ) |
Resolve the canonical spectra directory for one versioned recipe.
| [in] | post_cfg | Parsed runtime post config. |
| [in] | monitor_cfg | Optional monitor config for standalone compatibility. |
Definition at line 4487 of file core.py.
| list picurv_cli.core.get_post_spectra_output_artifacts | ( | dict | post_cfg, |
| str | run_dir, | ||
monitor_cfg = None |
|||
| ) |
Predict the spectra CSV paths a recipe will write.
| [in] | post_cfg | Parsed post-processing configuration. |
| [in] | run_dir | Run directory the recipe operates on. |
| [in] | monitor_cfg | Optional monitor configuration anchoring the output root. |
Definition at line 4498 of file core.py.
| str picurv_cli.core.post_spectra_task_basename | ( | dict | task_cfg, |
| str | output_prefix | ||
| ) |
Build the file basename one normalized spectra task writes.
| [in] | task_cfg | Normalized task mapping. |
| [in] | output_prefix | Recipe output prefix. |
Definition at line 4521 of file core.py.
|
protected |
Validate and canonicalize the ensembles a post recipe defines.
An ensemble is a window over one instant: its samples are the particles in each cell, or each cell's own state, at the step being processed. It is defined in the recipe rather than the run, because it needs no state accumulated during the solve.
| [in] | raw | The recipe's field_statistics.ensembles list, or None. |
Definition at line 4535 of file core.py.
| dict picurv_cli.core.normalize_post_field_statistics_config | ( | dict | post_cfg | ) |
Validate and canonicalize the field_statistics block of post.yml.
The recipe names windows rather than redescribing them, because the window definitions already reach the post-processor through the run's solver control. Validation therefore covers the recipe's own choices only; a name no window matches is caught in C against the resolved list, which is the only place the real set is known.
| [in] | post_cfg | Parsed post-processing configuration. |
normalize_post_field_statistics_config(). Definition at line 4572 of file core.py.
|
protected |
Count the derived fields one window would produce for a set of outputs.
Mirrors the resolution the C derivation performs, so a recipe that would produce an empty file is refused before the run rather than after it. Each output resolves against what the window accumulated: a window keeping only first moments has no stresses, RMS, or turbulent kinetic energy to give.
| [in] | window_cfg | Normalized window definition from monitor.yml. |
| [in] | outputs | Requested output kinds. |
| [in] | eligible | Field table the window's fields are named from; the Eulerian table when None. |
_post_window_derived_field_count(). Definition at line 4668 of file core.py.
|
protected |
Return whether the current post recipe derives accumulated field statistics.
| [in] | post_cfg | Argument passed to _post_requests_field_statistics(). |
_post_requests_field_statistics(). Definition at line 4706 of file core.py.
| picurv_cli.core.get_post_field_statistics_artifacts | ( | dict | post_cfg, |
| str | run_dir | ||
| ) |
Predict the per-window statistics artifacts a recipe will produce.
Returns one entry per window and format, so resume tracking can tell a half-finished window from a completed one.
| [in] | post_cfg | Parsed post-processing configuration. |
| [in] | run_dir | Run directory the outputs are written under. |
_<step>.csv). window is None for a recipe ensemble, which every processed step produces. Definition at line 4720 of file core.py.
| dict picurv_cli.core.build_post_recipe_config | ( | dict | post_cfg, |
monitor_cfg = None |
|||
| ) |
Build the flat key=value mapping consumed by the C post-processor.
| [in] | post_cfg | Argument passed to build_post_recipe_config(). |
| [in] | monitor_cfg | Optional parsed monitor YAML configuration dictionary. |
build_post_recipe_config(). Definition at line 4759 of file core.py.
| str picurv_cli.core.compute_post_recipe_id | ( | dict | post_cfg | ) |
Compute a stable human-readable identity for one post recipe.
| [in] | post_cfg | Parsed post configuration before runtime path injection. |
Definition at line 4887 of file core.py.
| "tuple[dict, str]" picurv_cli.core.apply_canonical_post_paths | ( | dict | post_cfg, |
| str | run_dir | ||
| ) |
Route every post artifact into its fixed analysis or visualization home.
| [in] | post_cfg | Parsed user recipe. |
| [in] | run_dir | Run receiving derived artifacts. |
Definition at line 4926 of file core.py.
| dict picurv_cli.core.normalize_post_recipe_signature | ( | dict | recipe_cfg | ) |
Normalize post recipe settings into a stable signature mapping.
| [in] | recipe_cfg | Argument passed to normalize_post_recipe_signature(). |
normalize_post_recipe_signature(). Definition at line 4962 of file core.py.
| "tuple[dict, str]" picurv_cli.core.compute_post_recipe_fingerprint | ( | dict | recipe_cfg | ) |
Return normalized recipe signature plus SHA-256 fingerprint.
| [in] | recipe_cfg | Argument passed to compute_post_recipe_fingerprint(). |
compute_post_recipe_fingerprint(). Definition at line 4983 of file core.py.
| str picurv_cli.core.get_post_resume_state_path | ( | str | run_dir, |
| dict | post_cfg = None |
||
| ) |
Return the JSON resume metadata path for a run directory.
| [in] | run_dir | Argument passed to get_post_resume_state_path(). |
| [in] | post_cfg | Optional versioned post recipe configuration. |
get_post_resume_state_path(). Definition at line 4994 of file core.py.
| str picurv_cli.core.get_post_recipe_root | ( | str | run_dir, |
| dict | post_cfg | ||
| ) |
Return the versioned run-local control directory for one post recipe.
| [in] | run_dir | Owning run root. |
| [in] | post_cfg | Runtime post config with canonical paths, or a user recipe. |
Definition at line 5006 of file core.py.
| dict picurv_cli.core.get_post_lock_paths | ( | str | run_dir, |
| str | recipe_id = None |
||
| ) |
Return lock-wrapper related paths for a run directory.
| [in] | run_dir | Argument passed to get_post_lock_paths(). |
| [in] | recipe_id | Optional stable recipe identity used to scope the lock. |
get_post_lock_paths(). Definition at line 5018 of file core.py.
|
protected |
Resolve the absolute post output directory for the current recipe.
| [in] | run_dir | Argument passed to _post_output_directory_abs(). |
| [in] | post_cfg | Argument passed to _post_output_directory_abs(). |
_post_output_directory_abs(). Definition at line 5034 of file core.py.
|
protected |
Return whether the current post recipe expects Eulerian VTK output artifacts.
| [in] | post_cfg | Argument passed to _post_requests_eulerian_output(). |
_post_requests_eulerian_output(). Definition at line 5049 of file core.py.
|
protected |
Return whether the current post recipe expects particle VTP output artifacts.
| [in] | post_cfg | Argument passed to _post_requests_particle_output(). |
_post_requests_particle_output(). Definition at line 5059 of file core.py.
| dict picurv_cli.core.normalize_post_paraview_series_config | ( | dict | post_cfg | ) |
Normalize the optional ParaView collection policy in a post recipe.
| [in] | post_cfg | Parsed post-processing configuration. |
Definition at line 5072 of file core.py.
|
protected |
Resolve and identity-check one recorded lineage parent.
| [in] | child_run_dir | Child run directory used to resolve workspace-relative paths. |
| [in] | lineage | Recorded branch-lineage mapping. |
Definition at line 5094 of file core.py.
| list picurv_cli.core.resolve_run_lineage | ( | str | run_dir, |
| str | scope = "lineage" |
||
| ) |
Return root-to-leaf run segments, for a ParaView collection or a reducer's metrics.
| [in] | run_dir | Leaf run whose lineage is resolved. |
| [in] | scope | Either run-local or full-lineage collection scope. |
Each entry carries the run path, manifest, and the checkpoint at which that run branched from its parent. Cycles and unresolved parents fail.
Definition at line 5137 of file core.py.
|
protected |
Read step-to-time fallbacks from an existing PVD collection.
| [in] | pvd_path | Existing collection path. |
Definition at line 5171 of file core.py.
|
protected |
Read the authoritative time of one visualization frame.
Checkpoints record solver time. A dimensionalized recipe writes physical frames, so its collection reports physical time: the checkpoint time multiplied by the owning run's reference time.
| [in] | run_dir | Run owning the frame. |
| [in] | step | Frame checkpoint step. |
| [in] | fallback | Existing collection times, already in the collection's units, used after checkpoint pruning. |
| [in] | time_scale | Factor from solver time to the collection's time unit. |
Definition at line 5195 of file core.py.
|
protected |
Atomically write one VTK Collection file.
| [in] | path | Destination PVD path. |
| [in] | entries | Ordered frame mappings. |
Definition at line 5231 of file core.py.
|
protected |
Return the first segment belonging to one continuous artifact family.
| [in] | segments | Root-to-leaf lineage segments. |
| [in] | family | Artifact family being indexed. |
Definition at line 5263 of file core.py.
| list picurv_cli.core.finalize_post_paraview_series | ( | str | run_dir, |
| dict | post_cfg | ||
| ) |
Build physical-time ParaView collections from current or lineage VTK output.
| [in] | run_dir | Leaf run receiving the collection. |
| [in] | post_cfg | Parsed post-processing recipe. |
Definition at line 5284 of file core.py.
|
protected |
Return the importable serial finalizer used by generated jobs.
Definition at line 5386 of file core.py.
| list picurv_cli.core.build_post_finalize_command | ( | str | run_dir, |
| str | archived_post_path, | ||
| dict | post_cfg, | ||
post_stages = POST_STAGE_NAMES |
|||
| ) |
Build the serial post-success command for staged execution.
It runs after the field post-processor succeeds, in the conductor or in the submitted job, so whatever reads the field stage's output belongs here: the ParaView collections and the reducers.
| [in] | run_dir | Run receiving the collection. |
| [in] | archived_post_path | Archived post recipe read by the finalizer. |
| [in] | post_cfg | Parsed post-processing recipe. |
| [in] | post_stages | Selected post stages; reducers run only when selected. |
Definition at line 5401 of file core.py.
| None picurv_cli.core.finalize_post_outputs | ( | str | run_dir, |
| dict | post_cfg, | ||
| stages | |||
| ) |
Run every serial step that reads a successful field stage's output.
| [in] | run_dir | Run directory. |
| [in] | post_cfg | Recipe with canonical paths applied. |
| [in] | stages | Stage names the finalizer covers beyond the collections. |
Definition at line 5424 of file core.py.
|
protected |
Return whether the current post recipe expects statistics CSV artifacts.
| [in] | post_cfg | Argument passed to _post_requests_statistics(). |
_post_requests_statistics(). Definition at line 5437 of file core.py.
|
protected |
Return whether the current post recipe requires particle source files to be present.
| [in] | post_cfg | Argument passed to _post_needs_particle_source(). |
_post_needs_particle_source(). Definition at line 5446 of file core.py.
|
protected |
Yield configured post-processing steps inclusively.
| [in] | start_step | Argument passed to _iter_post_steps(). |
| [in] | end_step | Argument passed to _iter_post_steps(). |
| [in] | step_interval | Argument passed to _iter_post_steps(). |
Definition at line 5456 of file core.py.
| "tuple[int, int, int]" picurv_cli.core.resolve_post_requested_window | ( | dict | post_cfg, |
| dict | case_cfg = None |
||
| ) |
Resolve post requested start/end/interval, expanding end=-1 via case.yml when available.
| [in] | post_cfg | Argument passed to resolve_post_requested_window(). |
| [in] | case_cfg | Optional case configuration for end-step expansion. |
resolve_post_requested_window(). Definition at line 5471 of file core.py.
| int picurv_cli.core.resolve_post_owned_start | ( | str | run_dir, |
| dict | post_cfg, | ||
| int | requested_start, | ||
| int | step_interval | ||
| ) |
Intersect a recipe's logical cadence with this run's branch.
A branch run holds checkpoints only from the step it forked at, so steps before it belong to its ancestors and never appear here; the run's window starts at its first cadence step at or after the fork.
| [in] | run_dir | Run whose branch ownership is inspected. |
| [in] | post_cfg | Parsed post-processing recipe. |
| [in] | requested_start | Logical recipe start step. |
| [in] | step_interval | Logical recipe cadence. |
Definition at line 5491 of file core.py.
| dict picurv_cli.core.prepare_effective_post_config | ( | dict | post_cfg, |
| str | resolved_source_dir, | ||
| int | start_step = None, |
||
| int | end_step = None |
||
| ) |
Return a copy of post_cfg with resolved source dir and optional effective bounds.
| [in] | post_cfg | Argument passed to prepare_effective_post_config(). |
| [in] | resolved_source_dir | Argument passed to prepare_effective_post_config(). |
| [in] | start_step | Argument passed to prepare_effective_post_config(). |
| [in] | end_step | Argument passed to prepare_effective_post_config(). |
prepare_effective_post_config(). Definition at line 5516 of file core.py.
|
protected |
Collect the VTK files named with a prefix, step suffix, and extension.
| [in] | prefix_path | Output path prefix before the numeric step suffix. |
| [in] | extension | VTK file extension to match without its leading dot. |
Definition at line 5537 of file core.py.
|
protected |
Scan step ids from the first CSV column of a statistics artifact.
| [in] | csv_path | Argument passed to _scan_post_statistics_csv_steps(). |
_scan_post_statistics_csv_steps(). Definition at line 5557 of file core.py.
| "list[tuple]" picurv_cli.core.collect_post_completion_families | ( | str | run_dir, |
| dict | post_cfg, | ||
monitor_cfg = None |
|||
| ) |
Collect the output files each output family of the current recipe holds per step.
| [in] | run_dir | Argument passed to collect_post_completion_families(). |
| [in] | post_cfg | Argument passed to collect_post_completion_families(). |
| [in] | monitor_cfg | Optional parsed monitor YAML configuration dictionary. |
Definition at line 5580 of file core.py.
|
protected |
Read each field-statistics window's sample count from one committed checkpoint.
| [in] | run_dir | Run directory whose output holds the checkpoint. |
| [in] | step | Checkpoint step. |
Definition at line 5626 of file core.py.
| picurv_cli.core.post_step_outputs | ( | str | run_dir, |
| dict | post_cfg, | ||
monitor_cfg = None |
|||
| ) |
Return a lookup of the output files one step of the current recipe holds.
A step is complete when every family it must produce has its output. The post-processor writes a statistics window's output at a step only if the window had accumulated a sample in the bundle it reads, the pinned source_step or the step itself, so a window that had not opened yet is not required there.
| [in] | run_dir | Run whose output is inspected. |
| [in] | post_cfg | Runtime recipe with canonical paths. |
| [in] | monitor_cfg | Parsed monitor configuration. |
Definition at line 5649 of file core.py.
|
protected |
Return the complete source step nearest to a target step.
| [in] | steps | Candidate step numbers. |
| [in] | target | Target step number. |
Definition at line 5700 of file core.py.
|
protected |
Format an optional step number for user-facing diagnostics.
| [in] | step | Step number or None. |
Definition at line 5712 of file core.py.
|
protected |
Scan source artifacts and return steps with every file required by the recipe.
| [in] | source_dir | Source output root directory. |
| [in] | monitor_cfg | Parsed monitor configuration. |
| [in] | post_cfg | Parsed post-processing configuration. |
Definition at line 5721 of file core.py.
|
protected |
Build required source file paths for a single post-processing step.
| [in] | step | Requested step number. |
| [in] | source_scan | Metadata returned by _scan_complete_source_steps(). |
| [in] | post_cfg | Parsed post-processing configuration. |
Definition at line 5740 of file core.py.
| dict picurv_cli.core.detect_post_source_frontier | ( | str | source_dir, |
| dict | monitor_cfg, | ||
| dict | post_cfg, | ||
| int | start_step, | ||
| int | end_step, | ||
| int | step_interval | ||
| ) |
Detect the highest contiguous fully available source step for live post-processing.
| [in] | source_dir | Argument passed to detect_post_source_frontier(). |
| [in] | monitor_cfg | Argument passed to detect_post_source_frontier(). |
| [in] | post_cfg | Argument passed to detect_post_source_frontier(). |
| [in] | start_step | Argument passed to detect_post_source_frontier(). |
| [in] | end_step | Argument passed to detect_post_source_frontier(). |
| [in] | step_interval | Argument passed to detect_post_source_frontier(). |
detect_post_source_frontier(). Definition at line 5756 of file core.py.
|
protected |
Read the per-step output records a recipe's state holds.
| [in] | state_path | The recipe's state.json. |
Definition at line 5812 of file core.py.
| picurv_cli.core.persist_post_resume_state | ( | str | run_dir, |
| dict | plan, | ||
steps = None, |
|||
spectra = None |
|||
| ) |
Write a recipe's state: the window last planned and its per-step output records.
| [in] | run_dir | Run the recipe belongs to. |
| [in] | plan | Plan from build_post_execution_plan(). |
| [in] | steps | Field-stage records to merge in, keyed by step, or None. |
| [in] | spectra | Spectra records to merge in, keyed by step, or None. |
Definition at line 5825 of file core.py.
|
protected |
Identify one committed checkpoint by its commit marker.
| [in] | source_dir | Output root holding the checkpoints. |
| [in] | step | Checkpoint step. |
Definition at line 5854 of file core.py.
| "str | None" picurv_cli.core.classify_post_step | ( | record, | |
| files, | |||
| commit, | |||
| str | recipe, | ||
| bool | recompute = False |
||
| ) |
Decide whether one step's existing output is still valid.
Output stays valid while it was made by the same recipe from the checkpoint now on disk. The build that made it does not invalidate it: a rebuild changes every binary's hash, and redoing a whole window after each one is what --recompute is for. Output without a record (written before records existed, or by a job killed before it could record) is accepted when it is newer than its checkpoint, or when the checkpoint is no longer local.
| [in] | record | The step's record, or None. |
| [in] | files | Files the step's output consists of, or None when any is missing. |
| [in] | commit | Checkpoint identity from _checkpoint_commit(), or None. |
| [in] | recipe | Current recipe fingerprint. |
| [in] | recompute | Whether the invocation regenerates every step. |
missing, recompute, recipe, or checkpoint. Definition at line 5870 of file core.py.
| None picurv_cli.core.warn_overlapping_post_recipes | ( | str | run_dir, |
| dict | post_cfg, | ||
| dict | plan, | ||
| post_stages | |||
| ) |
Warn when another recipe in this run already produced outputs this one repeats.
A recipe writes one file per step holding all its fields, so a recipe that repeats another's fields recomputes them rather than reusing them. The warning names the shared fields and statistics windows and the overlapping steps, so the new outputs can go into a recipe of their own instead.
| [in] | run_dir | Run being post-processed. |
| [in] | post_cfg | Runtime recipe with canonical paths. |
| [in] | plan | Plan from build_post_execution_plan(). |
| [in] | post_stages | Selected post stages. |
Definition at line 5902 of file core.py.
|
protected |
Return the Python wrapper that runs one post job under an exclusive lock.
Given --post-recipe, the wrapper plans the job's steps as it starts (prepare_post_job()), skips the postprocessor when none need work, and records the steps produced when the postprocessor exits, even on failure (finish_post_job()). It imports the conductor from this installation, so it must run under the conductor's interpreter.
_build_post_lock_wrapper_source(). Definition at line 5960 of file core.py.
| str picurv_cli.core.ensure_post_lock_wrapper | ( | str | run_dir | ) |
Ensure the lock wrapper exists for a run directory and return its path.
| [in] | run_dir | Argument passed to ensure_post_lock_wrapper(). |
ensure_post_lock_wrapper(). Definition at line 6078 of file core.py.
| "tuple[list, dict]" picurv_cli.core.build_post_locked_command | ( | str | run_dir, |
| str | recipe_fingerprint, | ||
| list | wrapped_command, | ||
| bool | create_wrapper = True, |
||
| "list | None" | success_command = None, |
||
| "str | None" | post_recipe = None, |
||
| "str | None" | postprocessor = None, |
||
| bool | recompute = False |
||
| ) |
Wrap a postprocessor command behind the run-dir-scoped lock wrapper.
| [in] | run_dir | Argument passed to build_post_locked_command(). |
| [in] | recipe_fingerprint | Argument passed to build_post_locked_command(). |
| [in] | wrapped_command | Argument passed to build_post_locked_command(). |
| [in] | create_wrapper | Argument passed to build_post_locked_command(). |
| [in] | success_command | Optional serial command run under the same lock after success. |
| [in] | post_recipe | Recipe whose steps the wrapper plans at launch; None runs the command as given. |
| [in] | postprocessor | Postprocessor the command launches, recorded with its output. |
| [in] | recompute | Regenerate every step whose checkpoint is committed. |
build_post_locked_command(). Definition at line 6099 of file core.py.
| None picurv_cli.core.run_post_finalize_locked | ( | str | run_dir, |
| str | recipe_fingerprint, | ||
| list | finalize_command | ||
| ) |
Refresh a collection-only result under the ordinary post writer lock.
| [in] | run_dir | Run whose post writer lock is acquired. |
| [in] | recipe_fingerprint | Recipe identity recorded in lock metadata. |
| [in] | finalize_command | Serial collection finalizer command. |
Definition at line 6138 of file core.py.
| dict picurv_cli.core.build_post_execution_plan | ( | str | run_dir, |
| str | run_id, | ||
| dict | case_cfg, | ||
| dict | monitor_cfg, | ||
| dict | post_cfg, | ||
| bool | recompute = False, |
||
| bool | allow_source_frontier_scan = True, |
||
| "str | None" | postprocessor_sha = None |
||
| ) |
Decide which steps of a recipe's window one invocation processes.
Every requested step is classified by classify_post_step(): valid output is kept, and missing or stale output is (re)made once its checkpoint is committed. Steps need not be contiguous. When the solver stage has not run yet the source scan is deferred and every step without valid output is planned; the post job plans again when it starts (prepare_post_job()).
| [in] | run_dir | Run being post-processed. |
| [in] | run_id | Run identity recorded in the recipe state. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | monitor_cfg | Parsed monitor configuration. |
| [in] | post_cfg | Parsed post recipe. |
| [in] | recompute | Regenerate every step whose checkpoint is committed. |
| [in] | allow_source_frontier_scan | False when the solver stage has not produced output yet. |
| [in] | postprocessor_sha | Hash of the postprocessor that would run, used only to report valid output another build made. |
Definition at line 6160 of file core.py.
| None picurv_cli.core.report_post_plan | ( | dict | plan | ) |
Print which steps a post plan processes, keeps, and waits for.
| [in] | plan | Plan from build_post_execution_plan(). |
Definition at line 6299 of file core.py.
| str picurv_cli.core.get_post_step_list_path | ( | str | run_dir, |
| dict | post_cfg | ||
| ) |
Return the file naming the steps a launched post job processes.
| [in] | run_dir | Run directory. |
| [in] | post_cfg | Runtime recipe with canonical paths. |
<path>.json holds what recording needs. Definition at line 6320 of file core.py.
|
protected |
Load the configuration a post job needs from the run it runs in.
| [in] | run_dir | Run directory. |
| [in] | post_recipe_path | The recipe the job was staged with. |
Definition at line 6330 of file core.py.
| int picurv_cli.core.prepare_post_job | ( | str | run_dir, |
| str | post_recipe_path, | ||
| str | postprocessor, | ||
| bool | recompute = False |
||
| ) |
Decide, as a post job starts, which steps it processes.
Runs under the post lock immediately before the postprocessor, so a job staged long before it runs still skips output produced in the meantime and sees checkpoints the solver has written since. Writes the step list the postprocessor reads, and records what finish_post_job() needs.
| [in] | run_dir | Run directory. |
| [in] | post_recipe_path | The recipe the job was staged with. |
| [in] | postprocessor | Postprocessor executable the job launches. |
| [in] | recompute | Regenerate every step whose checkpoint is committed. |
Definition at line 6344 of file core.py.
| int picurv_cli.core.finish_post_job | ( | str | run_dir, |
| str | post_recipe_path, | ||
| bool | exited_cleanly = False |
||
| ) |
Record, after a post job ends, which steps it produced.
Runs whether or not the postprocessor succeeded, so the steps a failed or interrupted job completed are kept. A step is credited only when all its output exists and was written by this job.
| [in] | run_dir | Run directory. |
| [in] | post_recipe_path | The recipe the job was staged with. |
| [in] | exited_cleanly | Whether the postprocessor exited with status zero; a clean exit that left an expected output unwritten is reported. |
Definition at line 6394 of file core.py.
| bool picurv_cli.core.needs_restart_source | ( | dict | case_cfg, |
| dict | solver_cfg | ||
| ) |
Return True when the solver requires restart data from disk.
Correctly identifies that analytical + init + start_step > 0 does NOT need a restart source (C code never reads from restart_dir in that case).
| [in] | case_cfg | Parsed case YAML dictionary. |
| [in] | solver_cfg | Parsed solver YAML dictionary. |
Definition at line 6456 of file core.py.
| str picurv_cli.core.resolve_run_output_dir | ( | str | run_dir, |
| dict | monitor_cfg | ||
| ) |
Resolve the output data directory within a run directory.
| [in] | run_dir | Path to the run directory. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary. |
Definition at line 6480 of file core.py.
| str picurv_cli.core.resolve_run_restart_dir | ( | str | run_dir, |
| dict | monitor_cfg | ||
| ) |
Resolve the restart staging directory within a run directory.
| [in] | run_dir | Path to the run directory. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary. |
Definition at line 6491 of file core.py.
| str picurv_cli.core.compute_physical_case_identity | ( | dict | case_cfg | ) |
Compute the hidden identity used to guard in-place continuation.
Run length/timestep controls, the MPI domain decomposition, and particle load-vs-init policy do not define the physical case. All other case.yml content does. Checkpoints are decomposition-independent, so a run may continue on a different rank layout.
| [in] | case_cfg | Parsed case configuration. |
Definition at line 6502 of file core.py.
| None picurv_cli.core.validate_continue_case_identity | ( | str | run_dir, |
| dict | case_cfg | ||
| ) |
Reject in-place continuation when the physical case has changed.
| [in] | run_dir | Existing run directory being continued. |
| [in] | case_cfg | Newly requested case configuration. |
Definition at line 6531 of file core.py.
| picurv_cli.core.populate_restart_directory | ( | str | source_output, |
| str | target_restart, | ||
| int | start_step, | ||
| dict | monitor_cfg, | ||
| "int | None" | end_step = None, |
||
| bool | materialize = True |
||
| ) |
Atomically materialize an immutable checkpoint interval into a run.
| [in] | source_output | Path to the source output directory containing checkpoint data. |
| [in] | target_restart | Path to the target restart directory to populate. |
| [in] | start_step | First checkpoint step to materialize. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary (for subdirectory names). |
| [in] | end_step | Optional inclusive last checkpoint step. |
| [in] | materialize | Whether to copy the bundles, or only validate and resolve the path a real run would use. The dry-run planner needs the second: it reports what a run would refuse, and promises to write nothing. |
Definition at line 6550 of file core.py.
| picurv_cli.core.validate_eulerian_checkpoint | ( | str | source_dir, |
| int | step, | ||
| dict | monitor_cfg | ||
| ) |
Validate the mandatory Eulerian field set required by ReadSimulationFields().
| [in] | source_dir | Root directory containing the Eulerian subdirectory. |
| [in] | step | Checkpoint step to validate. |
| [in] | monitor_cfg | Monitor configuration defining the Eulerian subdirectory. |
| ValueError | if any mandatory Eulerian field is absent. |
Definition at line 6611 of file core.py.
| picurv_cli.core.detect_last_checkpoint_step | ( | str | output_dir | ) |
Scan output directory for the highest step number available.
Ignores incomplete temporary directories and invalid bundles.
| [in] | output_dir | Path to the output directory. |
Definition at line 6624 of file core.py.
| dict picurv_cli.core.detect_case_completion_status | ( | str | run_dir, |
| dict | monitor_cfg, | ||
| int | target_final_step | ||
| ) |
Determine whether a study case is complete, partially complete, or empty.
| [in] | run_dir | Path to the case run directory. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary. |
| [in] | target_final_step | The step number the case should reach for completion. |
Definition at line 6635 of file core.py.
| picurv_cli.core.validate_load_mode_step_range | ( | str | source_output, |
| int | start_step, | ||
| int | total_steps, | ||
| dict | monitor_cfg | ||
| ) |
Validate that all required eulerian step files exist for "load" mode.
Checks that ufield files exist for every step from start_step through start_step + total_steps (inclusive). Reports missing steps clearly.
| [in] | source_output | Path to the output directory containing eulerian data. |
| [in] | start_step | First step that will be loaded. |
| [in] | total_steps | Number of steps to run. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary (for subdirectory names). |
Definition at line 6655 of file core.py.
| picurv_cli.core.validate_particle_checkpoint | ( | str | source_dir, |
| int | start_step, | ||
| dict | monitor_cfg | ||
| ) |
Validate that particle checkpoint files exist for the given step.
Checks that at least a position file exists at the expected step in the particle subdirectory.
| [in] | source_dir | Path to the directory containing the particle subdirectory. |
| [in] | start_step | The step number whose particle checkpoint is expected. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary (for subdirectory names). |
Definition at line 6682 of file core.py.
| dict picurv_cli.core.read_monitor_from_run | ( | str | run_dir | ) |
Read the monitor.yml from a run directory's config/ subdirectory.
| [in] | run_dir | Path to the run directory. |
Definition at line 6696 of file core.py.
| str picurv_cli.core.resolve_latest_restart_run | ( | dict | case_cfg, |
| str | case_path, | ||
| int | start_step | ||
| ) |
Select the newest local workspace run compatible with a requested restart.
| [in] | case_cfg | Current case configuration. |
| [in] | case_path | Current case path. |
| [in] | start_step | Required committed checkpoint. |
Definition at line 6708 of file core.py.
| picurv_cli.core.resolve_restart_source | ( | args, | |
| dict | case_cfg, | ||
| dict | solver_cfg, | ||
| dict | monitor_cfg, | ||
| str | run_dir, | ||
| bool | materialize = True |
||
| ) |
Resolve the restart source directory based on –restart-from or –continue CLI flags.
Implements the full restart resolution logic including smart resolution for –continue (checks restart/ first for user-curated data, falls back to output/) and direct reference for eulerian "load" mode.
| [in] | args | Parsed CLI arguments (must have restart_from, continue_run, run_dir attrs). |
| [in] | case_cfg | Parsed case YAML dictionary. |
| [in] | solver_cfg | Parsed solver YAML dictionary. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary. |
| [in] | run_dir | Path to the current run directory. |
| [in] | materialize | Whether to copy restart bundles into the run. The dry-run planner passes False: it still validates and resolves, but writes nothing. |
build_run_lineage(), or None when this run did not branch from another. Definition at line 6761 of file core.py.
| picurv_cli.core.absolutize_case_external_paths | ( | dict | case_cfg, |
| str | case_anchor_path | ||
| ) |
Convert external grid/generator paths in case config to absolute paths.
| [in] | case_cfg | Argument passed to absolutize_case_external_paths(). |
| [in] | case_anchor_path | Argument passed to absolutize_case_external_paths(). |
Definition at line 6970 of file core.py.
| picurv_cli.core.prepare_case_for_continuation | ( | str | run_dir, |
| str | case_id, | ||
| int | last_step, | ||
| int | target_final_step, | ||
| dict | cluster_cfg | ||
| ) |
Set up a partially-completed study case for continuation in-place.
Updates the case config with new start_step/total_steps, sets particle restart_mode to 'load' if checkpoint exists, populates the restart directory, and regenerates the solver control file with continue_mode. Delegates all restart resolution to resolve_restart_source().
| [in] | run_dir | Path to the case run directory. |
| [in] | case_id | The case identifier (e.g. 'case_0002'). |
| [in] | last_step | The last checkpoint step found in the output directory. |
| [in] | target_final_step | The step number the case should reach for completion. |
| [in] | cluster_cfg | Parsed cluster YAML dictionary (for num_procs, walltime guard). |
Definition at line 7035 of file core.py.
| bool picurv_cli.core.is_valid_email | ( | str | ) |
Lightweight email validation for scheduler notifications.
| [in] | Argument passed to is_valid_email(). |
is_valid_email(). Definition at line 7106 of file core.py.
| str picurv_cli.core.normalize_statistics_task | ( | str | task_name | ) |
Normalizes user-facing statistics task names to C pipeline keywords.
| [in] | task_name | Task name from YAML. |
| ValueError | if task is unsupported. |
Definition at line 7117 of file core.py.
|
protected |
Yield (lineno, stripped_line) for non-empty, non-comment lines.
| [in] | file_obj | Argument passed to _iter_nonempty_noncomment_lines(). |
Definition at line 7132 of file core.py.
| str picurv_cli.core.format_picgrid_coordinate | ( | float | value | ) |
Format a coordinate with round-trip-safe binary64 precision.
| [in] | value | Coordinate value. |
Definition at line 7146 of file core.py.
| dict picurv_cli.core.validate_and_nondimensionalize_picgrid | ( | str | source_grid, |
| str | dest_grid, | ||
| float | L_ref, | ||
| int | expected_nblk = None |
||
| ) |
Validates PICGRID payload and writes a non-dimensionalized copy.
Requires canonical PICGRID input with leading "PICGRID" token. Output is always written in canonical PICGRID format with header and per-block dims.
| [in] | source_grid | Input grid file path. |
| [in] | dest_grid | Output grid file path. |
| [in] | L_ref | Reference length for non-dimensionalization. |
| [in] | expected_nblk | Optional expected block count. |
| ValueError | on malformed grid. |
Definition at line 7155 of file core.py.
| list picurv_cli.core.read_picgrid_header_dimensions | ( | str | source_grid, |
| int | expected_nblk = None |
||
| ) |
Read only the canonical PICGRID header dimensions.
| [in] | source_grid | Input grid file path. |
| [in] | expected_nblk | Optional expected block count. |
| ValueError | on malformed header. |
Definition at line 7262 of file core.py.
| dict picurv_cli.core.validate_and_nondimensionalize_picslice | ( | str | source_slice, |
| str | dest_slice, | ||
| float | U_ref, | ||
| tuple | expected_dims = None |
||
| ) |
Validate a canonical PICSLICE payload and write a solver-scale copy.
| [in] | source_slice | Input PICSLICE path. |
| [in] | dest_slice | Output staged PICSLICE path. |
| [in] | U_ref | Reference velocity for non-dimensionalization. |
| [in] | expected_dims | Optional expected (n1, n2) slice dimensions. |
| ValueError | on malformed slice. |
Definition at line 7319 of file core.py.
|
protected |
Convert a BC face token into a filesystem-friendly artifact token.
| [in] | face | Canonical face token such as -Zeta. |
Definition at line 7417 of file core.py.
|
protected |
Resolve a run artifact path with run-dir-relative defaults.
| [in] | run_dir | Run/precompute directory root. |
| [in] | configured_path | Optional user-provided artifact path. |
| [in] | default_path | Default path relative to run_dir. |
| [in] | default_to_config_dir | If true, bare relative names are placed under config/. |
Definition at line 7425 of file core.py.
|
protected |
Resolve an optional generator script override or repository default.
| [in] | configured_script | Optional absolute or case-relative script path. |
| [in] | case_path | Current case.yml path used to anchor relative overrides. |
| [in] | default_name | Repository generator filename under GENERATORS_PATH. |
Definition at line 7445 of file core.py.
|
protected |
Validate square-duct Poiseuille generator parameters.
| [in] | params | Generator params mapping. |
| [in] | field_name | Human-readable YAML field name for diagnostics. |
Definition at line 7461 of file core.py.
|
protected |
Validate a prescribed_flow field_slice source block.
| [in] | source | Source mapping from case.yml. |
| [in] | field_name | Human-readable YAML path for diagnostics. |
Definition at line 7488 of file core.py.
|
protected |
Validate the field_slice slice selector.
| [in] | slice_cfg | Slice selector mapping. |
| [in] | field_name | Human-readable YAML path for diagnostics. |
Definition at line 7550 of file core.py.
| dict picurv_cli.core.generate_square_duct_poiseuille_picslice | ( | str | output_path, |
| tuple | dims, | ||
| dict | params, | ||
| str | target_grid = None, |
||
| int | target_block = 0, |
||
| str | target_face = None, |
||
| str | script = None, |
||
| str | case_path = None |
||
| ) |
Generate a dimensional canonical PICSLICE for square-duct Poiseuille flow.
| [in] | output_path | Path to write. |
| [in] | dims | PICSLICE dimensions in face storage order (n1, n2). |
| [in] | params | Normalized generator params. |
| [in] | target_grid | Optional canonical target PICGRID for grid-aware sampling. |
| [in] | target_block | Target block index when target_grid is provided. |
| [in] | target_face | Target inlet face when target_grid is provided. |
| [in] | script | Optional profile.gen-compatible script override. |
| [in] | case_path | Current case.yml path used to anchor relative script overrides. |
Definition at line 7616 of file core.py.
| dict picurv_cli.core.generate_field_slice_picslice | ( | str | output_path, |
| tuple | expected_dims, | ||
| dict | source, | ||
| str | target_grid, | ||
| str | target_face, | ||
| int | target_block, | ||
| str | case_path | ||
| ) |
Invoke profile.gen to extract a field_slice PICSLICE artifact.
| [in] | output_path | Path to write. |
| [in] | expected_dims | Expected PICSLICE dimensions. |
| [in] | source | Normalized field_slice source mapping. |
| [in] | target_grid | Target canonical PICGRID path. |
| [in] | target_face | Target inlet face token. |
| [in] | target_block | Target block index. |
| [in] | case_path | Path to current case.yml for relative source resolution. |
Definition at line 7669 of file core.py.
|
protected |
Resolve a path relative to the current case directory.
| [in] | path_value | Path from case.yml. |
| [in] | case_dir | Current case directory. |
Definition at line 7741 of file core.py.
|
protected |
Resolve field_slice dimensional velocity scale.
| [in] | source | Normalized field_slice source mapping. |
| [in] | case_dir | Current case directory. |
Definition at line 7773 of file core.py.
| str picurv_cli.core.resolve_target_grid_for_field_slice | ( | dict | case_cfg, |
| str | case_path, | ||
| str | run_dir | ||
| ) |
Resolve the target canonical PICGRID path needed for field_slice normals.
| [in] | case_cfg | Parsed current case config. |
| [in] | case_path | Current case.yml path. |
| [in] | run_dir | Current run/precompute directory. |
Definition at line 7795 of file core.py.
| str picurv_cli.core.resolve_target_grid_for_generated_profile | ( | dict | case_cfg, |
| str | case_path, | ||
| str | run_dir | ||
| ) |
Resolve the target canonical PICGRID for generated profile sampling.
The simulator builds a programmatic_c grid itself, so no grid file exists here. The profile is sampled instead on the bridge PICGRID that a Python initial condition already uses, written with the solver's own node formula. Without a grid the generator could only sample uniform logical points and normalize to the continuous-area mean, which delivered about 2/n too much flux on n cells across (programmatic-inlet-flux-2026-09-18).
| [in] | case_cfg | Parsed current case config. |
| [in] | case_path | Current case.yml path. |
| [in] | run_dir | Current run/precompute directory. |
Definition at line 7824 of file core.py.
| str picurv_cli.core.write_profile_info | ( | str | config_dir, |
| list | summaries | ||
| ) |
Write a profile.info summary for generated inlet profiles.
| [in] | config_dir | Run/precompute config directory. |
| [in] | summaries | Generated profile summaries. |
Definition at line 7850 of file core.py.
| list picurv_cli.core.validate_grid_generator_cli_args | ( | cli_args, | |
| str | case_path | ||
| ) |
Check closed-choice values inside the generator's opaque token list.
cli_args is passed through to grid.gen untouched, so a misspelled geometry selector there is only discovered when the subprocess exits nonzero partway into a run. The generator remains the authority; this reports the same set earlier, and stays silent on anything it does not recognize.
| [in] | cli_args | Raw token list from grid.generator.cli_args. |
| [in] | case_path | Case file path for diagnostics. |
Definition at line 7925 of file core.py.
| str picurv_cli.core.run_grid_generator | ( | str | case_path, |
| str | run_dir, | ||
| dict | grid_cfg, | ||
| dict | case_cfg = None |
||
| ) |
Runs generators/grid.gen to produce a PICGRID file for this run.
| [in] | case_path | Path to case.yml (used for relative path resolution). |
| [in] | run_dir | Run directory path. |
| [in] | grid_cfg | The grid config section from case.yml. |
| [in] | case_cfg | Parsed case configuration, when available. Its reference scales are handed to the generator so the quality report can carry solver and wall units. Reporting only: the generator never scales coordinates, which validate_and_nondimensionalize_picgrid does once for every grid regardless of origin. |
| ValueError | on invalid config or generator failure. |
Definition at line 7966 of file core.py.
|
protected |
Validate the structured source block for prescribed_flow BCs.
| [in] | source | Source mapping from case.yml. |
| [in] | field_name | Human-readable YAML path for diagnostics. |
| ValueError | on invalid source contract. |
Definition at line 8156 of file core.py.
|
protected |
Return expected PICSLICE dimensions for a face and block node dimensions.
| [in] | face | Canonical BC face token. |
| [in] | block_dims | (IM, JM, KM) node counts. |
Definition at line 8208 of file core.py.
| list picurv_cli.core.resolve_grid_block_dimensions_for_profiles | ( | dict | case_cfg, |
| str | case_path, | ||
| str | run_dir = None |
||
| ) |
Resolve per-block node dimensions for prescribed inlet profile validation.
| [in] | case_cfg | Parsed case.yml configuration. |
| [in] | case_path | Path to case.yml for relative path resolution. |
| [in] | run_dir | Current run directory, used for optional generated grid outputs. |
| ValueError | when dimensions cannot be resolved. |
Definition at line 8228 of file core.py.
| list picurv_cli.core.materialize_generated_prescribed_flow_profiles | ( | str | run_dir, |
| dict | case_cfg, | ||
| str | case_path, | ||
| list | profile_grid_dims = None |
||
| ) |
Generate dimensional PICSLICE artifacts for generated/field_slice prescribed_flow sources.
| [in] | run_dir | Run/precompute directory root. |
| [in] | case_cfg | Parsed case.yml. |
| [in] | case_path | Path to case.yml for relative grid/source resolution. |
| [in] | profile_grid_dims | Optional pre-resolved block node dimensions. |
Definition at line 8288 of file core.py.
|
protected |
Convert a YAML scalar to float with a clear error message.
| [in] | value | Argument passed to _to_float(). |
| [in] | field_name | Argument passed to _to_float(). |
_to_float(). Definition at line 8366 of file core.py.
|
protected |
Convert a non-boolean YAML scalar to a finite float.
| [in] | value | Raw YAML scalar. |
| [in] | field_name | User-facing configuration path. |
Definition at line 8379 of file core.py.
|
protected |
Convert a YAML scalar/string to bool with a clear error message.
| [in] | value | Argument passed to _to_bool(). |
| [in] | field_name | Argument passed to _to_bool(). |
_to_bool(). Definition at line 8393 of file core.py.
| picurv_cli.core.normalize_boundary_conditions_layout | ( | all_blocks_bcs, | |
| int | num_blocks | ||
| ) |
Normalize boundary_conditions to list-of-lists form and validate block count.
| [in] | all_blocks_bcs | Argument passed to normalize_boundary_conditions_layout(). |
| [in] | num_blocks | Argument passed to normalize_boundary_conditions_layout(). |
normalize_boundary_conditions_layout(). Definition at line 8410 of file core.py.
|
protected |
Reports which logical axes a case declares periodic on both faces.
| [in] | case_cfg | Parsed case.yml mapping. |
Definition at line 8435 of file core.py.
| picurv_cli.core.validate_wall_model_pairing | ( | dict | case_cfg, |
| les_cfg, | |||
| wall_cfg, | |||
| str | case_path, | ||
| list | errors, | ||
| list | warnings | ||
| ) |
Rejects wall-model selections that no turbulence treatment can support.
A wall model replaces the near-wall flow with an analytic profile so that the boundary layer need not be resolved. That only means something if the unresolved motions are modelled somewhere. Three combinations cannot be, and each fails here rather than after the mesh is built.
| case_cfg | Parsed case configuration, read for the Reynolds number. |
| les_cfg | models.physics.turbulence.les, or None. |
| wall_cfg | models.physics.turbulence.wall_function, or None. |
| case_path | Case path, for message prefixes. |
| errors | Collected blocking messages, appended to. |
| warnings | Collected advisory messages, appended to. |
Definition at line 8467 of file core.py.
|
protected |
Reynolds number implied by a case's scaling and fluid properties.
| case_cfg | Parsed case configuration. |
Definition at line 8525 of file core.py.
| picurv_cli.core.validate_les_configuration | ( | dict | case_cfg, |
| dict | les_cfg, | ||
| str | case_path, | ||
| list | errors, | ||
| list | warnings | ||
| ) |
Checks the structured LES block for values the closure cannot honour.
| [in] | case_cfg | Parsed case.yml mapping, used to read declared periodicity. |
| [in] | les_cfg | Parsed models.physics.turbulence.les mapping. |
| [in] | case_path | Case file path used to prefix diagnostics. |
| [out] | errors | List collecting blocking validation failures. |
| [out] | warnings | List collecting advisory messages. |
errors and warnings. Definition at line 8546 of file core.py.
| picurv_cli.core.validate_and_prepare_boundary_conditions | ( | dict | case_cfg | ) |
Validate BC entries against currently supported C-side handlers/types and.
return normalized entries ready for bcs.run generation.
| [in] | case_cfg | Argument passed to validate_and_prepare_boundary_conditions(). |
validate_and_prepare_boundary_conditions(). Definition at line 8720 of file core.py.
|
protected |
Render an internal schema path tuple as a user-facing YAML path.
| [in] | path | Internal path tuple. |
Definition at line 8904 of file core.py.
|
protected |
Return allowed keys for a path, honoring '*' dynamic mapping entries.
| [in] | schema | Role schema mapping. |
| [in] | path | Internal path tuple. |
Definition at line 8913 of file core.py.
|
protected |
Build a concise typo or hierarchy hint for an unsupported YAML key.
| [in] | schema | Role schema mapping. |
| [in] | path | Current internal YAML path tuple. |
| [in] | key | Unsupported YAML key. |
| [in] | allowed | Allowed keys at the current path. |
Definition at line 8931 of file core.py.
|
protected |
Reject unsupported YAML keys before they can be silently ignored by staging.
| [in] | cfg | Parsed YAML node. |
| [in] | schema | Role schema mapping. |
| [in] | file_path | Source file path for diagnostics. |
| [in,out] | errors | Validation error accumulator. |
| [in] | path | Current internal YAML path tuple. |
Definition at line 8959 of file core.py.
|
protected |
Return the field table an ensemble of one source names its fields from.
| [in] | source | One of POST_STATISTICS_ENSEMBLE_SOURCES. |
Definition at line 9231 of file core.py.
| tuple picurv_cli.core.input_quantity | ( | tuple | path | ) |
Return the (dimension, conversion site) recorded for one configuration input.
| [in] | path | Role followed by the schema path, e.g. ("case", "run_control", "dt_physical"). |
| KeyError | when no entry covers the path. |
Definition at line 9571 of file core.py.
| float picurv_cli.core.reference_scale | ( | tuple | dimension, |
| dict | scales | ||
| ) |
Return the factor that turns a physical quantity of this dimension into solver units.
| [in] | dimension | (length, velocity, density) exponents. |
| [in] | scales | Mapping with length_ref and velocity_ref, and density when used. |
length_ref**a * velocity_ref**b * density**c. Definition at line 9585 of file core.py.
| float picurv_cli.core.input_reference_scale | ( | tuple | path, |
| dict | scales | ||
| ) |
Return the reference scale of one recorded input, for converting a whole payload.
File payloads (grids, inlet profiles) are converted element by element by their own readers; this gives them the one factor their recorded dimension implies, so they do not restate the dimension.
| [in] | path | Role and schema path of the input. |
| [in] | scales | Reference scales, as returned by resolve_reference_scales(). |
Definition at line 9599 of file core.py.
| picurv_cli.core.quantity_to_solver_units | ( | value, | |
| tuple | quantity, | ||
| dict | scales, | ||
| str | label | ||
| ) |
Convert a physical value, or a list of them, by one recorded quantity entry.
| [in] | value | Physical value as written by the user. |
| [in] | quantity | (dimension, conversion site) entry from a dimension table. |
| [in] | scales | Reference scales, as returned by resolve_reference_scales(). |
| [in] | label | Configuration path, for diagnostics. |
| ValueError | when the entry records no fixed dimension. |
Definition at line 9615 of file core.py.
| picurv_cli.core.to_solver_units | ( | value, | |
| tuple | path, | ||
| dict | scales | ||
| ) |
Convert one physical configuration value, or a list of them, to solver units.
| [in] | value | Physical value as written by the user. |
| [in] | path | Role and schema path whose recorded dimension governs the conversion. |
| [in] | scales | Reference scales, as returned by resolve_reference_scales(). |
| ValueError | when the path records no fixed dimension. |
Definition at line 9634 of file core.py.
| dict picurv_cli.core.resolve_reference_scales | ( | dict | case_cfg | ) |
Resolve the reference length and velocity (and density, when given) of a case.
This is the part of the scaling contract every conversion needs. It does not require the fluid block, so boundary-condition preparation can use it before the full fluid contract is validated.
| [in] | case_cfg | Parsed case configuration. |
length_ref, velocity_ref, and optionally density. | ValueError | when a reference scale is missing, non-finite, or not positive. |
Definition at line 9647 of file core.py.
| str picurv_cli.core.directory_value_charset_problem | ( | str | value | ) |
Describe why a directory value cannot be written to a PETSc options line.
| [in] | value | Configured directory value. |
Definition at line 9702 of file core.py.
| str picurv_cli.core.classify_run_directory_value | ( | value | ) |
Classify a configured run directory value.
Containment is judged lexically against the run directory, because the run directory does not exist yet at validation time. Beyond escaping, a value is rejected when it resolves to the run root itself: the log directory is recursively deleted on a fresh solve, so . or a/.. would delete the run.
| [in] | value | Configured directory value from monitor io.directories. |
Definition at line 9719 of file core.py.
| str picurv_cli.core.normalized_run_directory | ( | str | value | ) |
Normalized, comparable form of a contained run directory value.
| [in] | value | Configured directory value. |
Definition at line 9755 of file core.py.
| bool picurv_cli.core.paths_overlap | ( | str | first, |
| str | second | ||
| ) |
Whether two run-relative directories are the same or nested in one another.
| [in] | first | Normalized directory. |
| [in] | second | Normalized directory. |
Definition at line 9764 of file core.py.
| tuple picurv_cli.core.resolve_unsafe_paths_override | ( | dict | dirs, |
| str | monitor_path | ||
| ) |
Resolve the unsafe-paths override, requiring a real YAML boolean.
A truthy string such as "false" must never enable an override that permits a destructive path. Only a genuine boolean true enables it; any other type is a configuration error rather than a silent interpretation.
| [in] | dirs | The io.directories mapping. |
| [in] | monitor_path | Path to the monitor file, for error messages. |
Definition at line 9776 of file core.py.
| tuple picurv_cli.core.evaluate_run_directories | ( | dict | values, |
| bool | override, | ||
| set | explicit = None |
||
| ) |
Apply every run-directory safety rule to a set of effective directory values.
Single source of truth for the rules, shared by configuration validation and submission preflight so the two cannot drift apart. Callers must pass effective values with defaults filled in.
Two classes of finding are distinguished. Waivable findings concern a deliberate external location; allow_unsafe_paths downgrades those to warnings. Non-waivable findings concern self-destruction or a value that cannot be written unambiguously - the run root itself, a reserved run directory, log/output overlap, and malformed characters. The override was granted for deliberate external storage, never for deleting the run's own config or emitting an ambiguous option line, so those stay errors.
| [in] | values | Effective mapping of directory key to configured value. |
| [in] | override | Whether the unsafe-paths override is enabled. |
| [in] | explicit | Keys the user actually configured; the rest are reported as defaults. |
Definition at line 9801 of file core.py.
| list picurv_cli.core.classify_physical_containment | ( | str | run_dir, |
| dict | values | ||
| ) |
Classify where each run-owned directory physically lands.
Lexical containment is not enough: a contained name can be a symlink to an external directory, and PetscRMTree follows symlinks. This resolves the real path - including any symlinked ancestor - and reports a typed verdict so the caller can apply the waiver rule structurally.
| [in] | run_dir | Run directory the values are relative to. |
| [in] | values | Effective directory mapping. |
Definition at line 9948 of file core.py.
| list picurv_cli.core.check_physical_containment | ( | str | run_dir, |
| dict | values | ||
| ) |
Human-readable physical containment violations.
| [in] | run_dir | Run directory the values are relative to. |
| [in] | values | Effective directory mapping. |
Definition at line 10005 of file core.py.
| dict picurv_cli.core.effective_run_directories | ( | dict | configured | ) |
Fill in defaults for run-owned directories that were not configured.
An omitted key is not absent at runtime, it takes its default. Checking only explicit keys would miss log: output, which collides with the default output directory and would delete solver output.
| [in] | configured | Configured directory mapping, possibly partial. |
Definition at line 10015 of file core.py.
| tuple picurv_cli.core.validate_run_directory_containment | ( | dict | monitor_cfg, |
| str | monitor_path | ||
| ) |
Classify legacy directory values as defense-in-depth during validation.
The monitor schema rejects this removed surface. Keeping the stricter classifier here ensures malformed or manually constructed configurations still receive the safety findings that protect recursive log cleanup.
| [in] | monitor_cfg | Parsed monitor YAML dictionary. |
| [in] | monitor_path | Path to the monitor file, for error messages. |
Definition at line 10032 of file core.py.
| list picurv_cli.core.validate_reserved_directory_flags | ( | dict | config, |
| str | config_path, | ||
| str | label | ||
| ) |
Reject raw PETSc passthrough options that set run-owned directories.
Passthrough surfaces emit {flag: value} verbatim into the generated control file. Run-owned path flags are reserved for the fixed workspace topology and may only be emitted by the generator.
| [in] | config | Parsed configuration mapping to scan. |
| [in] | config_path | Path to the file, for error messages. |
| [in] | label | Human-readable description of the surface being scanned. |
Definition at line 10056 of file core.py.
| list picurv_cli.core.physical_units_transition_notices | ( | dict | case_cfg, |
| dict | solver_cfg, | ||
| dict | monitor_cfg | ||
| ) |
Name the inputs whose meaning changed when every input became physical.
These inputs were once read in solver units. At unit reference scales the two readings coincide, so a notice is only needed when the scales differ from one; it says which values are now divided by a reference scale.
| [in] | case_cfg | Parsed case configuration. |
| [in] | solver_cfg | Parsed solver configuration. |
| [in] | monitor_cfg | Parsed monitor configuration. |
Definition at line 10101 of file core.py.
| picurv_cli.core.validate_simulation_configs | ( | dict | case_cfg, |
| dict | solver_cfg, | ||
| dict | monitor_cfg, | ||
| str | case_path, | ||
| str | solver_path, | ||
| str | monitor_path, | ||
| bool | restart_source_given = False |
||
| ) |
Validates every configuration a simulation run consumes, before any work is done.
Covers the three roles the solver is launched with: the case, the solver, and the monitor. Only one of those is a solver configuration, which is why this is not named for the solver; the monitor in particular carries observation and field-statistics contracts that have nothing to do with the numerical scheme.
Checks required sections, required keys, physical sanity, and the cross-file combinations no single file can rule out. Post-processing configuration is validated separately by validate_post_config().
| [in] | case_cfg | Parsed case YAML dictionary. |
| [in] | solver_cfg | Parsed solver YAML dictionary. |
| [in] | monitor_cfg | Parsed monitor YAML dictionary. |
| [in] | case_path | Path to case file (for error messages). |
| [in] | solver_path | Path to solver file (for error messages). |
| [in] | monitor_path | Path to monitor file (for error messages). |
| [in] | restart_source_given | Whether the invocation names a restart source (–restart-from or –continue), which silences the reminder that the case needs one. |
| SystemExit | on validation failure. |
Definition at line 10149 of file core.py.
| "tuple[list, list]" picurv_cli.core.check_post_checkpoint_cadence_alignment | ( | dict | post_cfg, |
| dict | monitor_cfg, | ||
| str | post_path, | ||
| str | monitor_path = "monitor.yml" |
||
| ) |
Report post step selections that cannot land on a committed checkpoint.
The post-processor reads committed bundles, and the solver commits one every io.data_output_frequency completed steps. A step_interval that is not a multiple of that cadence therefore asks for steps that were never written: those steps wait forever for a checkpoint, and far less than the recipe requested is processed. That is only discovered after a solve has already run, so it is caught here instead.
The solver also commits the initial and final states off cadence, which is why a misaligned start_step is a warning rather than an error: it may legitimately be the run's initial or final step. A bounded selection containing only one checkpoint has no stride to align; its interval must still be positive. Multi-checkpoint selections retain the cadence check.
| [in] | post_cfg | Parsed post-processing configuration. |
| [in] | monitor_cfg | Parsed monitor configuration governing the source run. |
| [in] | post_path | Path to the post file, for error messages. |
| [in] | monitor_path | Path to the monitor file, for error messages. |
(errors, warnings), each a list of message strings. Both are empty when the comparison cannot be made, because the inputs that would make it meaningful are validated and reported elsewhere. Definition at line 11000 of file core.py.
| picurv_cli.core.validate_post_config | ( | dict | post_cfg, |
| str | post_path, | ||
| dict | monitor_cfg = None, |
||
| dict | case_cfg = None |
||
| ) |
Validates the post-processing config before running the post-processor.
| [in] | post_cfg | Parsed post-processing YAML dictionary. |
| [in] | post_path | Path to post file (for error messages). |
| [in] | monitor_cfg | Parsed monitor configuration, when available. Two checks span both files: field statistics, where post.yml names the windows and monitor.yml decides what each accumulates, and step cadence, where monitor.yml decides which steps exist to be read. Both run only when the monitor is known. |
| [in] | case_cfg | Parsed case configuration, when available. Spectra preconditions need the boundary conditions and block count, so they are checked only when the case is known; validating a recipe on its own still checks it on its own terms. |
| SystemExit | on validation failure. |
Definition at line 11071 of file core.py.
| picurv_cli.core.validate_cluster_config | ( | dict | cluster_cfg, |
| str | cluster_path | ||
| ) |
Validate Slurm scheduler configuration from cluster.yml.
| [in] | cluster_cfg | Argument passed to validate_cluster_config(). |
| [in] | cluster_path | Argument passed to validate_cluster_config(). |
Definition at line 11423 of file core.py.
| picurv_cli.core.validate_study_config | ( | dict | study_cfg, |
| str | study_path, | ||
| bool | skip_base_file_check = False |
||
| ) |
Validate sweep/study specification from study.yml.
| [in] | study_cfg | Argument passed to validate_study_config(). |
| [in] | study_path | Argument passed to validate_study_config(). |
| [in] | skip_base_file_check | When True, skip file-existence check for base_configs paths. |
Definition at line 11578 of file core.py.
|
protected |
Set nested dictionary value, creating intermediate maps when needed.
| [in] | container | Argument passed to _deep_set(). |
| [in] | dotted_path | Argument passed to _deep_set(). |
| [in] | value | Argument passed to _deep_set(). |
Definition at line 11718 of file core.py.
| list picurv_cli.core.expand_parameter_matrix | ( | dict | parameters | ) |
Expand study parameter lists into cartesian-product combinations.
| [in] | parameters | Argument passed to expand_parameter_matrix(). |
expand_parameter_matrix(). Definition at line 11733 of file core.py.
| list picurv_cli.core.expand_study_parameter_combinations | ( | dict | study_cfg | ) |
Expand either cartesian-study parameters or explicit parameter sets.
| [in] | study_cfg | Argument passed to expand_study_parameter_combinations(). |
expand_study_parameter_combinations(). Definition at line 11747 of file core.py.
| dict picurv_cli.core.flatten_study_parameters | ( | dict | parameters | ) |
Flatten grouped study overrides into scalar dotted-path columns.
A grouped override such as case.run_control: {dt_physical: ...} materializes correctly in case YAML but is not a useful CSV cell or plot coordinate. Flattening preserves the actual varied variables.
| [in] | parameters | One expanded study parameter combination. |
Definition at line 11759 of file core.py.
| list picurv_cli.core.get_study_parameter_keys | ( | dict | study_cfg | ) |
Collect ordered parameter keys from either cross-product parameter expansions or explicit parameter sets.
| [in] | study_cfg | Argument passed to get_study_parameter_keys(). |
get_study_parameter_keys(). Definition at line 11789 of file core.py.
| int picurv_cli.core.get_cluster_total_tasks | ( | dict | cluster_cfg | ) |
Return cluster total tasks.
| [in] | cluster_cfg | Argument passed to get_cluster_total_tasks(). |
get_cluster_total_tasks(). Definition at line 11821 of file core.py.
| str picurv_cli.core.normalize_extension | ( | str | ext | ) |
Canonicalize a user-supplied filename extension by trimming whitespace and leading dots.
| [in] | ext | Argument passed to normalize_extension(). |
normalize_extension(). Definition at line 11830 of file core.py.
| list picurv_cli.core.resolve_conductor_entry_point | ( | ) |
Resolve how to invoke this conductor again from a batch script.
Prefers the bin/picurv wrapper, which selects the managed Python environment a cluster node needs, and falls back to the running interpreter with the package entry point when that wrapper is absent.
Definition at line 11840 of file core.py.
| list picurv_cli.core.build_spectra_follow_command | ( | str | run_dir, |
| str | post_path, | ||
| dict | post_cfg, | ||
| bool | recompute = False |
||
| ) |
Build the batch-script step that measures spectra after the field stage.
Spectra are a serial pass over committed checkpoints, so the command is returned bare rather than wrapped in the MPI launcher: run under srun with the post stage's task count it would become one identical copy per task, each writing the same files.
| [in] | run_dir | Run directory the batch job operates on. |
| [in] | post_path | Post recipe path, reachable from the compute node. |
| [in] | post_cfg | Effective post configuration. |
| [in] | recompute | Re-measure steps whose spectra are still valid. |
Definition at line 11856 of file core.py.
| "str | None" picurv_cli.core.executable_petsc_library_dir | ( | str | executable_path | ) |
The lib/ directory of the PETSc an executable was built against, from its stamp.
Both PETSc index widths name their library libpetsc.so.MAJOR.MINOR, so the loader takes whichever comes first on LD_LIBRARY_PATH; launching with this directory first gives each executable its own PETSc whatever modules the job loaded.
| [in] | executable_path | Path to simulator, postprocessor or their 64-bit pair. |
Definition at line 11886 of file core.py.
| list picurv_cli.core.petsc_library_path_lines | ( | "str | None" | library_dir | ) |
Shell lines putting one PETSc's lib/ first on LD_LIBRARY_PATH, after module setup.
| [in] | library_dir | From executable_petsc_library_dir(), or None for no change. |
Definition at line 11902 of file core.py.
| list picurv_cli.core.executable_identity_check_lines | ( | str | executable, |
| "str | None" | expected_version_line, | ||
| bool | pinned = False |
||
| ) |
Shell lines that compare an executable's reported identity with the staged one.
A job resolves its executable when it starts, which can be long after it was staged. The installation's bin/ may have been rebuilt in between, and a job that silently runs the new build produces checkpoints that disagree with the run's manifest. The lines run after module setup, because --version still needs the executable's shared libraries, and before the launcher, so a mismatch stops the job before any rank starts. When staging could not read an identity there is nothing to compare, so the reported one is only logged.
| [in] | executable | Executable path, emitted verbatim when it is a shell variable. |
| [in] | expected_version_line | Exact --version output captured at staging, or None. |
| [in] | pinned | Whether the executable is the run's own pinned copy. |
Definition at line 11913 of file core.py.
| picurv_cli.core.render_slurm_script | ( | str | script_path, |
| str | job_name, | ||
| dict | cluster_cfg, | ||
| list | command, | ||
| str | workdir, | ||
| str | stdout_path, | ||
| str | stderr_path = None, |
||
| dict | env_vars = None, |
||
| dict | shell_env_vars = None, |
||
| str | array_spec = None, |
||
| list | follow_commands = None, |
||
| "tuple | None" | identity_check = None |
||
| ) |
Render a Slurm batch script for a single command.
| [in] | script_path | Argument passed to render_slurm_script(). |
| [in] | job_name | Argument passed to render_slurm_script(). |
| [in] | cluster_cfg | Argument passed to render_slurm_script(). |
| [in] | command | Argument passed to render_slurm_script(). |
| [in] | workdir | Argument passed to render_slurm_script(). |
| [in] | stdout_path | Argument passed to render_slurm_script(). |
| [in] | stderr_path | Argument passed to render_slurm_script(). |
| [in] | env_vars | Argument passed to render_slurm_script(). |
| [in] | shell_env_vars | Argument passed to render_slurm_script(). |
| [in] | array_spec | Argument passed to render_slurm_script(). |
| [in] | follow_commands | Commands to run after the launched one, each an argv list. They run in the batch shell rather than under the MPI launcher, so a serial step does not become one copy per task. Supplying any of them drops the exec. |
| [in] | identity_check | (executable, expected --version line, pinned) checked before launch; see executable_identity_check_lines(). |
Definition at line 11957 of file core.py.
| "tuple[str | None, list[str]]" picurv_cli.core.split_launcher_tokens | ( | "str | None" | launcher, |
| "list | None" | launcher_args = None, |
||
| str | label = "launcher" |
||
| ) |
Canonicalize launcher config into executable token plus argv-style flags.
| [in] | launcher | Argument passed to split_launcher_tokens(). |
| [in] | launcher_args | Argument passed to split_launcher_tokens(). |
| [in] | label | Argument passed to split_launcher_tokens(). |
split_launcher_tokens(). Definition at line 12078 of file core.py.
| "tuple[str | None, list[str]]" picurv_cli.core.normalize_cluster_launcher | ( | dict | execution | ) |
Canonicalize cluster launcher config into executable token plus argv-style flags.
| [in] | execution | Argument passed to normalize_cluster_launcher(). |
normalize_cluster_launcher(). Definition at line 12106 of file core.py.
| "list[str]" picurv_cli.core.strip_launcher_size_flags | ( | str | launcher_name, |
| "list[str]" | launcher_args | ||
| ) |
Remove explicit MPI task-count flags from known launchers.
| [in] | launcher_name | Basename-normalized launcher executable. |
| [in] | launcher_args | Launcher argument list. |
Definition at line 12119 of file core.py.
| list picurv_cli.core.build_local_launch_command | ( | str | executable, |
| list | executable_args, | ||
| int | num_procs, | ||
| str | config_search_anchor = None, |
||
| bool | allow_single_rank_launcher_override = False, |
||
| "int | None" | force_num_procs = None |
||
| ) |
Build local launcher command, allowing env or shared config overrides for login-node MPI quirks.
| [in] | executable | Argument passed to build_local_launch_command(). |
| [in] | executable_args | Argument passed to build_local_launch_command(). |
| [in] | num_procs | Argument passed to build_local_launch_command(). |
| [in] | config_search_anchor | Argument passed to build_local_launch_command(). |
| [in] | allow_single_rank_launcher_override | When true, explicit launcher overrides also apply to 1-rank commands. |
| [in] | force_num_procs | Optional explicit MPI rank count override applied after stripping conflicting launcher size flags. |
build_local_launch_command(). Definition at line 12152 of file core.py.
| dict picurv_cli.core.restart_grid_inputs | ( | str | run_dir, |
| dict | case_cfg | ||
| ) |
The inputs a run's geometry is derived from, to compare across a restart.
The solver compares the checkpoint's geometry, which it hashes from the built grid, only after the job has started. These inputs determine that geometry within one build, so a difference is worth saying at staging: a staged inputs/grid/grid.run (file and generated grids, already non-dimensional) by content, otherwise the grid section without its rank layout and the length scale; and the periodic faces of every block.
| [in] | run_dir | Run whose staged grid is read. |
| [in] | case_cfg | That run's case configuration. |
Definition at line 12222 of file core.py.
| picurv_cli.core.warn_on_restart_grid_change | ( | dict | source_inputs, |
| dict | branch_inputs | ||
| ) |
Warn at staging when a restart's grid inputs differ from its source run's.
| [in] | source_inputs | restart_grid_inputs() of the run that wrote the checkpoint. |
| [in] | branch_inputs | restart_grid_inputs() of the staged restart. |
Definition at line 12252 of file core.py.
| picurv_cli.core.check_restart_continuation | ( | str | solver_exe, |
| list | solver_args, | ||
| str | run_dir, | ||
| str | config_search_anchor = None |
||
| ) |
Ask the simulator whether a staged restart's carried statistics windows can continue.
Runs the simulator's restart check on one rank. It parses the run's control file and compares each window with the source checkpoint's manifest exactly as the restart will, but builds no grid, so it costs about a second and runs on a login node whatever the production rank count. Passing it does not replace the full check at solver start, which also compares geometry.
| [in] | solver_exe | Simulator executable the run will launch. |
| [in] | solver_args | Simulator arguments the run will launch with. |
| [in] | run_dir | Staged run directory, the simulator's working directory. |
| [in] | config_search_anchor | Path from which the local launcher configuration is found. |
Definition at line 12268 of file core.py.
| dict picurv_cli.core.resolve_cluster_execution | ( | dict | cluster_cfg, |
| str | config_search_anchor = None, |
||
extra_search_anchors = None |
|||
| ) |
Resolve cluster execution launcher settings from shared runtime config plus cluster.yml overrides.
| [in] | cluster_cfg | Argument passed to resolve_cluster_execution(). |
| [in] | config_search_anchor | Argument passed to resolve_cluster_execution(). |
| [in] | extra_search_anchors | Argument passed to resolve_cluster_execution(). |
resolve_cluster_execution(). Definition at line 12300 of file core.py.
| list picurv_cli.core.build_cluster_launch_command | ( | dict | cluster_cfg, |
| str | executable, | ||
| list | executable_args, | ||
| str | config_search_anchor = None, |
||
extra_search_anchors = None, |
|||
| "int | None" | force_num_procs = None |
||
| ) |
Build scheduler launcher command from cluster config plus optional shared execution defaults.
| [in] | cluster_cfg | Argument passed to build_cluster_launch_command(). |
| [in] | executable | Argument passed to build_cluster_launch_command(). |
| [in] | executable_args | Argument passed to build_cluster_launch_command(). |
| [in] | config_search_anchor | Argument passed to build_cluster_launch_command(). |
| [in] | extra_search_anchors | Argument passed to build_cluster_launch_command(). |
| [in] | force_num_procs | Optional explicit MPI rank count override applied after stripping conflicting launcher size flags. |
build_cluster_launch_command(). Definition at line 12318 of file core.py.
| str picurv_cli.core.parse_slurm_job_id | ( | str | sbatch_output | ) |
Extract numeric job id from standard sbatch output.
| [in] | sbatch_output | Argument passed to parse_slurm_job_id(). |
parse_slurm_job_id(). Definition at line 12385 of file core.py.
| "tuple[str, str | None]" picurv_cli.core.slurm_job_end_state | ( | str | job_id | ) |
Whether a recorded Slurm job (or array) is still queued, and how it ended if not.
Slurm forgets a finished job after its MinJobAge, and a dependency on a job it no longer knows is rejected, so a stage submitted long after the job it waits for must not depend on it. squeue answers for live jobs; sacct for ended ones.
| [in] | job_id | Recorded job id; for an array, the array's id covers every task. |
("active", state), ("completed", "COMPLETED"), ("failed", state), ("unknown", state-or-None) when the job is not queued but sacct cannot say how it ended, or ("unchecked", None) where squeue is unavailable. Definition at line 12401 of file core.py.
| dict picurv_cli.core.submit_sbatch | ( | str | script_path, |
| str | dependency = None, |
||
| str | dependency_type = "afterok" |
||
| ) |
Submit sbatch script and return submission metadata.
| [in] | script_path | Argument passed to submit_sbatch(). |
| [in] | dependency | Argument passed to submit_sbatch(). |
| [in] | dependency_type | Slurm dependency type (default: afterok). Common values: afterok, afterany. |
submit_sbatch(). Definition at line 12438 of file core.py.
|
protected |
Prints validation errors and exits.
| [in] | errors | List of error message strings. |
Definition at line 12471 of file core.py.
| str picurv_cli.core.generate_header | ( | str | run_id, |
| dict | source_files | ||
| ) |
Creates a standard header block for all generated files.
| [in] | run_id | The unique identifier for the current simulation run. |
| [in] | source_files | A dictionary of source profile files used. |
Definition at line 12490 of file core.py.
| str picurv_cli.core.generate_simple_list_file | ( | str | run_dir, |
| str | run_id, | ||
| dict | cfg, | ||
| str | section, | ||
| str | key, | ||
| str | filename, | ||
| dict | header_sources, | ||
| str | config_dir = None |
||
| ) |
Generic function to create a file containing a simple list of strings.
| [in] | run_dir | The path to the main run directory. |
| [in] | run_id | The unique identifier for the run. |
| [in] | cfg | The dictionary containing the configuration data. |
| [in] | section | The top-level key in the cfg dictionary. |
| [in] | key | The second-level key whose value is the list of strings. |
| [in] | filename | The name of the file to generate (e.g., 'whitelist.run'). |
| [in] | header_sources | A dictionary of source files for the header. |
| [in] | config_dir | Optional configuration revision directory. |
Definition at line 12515 of file core.py.
Translate renamed solver functions in a monitor.yml function list.
| [in] | names | Function names as written in monitor.yml. |
| [in] | field_name | YAML path of the list, used in warnings. |
Logging and profiling select functions by exact name, so a stale name silently selects nothing. Renamed functions are mapped to their current names and removed ones dropped, each with a warning.
Definition at line 12544 of file core.py.
| bool picurv_cli.core.has_explicit_monitor_whitelist | ( | dict | monitor_cfg | ) |
Return True when logging.enabled_functions contains at least one entry.
| [in] | monitor_cfg | Argument passed to has_explicit_monitor_whitelist(). |
has_explicit_monitor_whitelist(). Definition at line 12570 of file core.py.
| dict picurv_cli.core.resolve_profiling_config | ( | dict | monitor_cfg | ) |
Resolve profiling reporting config from monitor.yml.
| [in] | monitor_cfg | Argument passed to resolve_profiling_config(). |
resolve_profiling_config(). Definition at line 12585 of file core.py.
|
protected |
Validate PETSc info logging configuration.
| [in] | value | Boolean or structured PETSc info configuration. |
Definition at line 12667 of file core.py.
|
protected |
Validate a diagnostics value that can be false, true, or a path/viewer string.
| [in] | value | Candidate value. |
| [in] | key | Diagnostics key used in error messages. |
Definition at line 12696 of file core.py.
|
protected |
Validate a diagnostics boolean value.
| [in] | value | Candidate value. |
| [in] | key | Diagnostics key used in error messages. |
Definition at line 12710 of file core.py.
|
protected |
Validate a diagnostics value that can be false, true, or "all".
| [in] | value | Candidate value. |
| [in] | key | Diagnostics key used in error messages. |
Definition at line 12722 of file core.py.
|
protected |
Return an absolute run-local diagnostics file path.
| [in] | run_dir | Run directory. |
| [in] | filename | Diagnostics filename. |
Definition at line 12736 of file core.py.
|
protected |
Resolve true/string diagnostics values to a concrete file path.
| [in] | value | Boolean/string diagnostics value. |
| [in] | run_dir | Run directory. |
| [in] | default_filename | Default file name when value is true. |
Definition at line 12746 of file core.py.
| dict picurv_cli.core.resolve_diagnostics_config | ( | dict | monitor_cfg, |
| "str | None" | run_dir = None, |
||
| str | stage_label = "Solver" |
||
| ) |
Resolve monitor diagnostics config and default run-local log paths.
| [in] | monitor_cfg | Parsed monitor.yml mapping. |
| [in] | run_dir | Optional run directory for default artifact paths. |
| [in] | stage_label | Solver/PostProcessor suffix used for PETSc output defaults. |
Definition at line 12763 of file core.py.
| list picurv_cli.core.build_petsc_diagnostics_args | ( | dict | monitor_cfg, |
| str | run_dir, | ||
| str | stage_label | ||
| ) |
Build PETSc diagnostics command-line arguments for a run stage.
| [in] | monitor_cfg | Parsed monitor.yml mapping. |
| [in] | run_dir | Run directory used to resolve default diagnostics files. |
| [in] | stage_label | Stage label for default output names. |
Definition at line 12852 of file core.py.
|
protected |
Report whether the subsystem a statistics field depends on is active.
| [in] | case_cfg | Parsed case configuration. |
| [in] | requirement | Subsystem key from STATISTICS_ELIGIBLE_FIELDS, or None. |
_statistics_subsystem_available(). Definition at line 12897 of file core.py.
| dict picurv_cli.core.normalize_field_statistics_config | ( | dict | monitor_cfg, |
| dict | case_cfg = None |
||
| ) |
Validate and canonicalize the field-statistics block of monitor.yml.
Rejects every condition the field-statistics contract forbids, naming the offending window so a message points at one entry rather than the block. Returns a canonical form the flag resolver serializes without further interpretation, so validation and emission cannot disagree.
| [in] | monitor_cfg | Parsed monitor configuration. |
| [in] | case_cfg | Parsed case configuration, used to check that each field's subsystem is active. Subsystem checks are skipped when None. |
normalize_field_statistics_config(). Definition at line 12922 of file core.py.
|
protected |
Validate and canonicalize the fields and covariances one window or ensemble requests.
| [in] | label | Owner named in error messages, such as ‘field statistics window 'w’`. |
| [in] | fields_raw | The requested fields list of the owner. |
| [in] | covariances_raw | The requested covariance pairs of the owner, or None. |
| [in] | eligible | Fields the owner may name, with component counts and requirements. |
| [in] | case_cfg | Parsed case configuration for subsystem checks, or None to skip them. |
Definition at line 13029 of file core.py.
| list picurv_cli.core.resolve_field_statistics_flags | ( | dict | monitor_cfg, |
| dict | case_cfg = None |
||
| ) |
Serialize field-statistics configuration into control-file option lines.
A window list is variable arity, so its option names are constructed from the index. Each name belongs to a family declared in the ingress audit manifest.
| [in] | monitor_cfg | Parsed monitor configuration. |
| [in] | case_cfg | Parsed case configuration, for subsystem availability checks. |
resolve_field_statistics_flags(). Definition at line 13123 of file core.py.
| "int | None" picurv_cli.core.resolve_statistics_console_output_frequency | ( | dict | io_cfg | ) |
Resolve the statistics console cadence, mirroring the particle one.
| [in] | io_cfg | Parsed monitor io block. |
resolve_statistics_console_output_frequency(). Definition at line 13176 of file core.py.
| dict picurv_cli.core.normalize_solution_monitoring_config | ( | dict | monitor_cfg | ) |
Validate and canonicalize physical-solution convergence monitoring.
| [in] | monitor_cfg | Parsed monitor.yml mapping. |
| ValueError | when convergence settings are invalid. |
Definition at line 13187 of file core.py.
| dict picurv_cli.core.resolve_solution_monitoring_flags | ( | dict | monitor_cfg | ) |
Translate solution-monitoring YAML into the existing C convergence flags.
| [in] | monitor_cfg | Parsed monitor.yml mapping. |
Definition at line 13242 of file core.py.
| dict picurv_cli.core.prepare_monitor_files | ( | str | run_dir, |
| str | run_id, | ||
| dict | monitor_cfg, | ||
| dict | source_files, | ||
| str | config_dir = None |
||
| ) |
Generate monitor sidecar files and resolve profiling reporting behavior.
| [in] | run_dir | Argument passed to prepare_monitor_files(). |
| [in] | run_id | Argument passed to prepare_monitor_files(). |
| [in] | monitor_cfg | Argument passed to prepare_monitor_files(). |
| [in] | source_files | Argument passed to prepare_monitor_files(). |
| [in] | config_dir | Optional configuration revision directory. |
prepare_monitor_files(). Definition at line 13260 of file core.py.
| list picurv_cli.core.generate_multi_block_bcs | ( | str | run_dir, |
| str | run_id, | ||
| dict | case_cfg, | ||
| dict | source_files, | ||
| str | config_dir = None |
||
| ) |
Parses multi-block BCs from YAML, generates a .run file for each block, and returns a list of their absolute paths.
Handles both simple list format (for single-block cases) and a list-of-lists (for multi-block cases) for boundary conditions.
| [in] | run_dir | The path to the main run directory. |
| [in] | run_id | The unique identifier for the run. |
| [in] | case_cfg | The parsed case.yml configuration dictionary. |
| [in] | source_files | A dictionary of source files for the header. |
| [in] | config_dir | Optional configuration revision directory. |
| ValueError | if the number of BC definitions does not match the number of blocks. |
Definition at line 13307 of file core.py.
| picurv_cli.core.format_flag_value | ( | value | ) |
Converts Python types to C-style command-line flag values.
| [in] | value | The Python object to convert (bool, list, or other). |
Definition at line 13458 of file core.py.
| dict picurv_cli.core.translate_programmatic_grid_settings | ( | dict | grid_settings | ) |
Return programmatic-grid settings translated to the C node-count contract.
| [in] | grid_settings | Argument passed to translate_programmatic_grid_settings(). |
translate_programmatic_grid_settings(). Definition at line 13470 of file core.py.
| None picurv_cli.core.validate_programmatic_bridge_grid_settings | ( | dict | raw_settings | ) |
Validate the scalar programmatic grid settings the bridge PICGRID is built from.
A Python generator - an initial condition or a generated inlet profile - runs as a separate process and reads the programmatic grid from that bridge, which supports one block with scalar settings.
| [in] | raw_settings | programmatic_settings dict from case.yml. |
| ValueError | when required scalar settings are missing or invalid. |
Definition at line 13496 of file core.py.
| dict picurv_cli.core.generate_picgrid_from_programmatic_settings | ( | dict | raw_settings, |
| str | dest_path, | ||
| float | L_ref | ||
| ) |
Generate a canonical PICGRID file from programmatic Cartesian grid settings.
Implements the same coordinate formula as ComputeStretchedCoord in src/grid.c. im/jm/km in raw_settings are cell counts; node counts are im+1, jm+1, km+1.
| [in] | raw_settings | programmatic_settings dict from case.yml. |
| [in] | dest_path | Destination PICGRID file path. |
| [in] | L_ref | Reference length for nondimensionalization (must be non-zero). |
Definition at line 13551 of file core.py.
| dict picurv_cli.core.resolve_grid_da_processor_layout | ( | dict | grid_cfg | ) |
Resolve optional global DMDA layout, preferring grid-level keys over legacy nested keys.
| [in] | grid_cfg | Argument passed to resolve_grid_da_processor_layout(). |
resolve_grid_da_processor_layout(). Definition at line 13618 of file core.py.
| "list | None" picurv_cli.core.resolve_grid_node_dims | ( | dict | case_cfg, |
| str | case_path, | ||
| "str | None" | staged_grid = None |
||
| ) |
Per-block (IM, JM, KM) node counts the solver will read, without building the grid.
A staged PICGRID, when one exists, is authoritative. Otherwise a file grid's header is read, a programmatic grid's cell counts are converted to nodes, and a grid_gen grid's cell counts are resolved by grid.gen's own parameter precedence without generating any coordinates.
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Path to case.yml, for case-relative paths. |
| [in] | staged_grid | Already staged inputs/grid/grid.run, if any. |
Definition at line 13672 of file core.py.
| bool picurv_cli.core.case_declares_periodic_axis | ( | dict | case_cfg | ) |
Whether any face of any block is PERIODIC, which sets the DMDA stencil width.
| [in] | case_cfg | Parsed case configuration. |
Definition at line 13716 of file core.py.
| list picurv_cli.core.da_processor_layout_problems | ( | dict | grid_cfg, |
| "int | None" | num_procs, | ||
| "list | None" | block_dims = None, |
||
| "dict | None" | solver_cfg = None, |
||
| bool | any_periodic = False, |
||
| "str | None" | source = None |
||
| ) |
Problems with a user-set DMDA layout that would abort grid setup.
Mirrors InitializeAllGridDMs() in src/grid.c: each coarser level holds (IM + 1) / 2 nodes on an axis that is not semi-coarsened, the DMDA carries IM + 1 points, and PETSc's default split gives the smallest rank points // ranks of them. Grid setup requires that to reach the stencil width, which is 3 on every axis when any face is periodic and 2 otherwise. Only the coarsest level can fail, because every finer level is aligned to twice its widths.
| [in] | grid_cfg | The case's grid block. |
| [in] | num_procs | MPI processes the solve will launch, or None when unknown (validate without a cluster profile), which skips only the product check. |
| [in] | block_dims | Per-block node counts, or None to skip the multigrid check. |
| [in] | solver_cfg | Parsed solver.yml, for the multigrid levels and semi-coarsening. |
| [in] | any_periodic | Whether any face is PERIODIC. |
| [in] | source | Where the layout was given, as --ni/--nj/--nk or cluster.yml execution.decomposition; None for case.yml's own keys. |
Definition at line 13729 of file core.py.
| None picurv_cli.core.normalize_decomposition_args | ( | args | ) |
Resolve -n and the optional --ni/--nj/--nk of picurv run into one rank count.
The three counts go together. Given them, -n defaults to their product and must equal it when also given; without them, -n defaults to 1. Sets args.num_procs and args.decomposition (a tuple or None).
| [in,out] | args | Parsed picurv run arguments. |
Definition at line 13807 of file core.py.
|
protected |
Express an (ni, nj, nk) tuple as the da_processors mapping the layout checks read.
| [in] | layout | Rank counts along i, j, k. |
Definition at line 13833 of file core.py.
| picurv_cli.core.choose_decomposition | ( | int | num_procs, |
| list | block_dims, | ||
| "dict | None" | solver_cfg, | ||
| bool | any_periodic | ||
| ) |
Choose the MPI decomposition of a structured grid for a rank count.
Every ordered (ni, nj, nk) with product num_procs that grid setup accepts at the multigrid levels in use (da_processor_layout_problems) is a candidate. The one cutting the least grid area between ranks wins, so a thin axis, such as the i axis of a 2D case, is not split while another can be; ties go to the most even split, then to more ranks on k, then on j.
| [in] | num_procs | MPI ranks. |
| [in] | block_dims | Per-block node counts. |
| [in] | solver_cfg | Parsed solver.yml, for the multigrid levels and semi-coarsening. |
| [in] | any_periodic | Whether any face is PERIODIC, which sets the stencil width. |
Definition at line 13842 of file core.py.
| dict picurv_cli.core.resolve_decomposition | ( | int | num_procs, |
| dict | grid_cfg, | ||
| "list | None" | block_dims, | ||
| "dict | None" | solver_cfg, | ||
| bool | any_periodic, | ||
explicit = None, |
|||
| "dict | None" | cluster_cfg = None |
||
| ) |
Resolve the MPI decomposition a stage launches with.
In order of precedence: --ni/--nj/--nk, cluster.yml execution.decomposition, the deprecated case.yml grid.da_processors_*, and otherwise choose_decomposition(). A set layout must multiply to the rank count and pass the multigrid check. When the grid's size cannot be known before the run, PETSc chooses.
| [in] | num_procs | MPI ranks of the stage. |
| [in] | grid_cfg | The case's grid block. |
| [in] | block_dims | Per-block node counts, or None when unknown. |
| [in] | solver_cfg | Parsed solver.yml. |
| [in] | any_periodic | Whether any face is PERIODIC. |
| [in] | explicit | (ni, nj, nk) from the command line, or None. |
| [in] | cluster_cfg | Parsed cluster.yml, or None. |
Definition at line 13882 of file core.py.
|
protected |
The JSON-serializable record of a resolved decomposition for run metadata.
| [in] | resolved | Result of resolve_decomposition(), or None. |
Definition at line 13943 of file core.py.
| str picurv_cli.core.describe_decomposition | ( | dict | resolved, |
| int | num_procs | ||
| ) |
One line stating the decomposition a stage launches with.
| [in] | resolved | Result of resolve_decomposition(). |
| [in] | num_procs | MPI ranks of the stage. |
Definition at line 13955 of file core.py.
| dict picurv_cli.core.append_grid_da_processor_layout | ( | list | control_lines, |
| dict | grid_cfg, | ||
| int | num_procs, | ||
| "list | None" | block_dims = None, |
||
| "dict | None" | solver_cfg = None, |
||
| bool | any_periodic = False, |
||
explicit = None, |
|||
| "dict | None" | cluster_cfg = None |
||
| ) |
Resolve the solver's MPI decomposition, report it, and append its flags.
| [in] | control_lines | Control-file lines to extend. |
| [in] | grid_cfg | The case's grid block. |
| [in] | num_procs | MPI ranks of the solve. |
| [in] | block_dims | Per-block node counts, for the multigrid check and the choice. |
| [in] | solver_cfg | Parsed solver.yml, for the multigrid levels. |
| [in] | any_periodic | Whether any face is PERIODIC. |
| [in] | explicit | (ni, nj, nk) from the command line, or None. |
| [in] | cluster_cfg | Parsed cluster.yml, or None. |
| ValueError | when the decomposition would abort grid setup or none fits. |
Definition at line 13970 of file core.py.
| str picurv_cli.core.normalize_momentum_solver_type | ( | str | value | ) |
Maps canonical user-facing momentum solver names to C-enum CLI values.
| [in] | value | Canonical momentum solver string from YAML. |
| ValueError | if the input cannot be mapped. |
Definition at line 14000 of file core.py.
| dict picurv_cli.core.validate_newton_krylov_config | ( | dict | cfg | ) |
Validate and normalize the structured Newton–Krylov solver block.
| [in] | cfg | Structured momentum_solver.newton_krylov mapping. |
Definition at line 14026 of file core.py.
| str picurv_cli.core.normalize_solution_convergence_mode | ( | str | value | ) |
Normalizes the solution-convergence mode selector to the C-side canonical string.
| [in] | value | Human-readable solution-convergence mode selector. |
-solution_convergence_mode. | ValueError | if the input cannot be mapped. |
Definition at line 14327 of file core.py.
| int picurv_cli.core.normalize_field_init_mode | ( | str | value | ) |
Maps canonical field init mode names to C enum/int codes (-finit).
| [in] | value | Canonical field initialization mode. |
| ValueError | if the input cannot be mapped. |
Definition at line 14352 of file core.py.
| "tuple[str, int]" picurv_cli.core.normalize_initial_condition_field | ( | str | value | ) |
Normalize a file IC field selector to its staged basename and C enum value.
| [in] | value | User-facing Ucat or Ucont selector. |
Definition at line 14374 of file core.py.
| dict picurv_cli.core.resolve_ic_payload_provenance | ( | dict | ic, |
| int | field_code | ||
| ) |
Resolve which scales a file-backed initial condition was written in.
A payload is physical unless it declares otherwise. A field saved by an earlier run is in that run's solver units, so it names the case that wrote it (source_case) or gives its scales directly, the same way a field_slice inlet profile does.
| [in] | ic | Initial-condition YAML mapping. |
| [in] | field_code | C field code: 0 for Ucat, 1 for Ucont. |
source_case, or velocity_scale and length_scale, or empty. | ValueError | on a conflicting, incomplete, or invalid declaration. |
Definition at line 14392 of file core.py.
| float picurv_cli.core.ic_payload_divisor | ( | dict | resolved_ic, |
| str | case_dir | ||
| ) |
Return the factor a file-backed initial condition is divided by when staged.
A physical payload is divided by its dimension's reference scale. A payload in another run's solver units is first returned to physical units by that run's scale, so the two factors combine into one ratio.
| [in] | resolved_ic | Resolved mode: file initial condition. |
| [in] | case_dir | Directory that relative source_case paths resolve against. |
Definition at line 14429 of file core.py.
| bool picurv_cli.core.is_generated_ic_provider | ( | dict | resolved_ic | ) |
Return whether a resolved IC is backed by a registered file generator.
| [in] | resolved_ic | Resolved initial-condition contract. |
Definition at line 14470 of file core.py.
| dict picurv_cli.core.resolve_fluid_scaling | ( | dict | case_cfg | ) |
Resolve the shared physical and nondimensional fluid scaling contract.
| [in] | case_cfg | Parsed case configuration. |
Definition at line 14479 of file core.py.
| picurv_cli.core.load_generator_module | ( | str | script_name, |
| str | module_name | ||
| ) |
Load one of the extensionless scripts under generators/ as a module.
| [in] | script_name | File name under generators/, e.g. ic.gen. |
| [in] | module_name | Name to register the loaded module under. |
Definition at line 14503 of file core.py.
| picurv_cli.core.load_ic_generator_module | ( | ) |
Load generators/ic.gen, which owns the expression language and the IC providers.
Definition at line 14518 of file core.py.
| list picurv_cli.core.normalize_particle_fields | ( | fields_cfg | ) |
Validate models.physics.particles.fields and lower each value to expressions.
A value is a number, an expression, or a mapping with params and either value or background with regions; a field with several components takes a list of values, one per component. Expressions use physical coordinates x y z, domain-normalized xn yn zn, pid, and physical time t, and may draw with uniform()/normal().
| [in] | fields_cfg | The fields mapping. |
{"name", "expressions"} in configuration order. | ValueError | on an unknown field, a wrong component count, or an invalid value. |
Definition at line 14533 of file core.py.
| dict picurv_cli.core.ic_provider_params_to_solver_units | ( | str | generator, |
| dict | params, | ||
| dict | scales | ||
| ) |
Convert a provider's validated physical parameters to solver units.
Providers work on the staged nondimensional grid, so every dimensional parameter recorded in IC_PARAM_QUANTITIES is converted before the provider runs. Nested mappings are addressed by dotted name.
| [in] | generator | Provider identifier. |
| [in] | params | Validated parameter mapping in physical units. |
| [in] | scales | Reference scales, as returned by resolve_reference_scales(). |
Definition at line 14567 of file core.py.
| dict picurv_cli.core.resolve_resampled_velocity_params | ( | dict | params, |
| prepared_blocks, | |||
| dict | scales, | ||
provider_context = None |
|||
| ) |
Validate resampled_velocity parameters and convert them to the provider contract.
The provider brings an external triply periodic velocity field onto the case's grid. Its box must be the case's box; the source's container, layout, and sample positions are declared because no standard format records them all.
| [in] | params | Raw provider parameters, physical units. |
| [in] | prepared_blocks | Normalized boundary-condition blocks. |
| [in] | scales | Reference scales. |
| [in] | provider_context | Optional conductor-derived provider context. |
source_file stays as written and is resolved against the workspace when the provider runs. Definition at line 14592 of file core.py.
| picurv_cli.core.normalize_ic_initial_spectra | ( | requested, | |
| excluded_axes, | |||
| generator, | |||
| required | |||
| ) |
Validate the spectra a structured IC provider measures on its own output.
| [in] | requested | params.initial_spectra as written, or None. |
| [in] | excluded_axes | Axes the spectra must not transform (walls, cross-stream). |
| [in] | generator | Provider identifier, for messages. |
| [in] | required | Whether a nonempty list is mandatory. |
| ValueError | on an absent required list or an unsupported task. |
Definition at line 14718 of file core.py.
| dict picurv_cli.core.resolve_initial_condition_config | ( | dict | ic, |
| prepared_blocks, | |||
| dict | scales, | ||
provider_context = None |
|||
| ) |
Resolve legacy and structured initial-condition YAML into one launcher contract.
Every value the user writes is physical; the resolved contract carries solver units, or the scales a provider or the staging step needs to reach them.
| [in] | ic | Initial-condition YAML mapping. |
| [in] | prepared_blocks | Normalized boundary-condition blocks. |
| [in] | scales | Reference scales, as returned by resolve_reference_scales(). |
| [in] | provider_context | Optional conductor-derived provider context. |
Definition at line 14742 of file core.py.
| int picurv_cli.core.runtime_petsc_index_bytes | ( | ) |
Bytes of a PetscInt in the PETSc the solver this conductor drives was built on.
PETSc binary files store their sizes as PetscInt and do not record the width, so a file staged for the solver must use the solver's (PETSc's own PetscBinaryIO reads it from the build configuration the same way). An unbuilt or unstamped solver counts as 32-bit, PETSc's default.
Definition at line 14975 of file core.py.
| "int | None" picurv_cli.core.requested_petsc_index_bytes | ( | args = None | ) |
The index width a command was told to use: --petsc-index-bits, else PICURV_PETSC_INDEX_BITS.
| [in] | args | Parsed command arguments, or None. |
Definition at line 15001 of file core.py.
| "tuple[int, str]" picurv_cli.core.required_petsc_index_bytes | ( | dict | case_cfg, |
| str | case_path, | ||
| "dict | None" | monitor_cfg, | ||
| "str | None" | staged_grid = None |
||
| ) |
The PetscInt width a new run needs, from its particle count and grid size.
One PETSc object of more than PETSC_MAX_INT_32BIT entries needs 64-bit indices: a particle field (particles x 3) or a grid field (DA nodes x 3, or x 6 with field statistics). The solver checks the same limits when it creates them, so an underestimate here is refused at setup rather than run.
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Path to case.yml. |
| [in] | monitor_cfg | Parsed monitor configuration, for field statistics. |
| [in] | staged_grid | Staged PICGRID, if any. |
Definition at line 15016 of file core.py.
| "int | None" picurv_cli.core.checkpoint_source_petsc_index_bytes | ( | str | source_dir | ) |
PetscInt width the committed checkpoints under a run output root were written with.
Every checkpoint of a run shares its build's width; one written before the width was recorded is 32-bit.
| [in] | source_dir | Run output root holding checkpoints/. |
Definition at line 15043 of file core.py.
| int picurv_cli.core.select_petsc_index_bytes | ( | int | index_bytes, |
| str | reason | ||
| ) |
Make the current command drive the build of one PetscInt width.
resolve_runtime_executable() and runtime_petsc_index_bytes() follow it, so the executables staged, pinned and launched, and every PETSc file the conductor writes or validates for them, agree. Refuses a width whose executables are not built.
| [in] | index_bytes | 4 or 8. |
| [in] | reason | Why, for the message. |
Definition at line 15059 of file core.py.
| int picurv_cli.core.select_run_petsc_index_bytes | ( | args, | |
| dict | case_cfg, | ||
| str | case_path, | ||
| "dict | None" | monitor_cfg, | ||
| "str | None" | restart_source_dir = None |
||
| ) |
Choose and select the PetscInt width a run's solve stage needs.
A restart or continuation keeps the width its source checkpoint was written with; a new run uses 32-bit unless a particle or grid field outgrows it. An explicit --petsc-index-bits or PICURV_PETSC_INDEX_BITS wins, except against a checkpoint.
| [in] | args | Parsed command arguments. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Path to case.yml. |
| [in] | monitor_cfg | Parsed monitor configuration. |
| [in] | restart_source_dir | Restart source output root, if any. |
Definition at line 15084 of file core.py.
| int picurv_cli.core.select_existing_run_petsc_index_bytes | ( | str | run_dir, |
args = None |
|||
| ) |
Select the PetscInt width an existing run was staged with, for its later stages.
The width staging recorded in config/active.json, else its checkpoints' width, else 32-bit. A conflicting explicit request is refused.
| [in] | run_dir | Run directory. |
| [in] | args | Parsed command arguments, or None. |
Definition at line 15115 of file core.py.
| None picurv_cli.core.record_run_petsc_index_bytes | ( | str | run_dir | ) |
Record in config/active.json the PetscInt width the current command selected.
| [in] | run_dir | Run directory. |
Definition at line 15136 of file core.py.
| int picurv_cli.core.payload_petsc_index_bytes | ( | str | path | ) |
PetscInt width of a PETSc payload: as its checkpoint recorded it, else the driven solver's.
A committed checkpoint's checkpoint.meta records the width it was written with (-checkpoint_petsc_index_bytes; absent in checkpoints written before it existed, which are 32-bit). A payload outside any checkpoint is read as the driven solver would read it.
| [in] | path | Payload path. |
Definition at line 15149 of file core.py.
| list picurv_cli.core.petsc_index_arguments | ( | int | index_bytes | ) |
Generator arguments naming a PetscInt width; none for PETSc's default 32-bit.
Kept empty at 4 bytes so a user's replacement generator script that predates the option keeps working for every 32-bit build.
| [in] | index_bytes | 4 or 8. |
Definition at line 15168 of file core.py.
| dict picurv_cli.core.validate_petsc_vec_binary | ( | str | path, |
| "int | None" | index_bytes = None |
||
| ) |
Validate the basic PETSc binary VecView envelope used by ReadFieldData.
| [in] | path | PETSc binary vector path. |
| [in] | index_bytes | PetscInt width of the reading build; the driven solver's when None. |
Definition at line 15179 of file core.py.
| dict picurv_cli.core.write_scaled_petsc_vec_binary | ( | str | source, |
| str | destination, | ||
| float | divisor | ||
| ) |
Copy a PETSc binary Vec, dividing every scalar by one factor.
Used to stage a physical payload in solver units. The envelope is the one validate_petsc_vec_binary() accepts: a big-endian class id and count of the solver's index width, followed by big-endian doubles.
| [in] | source | Validated PETSc binary vector path. |
| [in] | destination | Path to write the scaled vector to. |
| [in] | divisor | Reference scale the payload is divided by. |
validate_petsc_vec_binary() reports it. Definition at line 15202 of file core.py.
| picurv_cli.core.initial_condition_diagnostic_paths | ( | run_dir, | |
| resolved_ic | |||
| ) |
Resolve spectral IC artifacts through the canonical run layout, also for dry runs.
| [in] | run_dir | Run or asset-build root. |
| [in] | resolved_ic | Normalized file-backed IC provider. |
Definition at line 15230 of file core.py.
| str picurv_cli.core.run_initial_spectrum_generator | ( | str | field_path, |
| str | staged_grid, | ||
| str | spectrum_path, | ||
| str | case_dir, | ||
task_cfg = None |
|||
| ) |
Measure the shell-averaged spectrum of a staged initial condition.
The spectrum has a single implementation in generators/spectra.gen, so the conductor measures the generated field rather than asking the initial-condition generator to report a spectrum it would have to bin itself.
| [in] | field_path | Generated PETSc binary Ucat path. |
| [in] | staged_grid | Staged canonical PICGRID path. |
| [in] | spectrum_path | Destination k,energy CSV path. |
| [in] | case_dir | Working directory for the subprocess. |
| [in] | task_cfg | Optional normalized plane/line task; None retains DIT shell measurement. |
| ValueError | when the generator is missing or fails. |
Definition at line 15248 of file core.py.
| str picurv_cli.core.run_initial_condition_generator | ( | str | case_path, |
| str | run_dir, | ||
| dict | resolved_ic | ||
| ) |
Run the repository IC generator.
| [in] | case_path | Source case YAML path. |
| [in] | run_dir | Run or precompute output directory. |
| [in] | resolved_ic | Normalized external-generator contract. |
Definition at line 15284 of file core.py.
|
protected |
Refuse a mode: file payload sized for another grid, and say what imports one.
mode: file reads its vector verbatim, so it must already be laid out for this grid: one value per component per cell including one dummy layer. The runtime would refuse a mismatch at startup; staging refuses it first and names resampled_velocity, which brings a field from another grid onto this one. Programmatic grids are not staged here, so they keep the runtime check.
| [in] | payload | Header summary from validate_petsc_vec_binary(). |
| [in] | staged_grid | Staged PICGRID path, if the grid is file-backed. |
| [in] | resolved_ic | Normalized file-backed IC contract. |
Definition at line 15367 of file core.py.
| dict picurv_cli.core.stage_initial_condition_file | ( | str | run_dir, |
| str | case_path, | ||
| dict | resolved_ic | ||
| ) |
Materialize and stage one file-backed IC in ReadFieldData's expected layout.
| [in] | run_dir | Run or precompute output directory. |
| [in] | case_path | Source case YAML path. |
| [in] | resolved_ic | Normalized file-backed IC contract. |
Definition at line 15395 of file core.py.
| int picurv_cli.core.normalize_flow_direction_token | ( | str | value | ) |
Maps a face-token flow direction string to the C FlowDirection enum integer.
| [in] | value | One of '+Xi', '-Xi', '+Eta', '-Eta', '+Zeta', '-Zeta'. |
| ValueError | on unknown value. |
Definition at line 15439 of file core.py.
|
protected |
Return True if any prepared BC block contains an INLET face.
| [in] | prepared_blocks | List of prepared BC lists (one per domain block). |
Definition at line 15458 of file core.py.
| dict picurv_cli.core.resolve_ic_cli_params | ( | dict | ic, |
| int | finit_code, | ||
| prepared_blocks, | |||
| dict | scales | ||
| ) |
Resolve all IC parameters and return a dict of PETSc option values.
| [in] | ic | The properties.initial_conditions mapping. |
| [in] | finit_code | Normalized -finit integer code. |
| [in] | prepared_blocks | Normalized BC blocks (may be None). |
| [in] | scales | Reference scales, as returned by resolve_reference_scales(). |
| KeyError | if a required key is absent. |
| ValueError | on invalid combinations or values. |
Definition at line 15472 of file core.py.
| str picurv_cli.core.normalize_eulerian_field_source | ( | str | value | ) |
Normalizes the Eulerian field source selector to the C-side canonical string.
| [in] | value | Human-readable or enum-like Eulerian field source. |
-euler_field_source. | ValueError | if the input cannot be mapped. |
Definition at line 15575 of file core.py.
| bool picurv_cli.core.initial_condition_is_authoritative | ( | dict | case_cfg, |
| dict | solver_cfg | ||
| ) |
Whether the configured initial condition is the field the solver starts from.
A restart (start_step > 0) starts from saved state, and the load and analytical Eulerian sources supply their own field, so in each of those the configured initial condition is never read.
| [in] | case_cfg | Parsed case configuration. |
| [in] | solver_cfg | Parsed solver configuration. |
Definition at line 15600 of file core.py.
| tuple picurv_cli.core.unused_asset_kinds | ( | dict | case_cfg, |
| dict | solver_cfg | ||
| ) |
Asset kinds a run with these configurations would build but never read.
| [in] | case_cfg | Parsed case configuration. |
| [in] | solver_cfg | Parsed solver configuration. |
Definition at line 15617 of file core.py.
| str picurv_cli.core.normalize_analytical_type | ( | str | value | ) |
Normalizes the analytical solution selector to the C-side canonical string.
| [in] | value | Human-readable analytical solution selector. |
-analytical_type. | ValueError | if the input cannot be mapped. |
Definition at line 15627 of file core.py.
| "tuple[float, float, float]" picurv_cli.core.parse_initial_velocity_components | ( | dict | initial_conditions, |
| int | finit_code, | ||
| *bool | require_explicit | ||
| ) |
Parse initial-condition velocity components with mode-aware defaults.
| [in] | initial_conditions | The properties.initial_conditions mapping from case.yml. |
| [in] | finit_code | Normalized -finit integer code. |
| [in] | require_explicit | If True, all three component keys must be present. |
(u, v, w) in physical units. | KeyError | if a required component key is missing. |
| ValueError | if a component cannot be converted to float. |
Definition at line 15646 of file core.py.
| "str | None" picurv_cli.core.infer_unique_inlet_axis_from_prepared_bcs | ( | list | prepared_blocks | ) |
Infer the unique inlet axis across all blocks using C-side "primary inlet" ordering.
| [in] | prepared_blocks | Normalized BC blocks from validate_and_prepare_boundary_conditions. |
"x", "y", "z" if unique, None if no inlet exists. | ValueError | if different blocks imply different inlet axes. |
Definition at line 15673 of file core.py.
| int picurv_cli.core.normalize_particle_init_mode | ( | str | value | ) |
Maps canonical particle init mode names to C enum/int codes (-pinit).
| [in] | value | Canonical particle initialization mode. |
| ValueError | if the input cannot be mapped. |
Definition at line 15705 of file core.py.
| int picurv_cli.core.normalize_interpolation_method | ( | str | value | ) |
Maps interpolation method names to C enum/int codes (-interpolation_method).
| [in] | value | Canonical interpolation method name. |
| ValueError | if the input cannot be mapped. |
Definition at line 15735 of file core.py.
| int picurv_cli.core.normalize_les_model | ( | value | ) |
Maps LES model selectors to C enum/int codes (-les).
| [in] | value | LES selector name or legacy integer/bool value. |
| ValueError | if the input cannot be mapped. |
Definition at line 15777 of file core.py.
| int picurv_cli.core.normalize_les_test_filter | ( | value | ) |
Maps LES test-filter kernel names to the C -les_test_filter_kernel flag.
| [in] | value | Test-filter selector name or integer code. |
| ValueError | if the input cannot be mapped. |
Definition at line 15814 of file core.py.
| int picurv_cli.core.normalize_les_filter_width | ( | value | ) |
Maps LES grid-filter-width model names to the C -les_filter_width flag.
| [in] | value | Filter-width model name or integer code. |
| ValueError | if the input cannot be mapped. |
Definition at line 15843 of file core.py.
| int picurv_cli.core.normalize_les_averaging_mode | ( | value | ) |
Maps LES coefficient-averaging mode names to the C -les_averaging_mode flag.
| [in] | value | Averaging mode name or integer code. |
| ValueError | if the input cannot be mapped. |
Definition at line 15874 of file core.py.
| int picurv_cli.core.normalize_les_clip_mode | ( | value | ) |
Maps LES coefficient-limiting mode names to the C -les_clip_mode flag.
| [in] | value | Clipping mode name or integer code. |
| ValueError | if the input cannot be mapped. |
Definition at line 15904 of file core.py.
| str picurv_cli.core.normalize_les_averaging_directions | ( | value | ) |
Maps a list of homogeneous logical directions to the C flag's string form.
| [in] | value | List or string naming a subset of the i, j, and k directions. |
| ValueError | if a direction is unknown or repeated. |
Definition at line 15937 of file core.py.
| int picurv_cli.core.normalize_wall_function_model | ( | value | ) |
Maps wall-function model selectors to the C -wallfunction flag.
| [in] | value | Wall-function selector name, or None for the default. |
| ValueError | if the input cannot be mapped. |
Definition at line 15968 of file core.py.
| bool picurv_cli.core.resolve_enabled_flag | ( | dict | cfg, |
| str | path, | ||
| bool | default = True |
||
| ) |
Resolves a structured enabled flag and rejects non-boolean values.
| [in] | cfg | Mapping that may contain enabled. |
| [in] | path | Human-readable config path for diagnostics. |
| [in] | default | Value used when enabled is omitted. |
| ValueError | if enabled is not a YAML boolean. |
Definition at line 15996 of file core.py.
| picurv_cli.core.append_les_parameter_flags | ( | dict | les_cfg, |
| list | control_lines | ||
| ) |
Appends the LES closure parameter flags from a structured les block.
| [in] | les_cfg | Parsed models.physics.turbulence.les mapping. |
| [out] | control_lines | A list of strings to which C-flags will be appended. |
| ValueError | if a selector name or nested block shape is unsupported. |
Definition at line 16011 of file core.py.
| "dict | None" picurv_cli.core.resolve_les_diagnostics | ( | dict | case_cfg, |
| dict | monitor_cfg, | ||
| bool | warn = False |
||
| ) |
Resolve the LES diagnostic log settings from monitor.yml or their deprecated location.
The log is observation, not physics, so it is configured in monitor.yml diagnostics.les; case.yml models.physics.turbulence.les.diagnostics is read as a deprecated alias. Setting both is refused. yoshizawa_ci only scales the subgrid kinetic energy the log reports, so it belongs with the log.
| [in] | case_cfg | Parsed case configuration. |
| [in] | monitor_cfg | Parsed monitor configuration. |
| [in] | warn | Print a deprecation warning when the case.yml location is used. |
| ValueError | for a duplicated, malformed, or out-of-range setting. |
Definition at line 16074 of file core.py.
| picurv_cli.core.append_les_diagnostics_flags | ( | "dict | None" | diagnostics, |
| list | control_lines | ||
| ) |
Append the LES diagnostic log flags resolved by resolve_les_diagnostics().
| [in] | diagnostics | Resolved settings, or None to append nothing. |
| [out] | control_lines | A list of strings to which C-flags will be appended. |
Definition at line 16122 of file core.py.
| picurv_cli.core.append_turbulence_flags | ( | dict | models, |
| list | control_lines, | ||
| dict | scales = None |
||
| ) |
Appends turbulence model flags from legacy or structured case.yml blocks.
| [in] | models | Parsed case.yml models mapping. |
| [out] | control_lines | A list of strings to which C-flags will be appended. |
| [in] | scales | The case's reference scales. Required only when a physical roughness height is set. |
| RuntimeError | when a roughness height is set and no scales were supplied. |
Definition at line 16136 of file core.py.
| picurv_cli.core.control_value | ( | value, | |
| str | context | ||
| ) |
Guard a value that is written verbatim into the generated control file.
PETSc reads the control file line by line, so a value containing a newline writes additional option lines - which defeats every key-based check by smuggling a whole new flag. Rejecting the value is the only safe handling; there is no quoting that makes a multi-line option meaningful.
| [in] | value | Configured value destined for a control line. |
| [in] | context | YAML path, for the error message. |
| SystemExit | when the value would inject an option line. |
Definition at line 16185 of file core.py.
| picurv_cli.core.append_passthrough_flags | ( | list | control_lines, |
| dict | options | ||
| ) |
Appends raw CLI flags to the control list from a {flag: value} dict.
Boolean true is emitted as a switch with no value. Boolean false is skipped. All other values are emitted as "<flag> <value>".
| [out] | control_lines | The destination list of control-file lines. |
| [in] | options | Mapping of raw CLI flags to values. |
Definition at line 16210 of file core.py.
| dict picurv_cli.core.resolve_solver_monitoring_flags | ( | dict | monitor_cfg | ) |
Resolve human-readable solver monitoring YAML to raw control flags.
| [in] | monitor_cfg | Parsed monitor.yml mapping. |
Definition at line 16253 of file core.py.
| list picurv_cli.core.resolve_traced_particle_ids | ( | dict | monitor_cfg | ) |
Return the sorted, distinct particle IDs of logging.trace_particles.
| [in] | monitor_cfg | Parsed monitor configuration. |
| ValueError | When the value is not a list of at most 64 non-negative integers. |
Definition at line 16329 of file core.py.
| "int | None" picurv_cli.core.resolve_particle_console_output_frequency | ( | dict | io_cfg | ) |
Return the effective particle-console snapshot cadence from monitor.yml.
| [in] | io_cfg | Argument passed to resolve_particle_console_output_frequency(). |
resolve_particle_console_output_frequency(). Definition at line 16350 of file core.py.
| picurv_cli.core.parse_and_add_model_flags | ( | dict | case_cfg, |
| list | control_lines | ||
| ) |
Parses the 'models' section of case.yml and adds corresponding C-solver flags.
| [in] | case_cfg | The parsed case.yml configuration dictionary. |
| [out] | control_lines | A list of strings to which C-flags will be appended. |
Definition at line 16360 of file core.py.
| dict picurv_cli.core.parse_solver_config | ( | dict | solver_cfg, |
| dict | scales = None, |
||
| dict | case_cfg = None |
||
| ) |
Parses the structured solver.yml into a flat dictionary of {flag: value}.
| [in] | solver_cfg | The parsed solver.yml configuration dictionary. |
| [in] | scales | The case's reference scales. Required only when solver.yml sets a dimensional value, which is physical and is converted here. |
| [in] | case_cfg | The parsed case.yml, which holds the scalar-transport parameters. |
Definition at line 16436 of file core.py.
| picurv_cli.core.generate_solver_control_file | ( | run_dir, | |
| run_id, | |||
| configs, | |||
| num_procs, | |||
| monitor_files, | |||
restart_source_dir = None, |
|||
continue_mode = False, |
|||
| str | config_dir = None |
||
| ) |
Generates the main .control file for the C-solver.
Orchestrates the conversion of all YAML configurations (case, solver, monitor) into a single, machine-readable file of command-line flags.
| [in] | run_dir | Argument passed to generate_solver_control_file(). |
| [in] | run_id | Argument passed to generate_solver_control_file(). |
| [in] | configs | Argument passed to generate_solver_control_file(). |
| [in] | num_procs | Argument passed to generate_solver_control_file(). |
| [in] | monitor_files | Argument passed to generate_solver_control_file(). |
| [in] | restart_source_dir | Argument passed to generate_solver_control_file(). |
| [in] | continue_mode | If True, appends -continue_mode flag for the C solver. |
| [in] | config_dir | Optional configuration revision directory. |
generate_solver_control_file(). Definition at line 16974 of file core.py.
| dict picurv_cli.core.resolve_post_decomposition | ( | str | run_dir, |
| int | num_procs, | ||
explicit = None, |
|||
| "dict | None" | cluster_cfg = None |
||
| ) |
Resolve the postprocessor's MPI decomposition from the run's staged configuration.
The postprocessor builds the same grid hierarchy as the solve, from the run's active case and solver files and its staged grid, so its decomposition is resolved like the solve's, for its own rank count.
| [in] | run_dir | Run directory. |
| [in] | num_procs | MPI ranks of the post-processing stage. |
| [in] | explicit | (ni, nj, nk) from the command line, or None. |
| [in] | cluster_cfg | Parsed cluster.yml, or None. |
Definition at line 17276 of file core.py.
| str picurv_cli.core.generate_post_recipe_file | ( | str | run_dir, |
| str | run_id, | ||
| dict | post_cfg, | ||
| dict | source_files, | ||
monitor_cfg = None, |
|||
| "dict | None" | decomposition = None |
||
| ) |
Generates a key=value config file (post.run) for the C post-processor.
Translates the structured post-processing YAML into the specific flat key-value format required by the C executable, including complex, semicolon-separated pipeline strings.
| [in] | run_dir | The path to the main run directory. |
| [in] | run_id | The unique identifier for the run. |
| [in] | post_cfg | The parsed post-profile YAML configuration dictionary. |
| [in] | source_files | A dictionary of source files for the header. |
| [in] | monitor_cfg | Optional parsed monitor YAML configuration dictionary. |
| [in] | decomposition | The postprocessor's resolved decomposition (resolve_post_decomposition()), or None to let PETSc decide. |
Definition at line 17298 of file core.py.
| picurv_cli.core.execute_command | ( | list | command, |
| str | run_dir, | ||
| str | log_filename, | ||
| dict | monitor_cfg = None |
||
| ) |
Executes a command, streaming its output to the console and a log file.
... If None, the process inherits the parent's environment directly.
| [in] | command | Argument passed to execute_command(). |
| [in] | run_dir | Argument passed to execute_command(). |
| [in] | log_filename | Argument passed to execute_command(). |
| [in] | monitor_cfg | Argument passed to execute_command(). |
Definition at line 17337 of file core.py.
| str picurv_cli.core.format_command_for_display | ( | list | command | ) |
Render a shell-safe command string for console and log output.
| [in] | command | Argument passed to format_command_for_display(). |
format_command_for_display(). Definition at line 17401 of file core.py.
| str picurv_cli.core.resolve_command_log_path | ( | str | run_dir, |
| str | log_filename | ||
| ) |
Resolve a command log filename relative to the run directory.
| [in] | run_dir | Argument passed to resolve_command_log_path(). |
| [in] | log_filename | Argument passed to resolve_command_log_path(). |
resolve_command_log_path(). Definition at line 17410 of file core.py.
|
protected |
Run a command and capture combined stdout/stderr details for later inspection.
| [in] | command | Argument passed to _run_captured_command(). |
| [in] | run_dir | Argument passed to _run_captured_command(). |
_run_captured_command(). Definition at line 17449 of file core.py.
|
protected |
Raise CommandExecutionError when a captured command failed.
| [in] | command | Argument passed to _require_successful_command(). |
| [in] | result | Argument passed to _require_successful_command(). |
Definition at line 17470 of file core.py.
|
protected |
Run a command, require success, and return stripped stdout text.
| [in] | command | Argument passed to _capture_command_stdout(). |
| [in] | run_dir | Argument passed to _capture_command_stdout(). |
_capture_command_stdout(). Definition at line 17482 of file core.py.
|
protected |
Stream command output to stdout and an already-open log file.
| [in] | command | Argument passed to _stream_command_to_console_and_log(). |
| [in] | run_dir | Argument passed to _stream_command_to_console_and_log(). |
| [in] | log_file | Argument passed to _stream_command_to_console_and_log(). |
Definition at line 17494 of file core.py.
|
protected |
Capture the current git HEAD branch name and commit hash.
| [in] | run_dir | Argument passed to _get_git_head_state(). |
_get_git_head_state(). Definition at line 17532 of file core.py.
|
protected |
Return local branch names plus their configured upstreams.
| [in] | run_dir | Argument passed to _get_local_branches_with_upstreams(). |
_get_local_branches_with_upstreams(). Definition at line 17544 of file core.py.
|
protected |
Return True when the repository has staged or unstaged tracked changes.
| [in] | run_dir | Argument passed to _working_tree_has_tracked_changes(). |
_working_tree_has_tracked_changes(). Definition at line 17563 of file core.py.
|
protected |
Best-effort cleanup after a failed git pull so the original branch can be restored.
| [in] | run_dir | Argument passed to _attempt_pull_cleanup(). |
| [in] | rebase | Argument passed to _attempt_pull_cleanup(). |
| [in] | log_file | Argument passed to _attempt_pull_cleanup(). |
Definition at line 17575 of file core.py.
|
protected |
Restore the repository back to the branch or detached commit it started on.
| [in] | run_dir | Argument passed to _restore_git_head(). |
| [in] | original_head | Argument passed to _restore_git_head(). |
| [in] | log_file | Argument passed to _restore_git_head(). |
Definition at line 17607 of file core.py.
|
protected |
Refuse a branch pull when the source checkout is pinned to a detached commit.
versions install and versions activate leave the checkout detached on the version they built. A branch pull there either fails inside Git or, in the multi-branch path, updates the branches and then restores the detached commit, so the active code never changes while the command reports success. A directory that is not a Git checkout is left for the Git command to report.
| [in] | source_project_root | PICurv source checkout to inspect. |
| [in] | action | User-facing command name. |
| ValueError | when HEAD is detached. |
Definition at line 17626 of file core.py.
| picurv_cli.core.pull_all_source_branches | ( | str | run_dir, |
| str | log_filename, | ||
| bool | rebase = True |
||
| ) |
Refresh every local tracking branch in the source repository, then restore the starting branch.
| [in] | run_dir | Argument passed to pull_all_source_branches(). |
| [in] | log_filename | Argument passed to pull_all_source_branches(). |
| [in] | rebase | Argument passed to pull_all_source_branches(). |
Definition at line 17654 of file core.py.
| picurv_cli.core.auto_identify_run_inputs | ( | str | config_dir | ) |
Auto-detect case.yml, monitor.yml, and *.control in a run config directory.
| [in] | config_dir | Argument passed to auto_identify_run_inputs(). |
auto_identify_run_inputs(). Definition at line 17762 of file core.py.
| str picurv_cli.core.resolve_post_source_directory | ( | str | run_dir, |
| dict | monitor_cfg, | ||
| dict | post_cfg, | ||
| bool | strict = True |
||
| ) |
Resolve post source directory token and optionally enforce existence.
| [in] | run_dir | Argument passed to resolve_post_source_directory(). |
| [in] | monitor_cfg | Argument passed to resolve_post_source_directory(). |
| [in] | post_cfg | Argument passed to resolve_post_source_directory(). |
| [in] | strict | Argument passed to resolve_post_source_directory(). |
resolve_post_source_directory(). Definition at line 17795 of file core.py.
| picurv_cli.core.render_slurm_array_stage_script | ( | str | script_path, |
| str | job_name, | ||
| dict | cluster_cfg, | ||
| str | array_spec, | ||
| str | case_index_tsv, | ||
| str | stage, | ||
| str | solver_exe, | ||
| str | post_exe, | ||
| str | stdout_path, | ||
| str | stderr_path, | ||
| "str | None" | expected_version_line = None |
||
| ) |
Render array script that maps SLURM_ARRAY_TASK_ID to per-case run artifacts.
| [in] | script_path | Argument passed to render_slurm_array_stage_script(). |
| [in] | job_name | Argument passed to render_slurm_array_stage_script(). |
| [in] | cluster_cfg | Argument passed to render_slurm_array_stage_script(). |
| [in] | array_spec | Argument passed to render_slurm_array_stage_script(). |
| [in] | case_index_tsv | Argument passed to render_slurm_array_stage_script(). |
| [in] | stage | Argument passed to render_slurm_array_stage_script(). |
| [in] | solver_exe | Argument passed to render_slurm_array_stage_script(). |
| [in] | post_exe | Argument passed to render_slurm_array_stage_script(). |
| [in] | stdout_path | Argument passed to render_slurm_array_stage_script(). |
| [in] | stderr_path | Argument passed to render_slurm_array_stage_script(). |
| [in] | expected_version_line | --version output the stage's executable reported at staging; checked before launch in every task. |
render_slurm_array_stage_script(). Definition at line 17823 of file core.py.
| picurv_cli.core.render_metrics_aggregate_script | ( | str | script_path, |
| str | job_name, | ||
| dict | cluster_cfg, | ||
| str | study_dir, | ||
| str | picurv_path | ||
| ) |
Generate a single-node sbatch script that runs metrics aggregation.
| [in] | script_path | Path to write the sbatch script. |
| [in] | job_name | Slurm job name. |
| [in] | cluster_cfg | Parsed cluster YAML dictionary. |
| [in] | study_dir | Absolute path to the study directory. |
| [in] | picurv_path | Absolute path to the picurv script. |
Definition at line 17988 of file core.py.
| picurv_cli.core.reduce_metric_values | ( | values, | |
| str | reduction | ||
| ) |
Reduce a metric series to one scalar according to the requested reducer.
| [in] | values | Sequence of numeric values. |
| [in] | reduction | Reduction keyword. |
reduce_metric_values(). Definition at line 18050 of file core.py.
| picurv_cli.core.extract_metric_from_csv | ( | str | case_dir, |
| dict | spec | ||
| ) |
Extract a scalar metric from a CSV source.
| [in] | case_dir | Argument passed to extract_metric_from_csv(). |
| [in] | spec | Argument passed to extract_metric_from_csv(). |
extract_metric_from_csv(). Definition at line 18072 of file core.py.
| picurv_cli.core.extract_metric_from_log | ( | str | case_dir, |
| dict | spec | ||
| ) |
Extract a scalar metric from a log file using regex.
| [in] | case_dir | Argument passed to extract_metric_from_log(). |
| [in] | spec | Argument passed to extract_metric_from_log(). |
extract_metric_from_log(). Definition at line 18122 of file core.py.
| picurv_cli.core.normalize_metric_spec | ( | metric | ) |
Normalize study metric definitions to a common dictionary form.
| [in] | metric | Argument passed to normalize_metric_spec(). |
normalize_metric_spec(). Definition at line 18153 of file core.py.
|
protected |
Read the metrics table an earlier aggregation wrote, keyed by case id.
| [in] | results_dir | Study analysis directory holding metrics_table.csv. |
Definition at line 18172 of file core.py.
| str picurv_cli.core.aggregate_study_metrics | ( | dict | study_cfg, |
| list | cases, | ||
| str | results_dir | ||
| ) |
Collect metric values from generated case directories into one CSV.
| [in] | study_cfg | Argument passed to aggregate_study_metrics(). |
| [in] | cases | Argument passed to aggregate_study_metrics(). |
| [in] | results_dir | Argument passed to aggregate_study_metrics(). |
aggregate_study_metrics(). Definition at line 18190 of file core.py.
|
protected |
Return a concise report label for a study parameter path.
| [in] | key | Dotted study parameter path. |
Definition at line 18288 of file core.py.
|
protected |
Resolve an optional configured metric label or humanize its name.
| [in] | study_cfg | Parsed study configuration. |
| [in] | metric | Metric column name. |
Definition at line 18305 of file core.py.
|
protected |
Parse one complete, finite numeric study-table column.
| [in] | rows | Metrics-table rows. |
| [in] | key | Column name. |
Definition at line 18323 of file core.py.
|
protected |
Infer the scientifically meaningful independent variable of a study.
| [in] | study_cfg | Parsed study configuration. |
| [in] | rows | Metrics-table rows. |
Definition at line 18342 of file core.py.
| picurv_cli.core.infer_plot_x_axis | ( | dict | study_cfg, |
| list | rows | ||
| ) |
Infer x-axis key/values for study plots.
| [in] | study_cfg | Argument passed to infer_plot_x_axis(). |
| [in] | rows | Argument passed to infer_plot_x_axis(). |
infer_plot_x_axis(). Definition at line 18394 of file core.py.
|
protected |
Format a secondary study parameter compactly for a legend.
| [in] | value | Parameter value. |
Definition at line 18407 of file core.py.
|
protected |
Group metric points by any secondary varied study parameters.
| [in] | study_cfg | Parsed study configuration. |
| [in] | rows | Metrics-table rows. |
| [in] | axis | Inferred independent-axis metadata. |
| [in] | metric | Metric column name. |
Definition at line 18422 of file core.py.
|
protected |
Use log scaling only for positive data spanning a meaningful range.
| [in] | values | Candidate axis values. |
| [in] | semantic_hint | Whether the quantity is conventionally read logarithmically. |
Definition at line 18466 of file core.py.
|
protected |
Build padded linear limits that include zero for non-negative metrics.
| [in] | values | Finite metric values. |
Definition at line 18479 of file core.py.
| picurv_cli.core.generate_study_plots | ( | dict | study_cfg, |
| str | metrics_csv, | ||
| str | plots_dir | ||
| ) |
Generate metric-vs-parameter plots for completed studies.
| [in] | study_cfg | Argument passed to generate_study_plots(). |
| [in] | metrics_csv | Argument passed to generate_study_plots(). |
| [in] | plots_dir | Argument passed to generate_study_plots(). |
generate_study_plots(). Definition at line 18494 of file core.py.
|
protected |
Render a command list as a shell-safe display string.
| [in] | command_tokens | Argument passed to _command_to_string(). |
_command_to_string(). Definition at line 18607 of file core.py.
|
protected |
Resolve post source directory without side effects or stdout/stderr output.
| [in] | run_dir | Argument passed to _resolve_post_source_directory_preview(). |
| [in] | monitor_cfg | Argument passed to _resolve_post_source_directory_preview(). |
| [in] | post_cfg | Argument passed to _resolve_post_source_directory_preview(). |
_resolve_post_source_directory_preview(). Definition at line 18616 of file core.py.
| dict picurv_cli.core.build_run_dry_plan | ( | args | ) |
Build a no-write execution plan for run --dry-run.
| [in] | args | Command-line style argument list supplied to the function. |
build_run_dry_plan(). Definition at line 18631 of file core.py.
| None picurv_cli.core.add_planned_grid_artifacts | ( | dict | plan, |
| dict | case_cfg, | ||
| str | run_dir | ||
| ) |
Add grid-mode-specific staged artifacts to a dry-run plan.
| [in,out] | plan | Dry-run plan to update. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | run_dir | Preview run directory for relative artifact resolution. |
Definition at line 19149 of file core.py.
| None picurv_cli.core.add_planned_profile_artifacts | ( | dict | plan, |
| dict | case_cfg, | ||
| str | run_dir | ||
| ) |
Add generated prescribed-flow profile artifacts to a dry-run plan.
| [in,out] | plan | Dry-run plan to update. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | run_dir | Preview run directory. |
Definition at line 19176 of file core.py.
| None picurv_cli.core.add_planned_initial_condition_artifacts | ( | dict | plan, |
| dict | case_cfg, | ||
| dict | solver_cfg, | ||
| str | run_dir | ||
| ) |
Add authoritative file-backed initial-condition artifacts to a dry-run plan.
| [in,out] | plan | Dry-run plan receiving artifact paths. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | solver_cfg | Parsed solver configuration. |
| [in] | run_dir | Planned run directory. |
Definition at line 19208 of file core.py.
| picurv_cli.core.render_run_dry_plan | ( | dict | plan, |
| str | output_format = "text" |
||
| ) |
Render dry-run plan in human or JSON format.
| [in] | plan | Dry-run plan produced by build_run_dry_plan(). |
| [in] | output_format | Either "text" or "json". |
Definition at line 19245 of file core.py.
| picurv_cli.core.validate_workflow | ( | args | ) |
Implements picurv validate without launching solver/post workflows.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 19325 of file core.py.
|
protected |
Hash an asset source or payload without loading it into memory.
| [in] | path | File to hash. |
Definition at line 19507 of file core.py.
|
protected |
Hash a JSON-compatible value with deterministic serialization.
| [in] | payload | Value to hash. |
Definition at line 19520 of file core.py.
|
protected |
Hash every existing file explicitly referenced by an asset provider.
| [in] | value | Provider subtree to inspect. |
| [in] | case_path | Owning case configuration path. |
| [in] | key | Current dotted key for diagnostics. |
Definition at line 19530 of file core.py.
| dict picurv_cli.core.build_case_asset_graph | ( | dict | case_cfg, |
| str | case_path | ||
| ) |
Classify case inputs into precomputable or simulator-runtime providers.
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Owning case YAML path. |
Definition at line 19566 of file core.py.
|
protected |
Resolve requested asset kinds plus dependency closure.
| [in] | graph | Provider graph returned by build_case_asset_graph. |
| [in] | requested | Optional iterable of requested kind names. |
| [in] | precomputable_only | Exclude runtime-C providers for normal-run staging. |
Definition at line 19694 of file core.py.
|
protected |
Enumerate canonical files belonging to one asset kind in a build tree.
| [in] | build_root | Temporary run-like build root. |
| [in] | kind | Asset kind. |
Definition at line 19733 of file core.py.
|
protected |
Execute existing generators into one isolated run-like build tree.
| [in] | build_root | Temporary output root. |
| [in] | case_cfg | Parsed case config. |
| [in] | case_path | Owning case path. |
| [in] | selected | Ordered selected providers. |
Definition at line 19761 of file core.py.
|
protected |
Read a canonical PICGRID and summarize what a user would want to check.
| [in] | path | Staged PICGRID file. |
Definition at line 19865 of file core.py.
|
protected |
Write a single-block ASCII VTS preview of a staged PICGRID.
Only the first block is written: the preview exists so a user can confirm the shape they configured, not to reproduce the solver's view of a multi-block domain.
| [in] | picgrid_path | Staged PICGRID file. |
| [in] | destination | Preview path to write. |
| [in] | dims | Per-block dimension triples. |
Definition at line 19902 of file core.py.
|
protected |
Produce the inspection material published beside an asset's payload.
Precompute exists so a user can look at a grid, field, or profile and change it before committing a solve. An asset that carries only opaque solver input cannot serve that purpose, so every published object gets a validation record and, where it is affordable, a preview.
| [in] | kind | Asset kind. |
| [in] | build_root | Temporary build tree. |
| [in] | provider | Provider metadata for the asset. |
| [in] | payload_files | Absolute payload paths produced for this asset. |
Definition at line 19948 of file core.py.
|
protected |
Publish one immutable content-addressed asset object atomically.
| [in] | workspace_root | Owning workspace. |
| [in] | build_root | Temporary build root. |
| [in] | provider | Provider metadata. |
| [in] | payload_files | Files produced for the provider. |
Definition at line 20040 of file core.py.
|
protected |
Return a collision-free, readable mutable asset-set name.
| [in] | workspace_root | Owning initialized workspace. |
| [in] | case_path | Source case configuration path. |
Definition at line 20114 of file core.py.
|
protected |
Atomically update the named asset set and workspace asset catalog.
| [in] | workspace_root | Owning workspace. |
| [in] | case_path | Source case YAML. |
| [in] | graph | Complete provider graph. |
| [in] | references | Newly published or reused asset references. |
Definition at line 20127 of file core.py.
| dict picurv_cli.core.precompute_case_assets | ( | str | workspace_root, |
| dict | case_cfg, | ||
| str | case_path, | ||
requested = None, |
|||
| bool | precomputable_only = False |
||
| ) |
Build and publish a selected deterministic asset dependency closure.
| [in] | workspace_root | Owning workspace. |
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Source case path. |
| [in] | requested | Requested asset kinds, or all configured providers. |
| [in] | precomputable_only | Drop runtime-C dependencies from the closure instead of refusing. For internal run-staging only: a run legitimately depends on a runtime-C grid that its own solver builds moments later, so its presence in the dependency closure is expected there, not an error. The standalone picurv precompute command leaves this False, since nothing will ever build a runtime-C provider in that context. |
Definition at line 20173 of file core.py.
|
protected |
Return the mutable asset-set pointer associated with a case config name.
| [in] | workspace_root | Owning workspace. |
| [in] | case_path | Source case path. |
Definition at line 20226 of file core.py.
|
protected |
Find a published object built from exactly this provider's inputs.
Asset sets are named after case files, so they miss an object another case file already built from identical inputs. The provider identity is what the object was built from, so any published object carrying it is reusable; the lowest asset id is taken so repeated lookups agree. Payload checksums are verified when the object is materialized, not here.
| [in] | workspace_root | Owning workspace. |
| [in] | provider | Provider entry from build_case_asset_graph(). |
Definition at line 20237 of file core.py.
| dict picurv_cli.core.plan_run_assets | ( | dict | case_cfg, |
| str | case_path, | ||
skip_kinds = () |
|||
| ) |
Plan reuse/build/runtime actions for all configured run providers.
| [in] | case_cfg | Parsed case configuration. |
| [in] | case_path | Source case path. |
| [in] | skip_kinds | Kinds the run will not read; planned as unused, never built. |
Definition at line 20276 of file core.py.
|
protected |
Expose one immutable shared-asset file through reflink, hardlink, or copy.
| [in] | source | Immutable asset payload file. |
| [in] | destination | Run-local destination. |
Definition at line 20330 of file core.py.
| dict picurv_cli.core.materialize_run_assets | ( | str | run_dir, |
| dict | case_cfg, | ||
| str | case_path, | ||
| bool | require_precomputed = False, |
||
| bool | fetch_missing = False, |
||
skip_kinds = () |
|||
| ) |
Resolve/build workspace assets and write the exact run input lock.
| [in] | run_dir | Run receiving immutable input exposures. |
| [in] | case_cfg | Parsed case config. |
| [in] | case_path | Source case path. |
| [in] | require_precomputed | Refuse any missing deterministic asset. |
| [in] | fetch_missing | Request remote fetch before local build. |
| [in] | skip_kinds | Kinds the run will not read (see unused_asset_kinds()). |
Definition at line 20366 of file core.py.
| picurv_cli.core.precompute_workflow | ( | args | ) |
Resolve, preflight, and atomically publish reusable workspace assets.
| [in] | args | Parsed precompute command arguments. |
Definition at line 20487 of file core.py.
| picurv_cli.core.run_workflow | ( | args | ) |
Main orchestrator for the 'run' command (local and Slurm modes).
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 20520 of file core.py.
| list picurv_cli.core.parse_case_index_tsv | ( | str | tsv_path | ) |
Parse a case_index.tsv file back into a list of case entry dicts.
| [in] | tsv_path | Path to the case_index.tsv file. |
Definition at line 21312 of file core.py.
| dict picurv_cli.core.resolve_sweep_stage_executables | ( | list | run_dirs | ) |
Choose the executables an array stage launches for every member of a study.
Array tasks share one script, which reads each member's RUN_DIR from the case index, so pinned members launch their own copy through the same $RUN_DIR-relative path. Members must agree: a study half pinned, or pinned at different paths, has no single command that launches each member's build.
| [in] | run_dirs | Member run directories the stage covers. |
(path token, staged --version line or None). | ValueError | when members disagree about pinning. |
Definition at line 21338 of file core.py.
| picurv_cli.core.sweep_workflow | ( | args | ) |
Study/sweep orchestration using Slurm job arrays.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 21372 of file core.py.
| picurv_cli.core.sweep_continue_workflow | ( | args | ) |
Continue a partially-completed Slurm parameter sweep study.
Detects incomplete cases, prepares them for continuation (updating start_step, populating restart directories, regenerating control files), and submits new solver/post/metrics Slurm jobs. If all cases are already complete, performs metrics aggregation automatically.
| [in] | args | Parsed CLI arguments with study_dir and optional cluster override. |
Definition at line 21713 of file core.py.
| picurv_cli.core.sweep_reaggregate_workflow | ( | args | ) |
Re-run metrics aggregation and plot generation for an existing study.
| [in] | args | Parsed CLI arguments with study_dir. |
Definition at line 21983 of file core.py.
|
protected |
Read YAML when present, otherwise return None.
| [in] | filepath | Argument passed to _read_yaml_if_exists(). |
_read_yaml_if_exists(). Definition at line 22053 of file core.py.
|
protected |
Read JSON when present, otherwise return None.
| [in] | filepath | Argument passed to _read_json_if_exists(). |
_read_json_if_exists(). Definition at line 22068 of file core.py.
|
protected |
Best-effort integer parsing for summary extraction.
| [in] | value | Argument passed to _parse_int_loose(). |
_parse_int_loose(). Definition at line 22080 of file core.py.
|
protected |
Best-effort float parsing for summary extraction.
| [in] | value | Argument passed to _parse_float_loose(). |
_parse_float_loose(). Definition at line 22100 of file core.py.
|
protected |
Extract a numeric tuple from a string like '(1, 2, 3)'.
| [in] | text | Argument passed to _extract_numeric_tuple(). |
_extract_numeric_tuple(). Definition at line 22117 of file core.py.
|
protected |
Resolve run-local config and artifact paths for summarize.
| [in] | run_dir | Argument passed to _build_summary_context(). |
_build_summary_context(). Definition at line 22128 of file core.py.
|
protected |
Return one explicitly requested copied config or fail with a structured error.
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | name | Config selector name. |
Definition at line 22195 of file core.py.
|
protected |
Build timestep-independent run metadata for summarize.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 22224 of file core.py.
|
protected |
Build compact turbulence and wall-model selections.
| [in] | turbulence_cfg | Case turbulence configuration mapping. |
Definition at line 22247 of file core.py.
|
protected |
Build a curated case.yml summary with useful derived quantities.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 22267 of file core.py.
|
protected |
Scalar-transport parameters as the run resolves them, wherever they are set.
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | solver_cfg | Parsed solver configuration. |
Definition at line 22347 of file core.py.
|
protected |
Build a curated solver.yml summary with normalized selections.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 22360 of file core.py.
|
protected |
Build a curated monitor.yml summary with resolved defaults.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 22397 of file core.py.
|
protected |
Read the continuity record into rows by step (one per block) plus observed order.
| [in] | log_dir | Run log directory. |
Definition at line 22440 of file core.py.
|
protected |
Read the per-step particle record into rows by step plus observed order.
| [in] | log_dir | Run log directory. |
| [in] | metrics_dir | Run analysis metrics directory. |
Definition at line 22456 of file core.py.
|
protected |
Read the per-block momentum records (Picard history, Newton summary) into rows by step.
| [in] | log_dir | Run log directory. |
Definition at line 22470 of file core.py.
|
protected |
Read the per-block Poisson histories into each step's last iteration.
| [in] | log_dir | Run log directory. |
Definition at line 22510 of file core.py.
|
protected |
Parse profiling timestep CSV into latest rows by step plus observed order.
| [in] | filepath | Argument passed to _parse_profiling_timestep_csv(). |
_parse_profiling_timestep_csv(). Definition at line 22526 of file core.py.
|
protected |
Read the runtime memory record into rows by step and its final status.
| [in] | filepath | Runtime memory log path. |
Definition at line 22558 of file core.py.
|
protected |
Read the solution-convergence record into rows by step plus observed order.
| [in] | log_dir | Run log directory. |
Definition at line 22594 of file core.py.
|
protected |
Return plausible solver stream logs for local and Slurm runs.
| [in] | run_dir | Argument passed to _find_solver_stream_log_candidates(). |
| [in] | log_dir | Argument passed to _find_solver_stream_log_candidates(). |
_find_solver_stream_log_candidates(). Definition at line 22607 of file core.py.
|
protected |
Parse sampled particle snapshots from a solver stream log.
| [in] | filepath | Argument passed to _parse_particle_snapshot_file(). |
_parse_particle_snapshot_file(). Definition at line 22629 of file core.py.
|
protected |
Return the nearest earlier snapshot step when available.
| [in] | snapshot_steps | Argument passed to _find_previous_snapshot_step(). |
| [in] | step | Argument passed to _find_previous_snapshot_step(). |
_find_previous_snapshot_step(). Definition at line 22680 of file core.py.
|
protected |
Compute sampled deltas between two particle snapshot samples.
| [in] | current_rows | Argument passed to _compute_particle_snapshot_delta(). |
| [in] | previous_rows | Argument passed to _compute_particle_snapshot_delta(). |
_compute_particle_snapshot_delta(). Definition at line 22693 of file core.py.
|
protected |
Build sampled diagnostics for one particle console snapshot.
| [in] | source | Argument passed to _build_particle_snapshot_summary(). |
| [in] | step | Argument passed to _build_particle_snapshot_summary(). |
| [in] | rows | Argument passed to _build_particle_snapshot_summary(). |
| [in] | preview_rows | Argument passed to _build_particle_snapshot_summary(). |
| [in] | particle_console_output_freq | Argument passed to _build_particle_snapshot_summary(). |
| [in] | particle_log_interval | Argument passed to _build_particle_snapshot_summary(). |
| [in] | previous_step | Argument passed to _build_particle_snapshot_summary(). |
| [in] | previous_rows | Argument passed to _build_particle_snapshot_summary(). |
_build_particle_snapshot_summary(). Definition at line 22761 of file core.py.
|
protected |
Locate and summarize a particle console snapshot for one step.
| [in] | run_dir | Argument passed to _find_particle_snapshot_for_step(). |
| [in] | log_dir | Argument passed to _find_particle_snapshot_for_step(). |
| [in] | step | Argument passed to _find_particle_snapshot_for_step(). |
| [in] | preview_rows | Argument passed to _find_particle_snapshot_for_step(). |
| [in] | particle_console_output_freq | Argument passed to _find_particle_snapshot_for_step(). |
| [in] | particle_log_interval | Argument passed to _find_particle_snapshot_for_step(). |
_find_particle_snapshot_for_step(). Definition at line 22938 of file core.py.
|
protected |
Select a step to summarize from available metric artifacts.
| [in] | requested_step | Argument passed to _resolve_summary_step(). |
| [in] | continuity_rows | Argument passed to _resolve_summary_step(). |
| [in] | particle_rows | Argument passed to _resolve_summary_step(). |
| [in] | momentum_rows | Argument passed to _resolve_summary_step(). |
| [in] | poisson_rows | Argument passed to _resolve_summary_step(). |
| [in] | profiling_rows | Argument passed to _resolve_summary_step(). |
| [in] | memory_rows | Argument passed to _resolve_summary_step(). |
| [in] | convergence_rows | Argument passed to _resolve_summary_step(). |
| [in] | step_orders | Argument passed to _resolve_summary_step(). |
| [in] | selection_mode | Argument passed to _resolve_summary_step(). |
_resolve_summary_step(). Definition at line 22982 of file core.py.
|
protected |
Format optional numeric values for summary text output.
| [in] | value | Argument passed to _format_summary_float(). |
| [in] | spec | Argument passed to _format_summary_float(). |
| [in] | missing | Argument passed to _format_summary_float(). |
_format_summary_float(). Definition at line 23033 of file core.py.
|
protected |
Return the newest modification time among one or more summary sources.
| [in] | paths | Path string, iterable of paths, or mapping of paths. |
Definition at line 23046 of file core.py.
|
protected |
Order observed step sequences by the recency of their source files.
| [in] | sources | Pairs of observed steps and filesystem source path(s). |
Definition at line 23063 of file core.py.
| dict picurv_cli.core.build_run_summary_payload | ( | str | run_dir, |
| "int | None" | step = None, |
||
| int | snapshot_rows = 5, |
||
| str | selection_mode = "latest" |
||
| ) |
Build a read-only run-step summary from existing PICurv artifacts.
| [in] | run_dir | Argument passed to build_run_summary_payload(). |
| [in] | step | Argument passed to build_run_summary_payload(). |
| [in] | snapshot_rows | Argument passed to build_run_summary_payload(). |
| [in] | selection_mode | Argument passed to build_run_summary_payload(). |
build_run_summary_payload(). Definition at line 23077 of file core.py.
| picurv_cli.core.render_run_summary | ( | dict | payload, |
| str | output_format = "text" |
||
| ) |
Render a run-step summary in human or JSON form.
| [in] | payload | Argument passed to render_run_summary(). |
| [in] | output_format | Argument passed to render_run_summary(). |
Definition at line 23256 of file core.py.
|
protected |
Format one configuration-summary value for compact text output.
| [in] | value | Value to format. |
Definition at line 23529 of file core.py.
|
protected |
Print a strong dashboard-style configuration summary header.
| [in] | title | Section title. |
| [in] | subtitle | Optional one-line section subtitle. |
Definition at line 23550 of file core.py.
|
protected |
Print an aligned configuration-summary field group.
| [in] | title | Group title. |
| [in] | rows | Sequence of (label, value) pairs. |
Definition at line 23563 of file core.py.
|
protected |
Flatten nested summary mappings into readable dotted field rows.
| [in] | mapping | Mapping to flatten. |
| [in] | prefix | Optional parent-field prefix. |
(field, value) pairs. Definition at line 23578 of file core.py.
|
protected |
Render run metadata as a compact dashboard.
| [in] | summary | Curated run overview mapping. |
Definition at line 23595 of file core.py.
|
protected |
Render the case summary as a glanceable simulation dashboard.
| [in] | summary | Curated case configuration mapping. |
Definition at line 23623 of file core.py.
|
protected |
Render the solver summary as a glanceable numerical-method dashboard.
| [in] | summary | Curated solver configuration mapping. |
Definition at line 23694 of file core.py.
|
protected |
Render the monitor summary as a glanceable observability dashboard.
| [in] | summary | Curated monitor configuration mapping. |
Definition at line 23736 of file core.py.
| picurv_cli.core.render_selected_summary | ( | dict | payload, |
| str | output_format = "text" |
||
| ) |
Render selected timestep-independent config views and optional health.
| [in] | payload | Combined selected summary payload. |
| [in] | output_format | Output format. |
Definition at line 23786 of file core.py.
|
protected |
Convert one machine-oriented identifier into a readable plot label.
| [in] | value | Dotted path or snake-case identifier. |
Definition at line 23936 of file core.py.
|
protected |
Return the report-facing label for one logged scalar field.
| [in] | field | Logged scalar field name. |
Definition at line 23952 of file core.py.
|
protected |
Resolve a record's physical time from its artifact or copied case configuration.
| [in] | context | Summary context with copied case configuration. |
| [in] | record | Collected plot record. |
Definition at line 23961 of file core.py.
|
protected |
Yields (segment, row) for each data line of one of the solver's CSV records.
Every per-step file the solver writes shares one shape: a header (the first line that is not a comment) written once, data rows appended across the run, # comment lines, and a # Continuation from step N marker at each seam where a continuation resumed. A row with fewer fields than the header is skipped rather than guessed at; one with more keeps the header's columns, since columns are only ever appended. segment counts the continuations seen so far, so a caller can keep restarts as separate series instead of drawing a line across the seam.
| path | CSV to read. |
(segment_index, {column: text}) pairs. Definition at line 23978 of file core.py.
|
protected |
Return a solver record's CSV, or the text log an older run wrote instead.
| [in] | log_dir | Run log directory. |
| [in] | base | File name without extension, such as Continuity_Metrics. |
.csv; None when neither exists. Definition at line 24012 of file core.py.
|
protected |
Return (block, path) for each per-block solver record, CSV preferred per block.
| [in] | log_dir | Run log directory. |
| [in] | bases | File-name stems before _Block_<n>, newest naming first. |
(block, path) pairs. Definition at line 24026 of file core.py.
|
protected |
Return the continuity record's path and its (segment, row) pairs.
| [in] | log_dir | Run log directory. |
Definition at line 24043 of file core.py.
|
protected |
Return the per-step particle record's path and its (segment, row) pairs.
search_metrics.csv carries the step's particle counts; a run that predates it in that role wrote Particle_Metrics.log, read when the CSV is absent.
| [in] | log_dir | Run log directory. |
| [in] | metrics_dir | Run analysis metrics directory. |
Definition at line 24098 of file core.py.
|
protected |
Return (block, path, [(segment, row)]) for each Picard momentum history.
| [in] | log_dir | Run log directory. |
Definition at line 24178 of file core.py.
|
protected |
Return (block, path, [(segment, row)]) for each Newton iteration history.
| [in] | log_dir | Run log directory. |
Definition at line 24255 of file core.py.
|
protected |
Return (block, path, [(segment, row)]) for each Newton per-step summary.
| [in] | log_dir | Run log directory. |
Definition at line 24287 of file core.py.
|
protected |
Return (block, path, [(segment, row)]) for each Poisson iteration history.
| [in] | log_dir | Run log directory. |
Definition at line 24346 of file core.py.
|
protected |
Return the runtime memory record's (segment, row) pairs (CSV, or an older run's text log).
| [in] | path | Runtime memory log path as configured. |
Definition at line 24383 of file core.py.
|
protected |
Return a CSV cell as a float (written with a point or exponent), an int, or the text.
| [in] | text | Cell text. |
Definition at line 24433 of file core.py.
|
protected |
Return the solution-convergence record's path and its (segment, row) pairs.
| [in] | log_dir | Run log directory. |
mode set. Definition at line 24448 of file core.py.
|
protected |
Append one numeric append-ordered record for summarize plotting.
| [out] | records | Destination record list. |
| [in] | source | Qualified source prefix. |
| [in] | step | Logged timestep. |
| [in] | line | Human-readable line identity. |
| [in] | values | Candidate field mapping. |
| [in] | source_path | Source artifact path. |
| [in] | segment | Zero-based continuation segment within the source artifact. |
| [in] | coordinates | Optional independent variables carried by the source row. |
Definition at line 24498 of file core.py.
|
protected |
Return whether a log line starts a new continuation segment.
| [in] | line | Candidate raw or stripped log line. |
Definition at line 24531 of file core.py.
|
protected |
Collect append-ordered numeric records from summarize-supported scalar logs.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 24540 of file core.py.
|
protected |
Collect the per-step scalar histories written by the spectra post stage.
Each spectra task keeps its own history file, so one task becomes one plotted line and several tasks compare directly on the same axes.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 24703 of file core.py.
|
protected |
Collect the profile histories the profile_series reducer wrote.
Each <prefix>_profile_<name>_history.csv holds one row per step and one column per <output column>.<functional>, which becomes the series profile.<column>.<functional>, one line per history file. The functionals are the reducer's (generators/reduce.gen profile-series); this only reads.
| [in] | context | Summary context returned by _build_summary_context(). |
Definition at line 24749 of file core.py.
Build available qualified-series metadata from plot records.
| [in] | records | Append-ordered plot record list. |
Definition at line 24787 of file core.py.
|
protected |
Select evenly distributed indices while always retaining both endpoints.
| [in] | count | Number of available ordered states. |
| [in] | maximum | Maximum states to retain. |
Definition at line 24811 of file core.py.
|
protected |
Build a plot.gen request drawing representative measured spectra.
A decaying flow has a different spectrum at every step, so states are never averaged. Up to six evenly spaced states are retained, including the first and last, to show evolution without an unreadable legend.
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | task | Task basename, or a unique substring of one. |
| [in] | reference | Overlay the staged initial-condition spectrum when available. |
| [in] | linear_y | Force linear axes instead of the log-log default. |
| [in] | output_path | Optional explicit output path. |
| ValueError | when no matching spectrum file exists. |
Definition at line 24823 of file core.py.
|
protected |
Build one normalized plot.gen request from collected summarize records.
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | records | Append-ordered plot record list. |
| [in] | series | Qualified series name. |
| [in] | last_n | Optional last-N records per plotted line. |
| [in] | linear_y | Whether to force linear scaling. |
| [in] | output_path | Optional explicit output path. |
Definition at line 24957 of file core.py.
|
protected |
Render available summarize plot-series metadata.
| [in] | catalog | Available series catalog. |
| [in] | output_format | Text or JSON output format. |
Definition at line 25091 of file core.py.
|
protected |
Resolve a summarize --table name to the CSV it prints.
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | name | Table name from SUMMARY_TABLES, optionally :<block>. |
| ValueError | When the name is unknown or the block is not an integer. |
Definition at line 25132 of file core.py.
|
protected |
Print the summarize --table names whose CSV this run has, with row counts.
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | output_format | Text or JSON output format. |
Definition at line 25153 of file core.py.
|
protected |
Print the last rows of one of the run's CSV records as aligned columns (or JSON).
| [in] | context | Summary context returned by _build_summary_context(). |
| [in] | name | Table name (summarize --list-tables). |
| [in] | last_n | Rows to show from the end; None shows the last 20. |
| [in] | columns | Comma-separated column names to keep, or None for all. |
| [in] | output_format | Text or JSON output format. |
| ValueError | When the table is unknown, absent, or a requested column is missing. |
Definition at line 25183 of file core.py.
|
protected |
Invoke standalone plot.gen with one normalized request over stdin.
| [in] | request | Versioned normalized plot request. |
Definition at line 25226 of file core.py.
| picurv_cli.core.summarize_workflow | ( | args | ) |
Build and render a read-only health summary for a run step.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 25250 of file core.py.
|
protected |
Resolve a run/study submission target from explicit directory flags.
| [in] | run_dir | Argument passed to _resolve_submission_target(). |
| [in] | study_dir | Argument passed to _resolve_submission_target(). |
_resolve_submission_target(). Definition at line 25407 of file core.py.
|
protected |
Return stored metadata for one staged submission target.
| [in] | target_context | Argument passed to _get_submission_stage_metadata(). |
| [in] | stage_name | Argument passed to _get_submission_stage_metadata(). |
_get_submission_stage_metadata(). Definition at line 25513 of file core.py.
|
protected |
Return stage names explicitly recorded in scheduler submission metadata.
| [in] | target_context | Argument passed to _get_recorded_submission_stages(). |
_get_recorded_submission_stages(). Definition at line 25532 of file core.py.
|
protected |
Build an actionable hint for requested submit stages missing from metadata.
| [in] | target_context | Argument passed to _build_submit_missing_stage_hint(). |
| [in] | requested_stage | Argument passed to _build_submit_missing_stage_hint(). |
| [in] | selected_stages | Argument passed to _build_submit_missing_stage_hint(). |
_build_submit_missing_stage_hint(). Definition at line 25554 of file core.py.
|
protected |
Persist one stage's metadata back into the submission payload.
| [in] | target_context | Argument passed to _set_submission_stage_metadata(). |
| [in] | stage_name | Argument passed to _set_submission_stage_metadata(). |
| [in] | stage_meta | Argument passed to _set_submission_stage_metadata(). |
Definition at line 25601 of file core.py.
|
protected |
Write updated submission metadata back to disk.
| [in] | target_context | Argument passed to _write_submission_target_metadata(). |
Definition at line 25620 of file core.py.
| tuple picurv_cli.core.staged_control_directories | ( | str | control_path | ) |
Read run-owned directory values from a staged control file.
Tokenizes with shlex because PETSc's options-file parser treats a double-quoted span as a single token. Splitting on whitespace would read -log_dir "/tmp/VICTIM DIR" as the value "/tmp/VICTIM, which looks relative and contained while PETSc would use the absolute path.
Malformed quoting is reported rather than skipped: a line the parser cannot interpret is exactly the case where preflight must not assume the run is safe.
| [in] | control_path | Path to a generated .control file. |
Definition at line 25638 of file core.py.
| list picurv_cli.core.preflight_config_directories | ( | str | root_dir | ) |
Every config directory under a run or study root that may hold a control file.
A study keeps its controls under cases/<member>/config, not at the study root, so a preflight that only looked at <root>/config was empty for every study. This walks the tree so members and nested runs are covered.
| [in] | root_dir | Run or study directory. |
Definition at line 25687 of file core.py.
| tuple picurv_cli.core.preflight_staged_run_directories | ( | str | root_dir | ) |
Re-check run-directory safety against an already-staged run or study.
Staging validates the configuration it is given, but a staged run can be edited, or produced by an older version, before submission. This re-reads the effective staged control files - across study members and nested runs - and applies the same rules as configuration validation, plus a physical containment check that a symlink cannot slip past.
| [in] | root_dir | Run or study directory being submitted. |
Definition at line 25709 of file core.py.
| list picurv_cli.core.read_text_file_lines | ( | str | path | ) |
Read a text file into a list of lines.
| [in] | path | File to read. |
Definition at line 25758 of file core.py.
| picurv_cli.core.submit_staged_jobs | ( | args | ) |
Submit previously staged Slurm artifacts from an existing run/study directory.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 25768 of file core.py.
| picurv_cli.core.submit_staged_local_run | ( | args, | |
| dict | target_context, | ||
| list | selected_stages | ||
| ) |
Execute previously staged local run commands from scheduler/submission.json.
| [in] | args | Command-line style argument list supplied to the function. |
| [in] | target_context | Resolved submission target context. |
| [in] | selected_stages | Ordered stage names selected by the user. |
Definition at line 25974 of file core.py.
| picurv_cli.core.cancel_run_jobs | ( | args | ) |
Cancel Slurm-submitted jobs for an existing run directory.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 26083 of file core.py.
|
protected |
Infer the owned workspace role of one copied YAML file.
| [in] | path | YAML file copied from an example template. |
Definition at line 26216 of file core.py.
|
protected |
Rewrite copied template path scalars to workspace-root-relative homes.
| [in] | value | YAML subtree to rewrite. |
| [in] | replacements | Old relative/basename paths mapped to new workspace paths. |
Definition at line 26245 of file core.py.
|
protected |
Select the canonical role file from a template that may carry variants.
| [in] | candidates | Candidate absolute YAML paths. |
| [in] | role | Config role being selected. |
| [in] | template_name | Source example directory name. |
Definition at line 26262 of file core.py.
| dict picurv_cli.core.organize_initialized_workspace | ( | str | workspace_root, |
| str | template_name, | ||
| str | source_template_root = None |
||
| ) |
Convert a copied example into the canonical editable workspace layout.
| [in] | workspace_root | Newly copied workspace root. |
| [in] | template_name | Example template identity. |
| [in] | source_template_root | Optional original template root used to vendor references. |
Definition at line 26286 of file core.py.
| dict picurv_cli.core.import_workspace_input | ( | str | workspace_root, |
| str | kind, | ||
| str | source, | ||
| str | name = None, |
||
| str | mode = "copy" |
||
| ) |
Explicitly import or register one workspace input.
| [in] | workspace_root | Initialized workspace root. |
| [in] | kind | Semantic input kind. |
| [in] | source | Existing source file path. |
| [in] | name | Optional destination basename. |
| [in] | mode | Copy, reflink, hardlink, or external-reference mode. |
Definition at line 26485 of file core.py.
| picurv_cli.core.inputs_workflow | ( | args | ) |
Handle explicit workspace input management.
| [in] | args | Parsed inputs command arguments. |
Definition at line 26562 of file core.py.
| picurv_cli.core.version_workflow | ( | args | ) |
Report, and for the status action validate, the shared build identity.
Bare picurv version reports and always succeeds; it is an informational surface that scripts and documentation already depend on. picurv version status additionally exits non-zero when the conductor, the executables, and the workspace requirement do not agree, so a job script can refuse to launch a run whose provenance would be incoherent.
| [in] | args | Parsed version command arguments. |
Definition at line 26581 of file core.py.
|
protected |
Print the PETSc an executable was built against and the library it would load.
| [in] | identity | One executable's entry from runtime_build_identities(), with petsc_library and petsc_library_mismatch filled in. |
Definition at line 26640 of file core.py.
|
protected |
Refuse version-changing Git operations in a dirty source checkout.
| [in] | action | User-facing action name. |
Definition at line 26661 of file core.py.
|
protected |
Run a checked Git command against the active PICurv source checkout.
| [in] | arguments | Git arguments excluding the executable. |
Definition at line 26680 of file core.py.
| picurv_cli.core.source_workflow | ( | args | ) |
Fetch source history without silently changing the active code.
| [in] | args | Parsed source command arguments. |
Definition at line 26695 of file core.py.
|
protected |
Resolve an exact version requested by an initialized workspace.
| [in] | workspace_root | Initialized workspace root. |
Definition at line 26707 of file core.py.
| picurv_cli.core.versions_workflow | ( | args | ) |
List or activate a release using the existing source/build owners.
| [in] | args | Parsed versions command arguments. |
Definition at line 26728 of file core.py.
|
protected |
Resolve a user-named version to a Git ref that exists in the source checkout.
Release tags are spelled v<release>, while VERSION and workspace software.picurv pins carry the bare release. The name is tried as given first, so a commit, branch, or already-prefixed tag is never rewritten.
| [in] | version | Tag, bare release, or commit named by the user or workspace pin. |
git checkout --detach. | ValueError | when neither spelling resolves to a commit. |
Definition at line 26802 of file core.py.
| picurv_cli.core.init_case | ( | args | ) |
Implements the 'init' command.
Creates a new case study directory by copying a template. Runtime binaries are resolved from the project bin/ directory via PATH; pass –pin-binaries to pin specific versions locally.
| [in] | args | The command-line arguments parsed by argparse. |
Definition at line 26828 of file core.py.
| picurv_cli.core.sync_case_config_command | ( | args | ) |
Refresh template-managed config/docs files in a case directory.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 26919 of file core.py.
| picurv_cli.core.pull_source_repo | ( | args | ) |
Refresh source branches in the repository resolved from a case directory.
| [in] | args | Command-line style argument list supplied to the function. |
Definition at line 26972 of file core.py.
| picurv_cli.core.build_project | ( | args | ) |
Implements the 'build' command.
Executes the top-level Makefile directly, passing through any additional arguments to make. This allows for building, cleaning, and other Makefile targets via the orchestrator without maintaining a separate build wrapper script.
| [in] | args | The command-line arguments parsed by argparse. |
Definition at line 27018 of file core.py.
| None picurv_cli.core.run_project_make | ( | str | source_project_root, |
| "list[str]" | make_args | ||
| ) |
Run the project Makefile with caller-supplied arguments, defaulting to all.
Shared by picurv build and picurv versions install/activate, so a site setting such as SYSTEM=cluster reaches make the same way from both.
| [in] | source_project_root | PICurv source checkout containing the Makefile. |
| [in] | make_args | Arguments passed through to make. |
make fails. Definition at line 27042 of file core.py.
|
protected |
|
protected |
| picurv_cli.core.StorageError = _storage_module.StorageError |
| picurv_cli.core.cold_study_members = _storage_module.cold_study_members |
| picurv_cli.core.restore_cold_study_members = _storage_module.restore_cold_study_members |
| picurv_cli.core.is_artifact_cold = _storage_module.is_artifact_cold |
| picurv_cli.core.read_artifact_identity = _storage_module.read_artifact_identity |
| picurv_cli.core.STORAGE_LOCK_FILENAME = _storage_module.STORAGE_LOCK_FILENAME |
| picurv_cli.core.STORAGE_STATE_FILENAME = _storage_module.STORAGE_STATE_FILENAME |
| picurv_cli.core.require_storage_payload_local = _storage_module.require_storage_payload_local |
| picurv_cli.core.runtime_stage_lock = _storage_module.runtime_stage_lock |
| picurv_cli.core.storage_state_summary = _storage_module.storage_state_summary |
|
protected |
| picurv_cli.core.np = _LazyNumpyProxy() |
| picurv_cli.core.PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__)) |
| picurv_cli.core.PACKAGE_PROJECT_ROOT = os.path.dirname(PACKAGE_PATH) |
| picurv_cli.core.INVOKED_SCRIPT_DIR |
| picurv_cli.core.SCRIPT_PATH |
| picurv_cli.core.PROJECT_ROOT = os.path.dirname(SCRIPT_PATH) |
| picurv_cli.core.GENERATORS_PATH = os.path.join(PACKAGE_PROJECT_ROOT, "generators") |
| picurv_cli.core.DEFAULT_BIN_DIR = SCRIPT_PATH |
| picurv_cli.core.VERSION_FILE = os.path.join(PACKAGE_PROJECT_ROOT, "VERSION") |
| str picurv_cli.core.PICURV_RELEASE_VERSION = _read_release_version() |
| str picurv_cli.core.CASE_ORIGIN_METADATA_FILENAME = ".picurv-origin.json" |
| str picurv_cli.core.WORKSPACE_CONFIG_FILENAME = ".picurv-workspace.yml" |
| str picurv_cli.core.RUNTIME_EXECUTION_CONFIG_FILENAME = ".picurv-execution.yml" |
| str picurv_cli.core.LEGACY_LOCAL_RUNTIME_CONFIG_FILENAME = ".picurv-local.yml" |
| str picurv_cli.core.RUNTIME_EXECUTION_EXAMPLE_FILENAME = "execution.example.yml" |
| tuple picurv_cli.core.RUNTIME_EXECUTION_CONFIG_FILENAMES |
| str picurv_cli.core.DEFAULT_RUNTIME_EXECUTION_CONFIG_TEMPLATE |
| str picurv_cli.core.CLUSTER_TEMPLATE_PLACEHOLDER_ACCOUNT = "my_project_account" |
| str picurv_cli.core.CLUSTER_TEMPLATE_PLACEHOLDER_MAIL = "user@example.edu" |
| dict picurv_cli.core.DEFAULT_WALLTIME_GUARD_POLICY |
| str picurv_cli.core.WALLTIME_GUARD_ENV_JOB_START_EPOCH = "PICURV_JOB_START_EPOCH" |
| str picurv_cli.core.WALLTIME_GUARD_ENV_LIMIT_SECONDS = "PICURV_WALLTIME_LIMIT_SECONDS" |
| str picurv_cli.core.POST_RESUME_STATE_FILENAME = "post.resume.json" |
| str picurv_cli.core.POST_LOCK_METADATA_FILENAME = "post.lock.json" |
| str picurv_cli.core.POST_LOCK_WRAPPER_FILENAME = "post_lock_wrapper.py" |
| dict picurv_cli.core.POST_RECIPE_SIGNATURE_EXCLUDED_KEYS = {"startTime", "endTime", "timeStep", "source_directory"} |
| dict picurv_cli.core.CHECKPOINT_REQUIRED_EULERIAN_FIELDS = {"Ucat", "Ucont", "Ucont_rm1", "P", "Nvert"} |
| tuple picurv_cli.core.WORKSPACE_DIRECTORY_LAYOUT |
| tuple picurv_cli.core.RUN_DIRECTORY_LAYOUT |
| dict picurv_cli.core.CANONICAL_RUN_PATHS |
| picurv_cli.core.INITIAL_CONDITION_SPECTRUM_RELPATH |
|
protected |
|
protected |
|
protected |
| tuple picurv_cli.core.SPECTRAL_IC_PROVIDERS |
| tuple picurv_cli.core.SHELL_SPECTRUM_IC_PROVIDERS = ("spectral_random_velocity", "resampled_velocity") |
| picurv_cli.core.SPECTRAL_RANDOM_VELOCITY_PARAMS |
| picurv_cli.core.RESAMPLED_VELOCITY_PARAMS |
| tuple picurv_cli.core.RESAMPLED_VELOCITY_FASTEST_AXES = ("x", "z") |
| tuple picurv_cli.core.RESAMPLED_VELOCITY_COMPONENT_LAYOUTS = ("interleaved", "separate") |
| tuple picurv_cli.core.RESAMPLED_VELOCITY_RAW_DTYPES = ("float32", "float64") |
| tuple picurv_cli.core.RESAMPLED_VELOCITY_BYTE_ORDERS = ("little", "big", "native") |
| tuple picurv_cli.core.RESAMPLED_VELOCITY_PROJECTIONS = ("picurv_discrete", "continuum", "none") |
| dict picurv_cli.core.RESAMPLED_VELOCITY_LAYOUT_KEYS |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| picurv_cli.core.RUN_DIRECTORY_ROOTS |
| picurv_cli.core.RUN_ROOT_ALLOWED_FILES = frozenset({"manifest.json"}) |
| tuple picurv_cli.core.CONTINUATION_STAGED_RECORDS |
| tuple picurv_cli.core.RUN_EXECUTABLE_NAMES = ("simulator", "postprocessor") |
| picurv_cli.core.STORAGE_OFFLOADED_STATES = frozenset({"COLD", "PARTIAL"}) |
| tuple picurv_cli.core.RUN_COMPONENT_STATES |
| tuple picurv_cli.core.RUN_COMPONENT_LAYOUT |
|
protected |
|
protected |
|
protected |
| dict picurv_cli.core.PETSC_INDEX_BYTES = {"int32": 4, "int64": 8} |
|
protected |
|
protected |
| str picurv_cli.core.ERROR_CODE_CLI_USAGE_INVALID = "CLI_USAGE_INVALID" |
| str picurv_cli.core.ERROR_CODE_CFG_MISSING_SECTION = "CFG_MISSING_SECTION" |
| str picurv_cli.core.ERROR_CODE_CFG_MISSING_KEY = "CFG_MISSING_KEY" |
| str picurv_cli.core.ERROR_CODE_CFG_INVALID_TYPE = "CFG_INVALID_TYPE" |
| str picurv_cli.core.ERROR_CODE_CFG_INVALID_VALUE = "CFG_INVALID_VALUE" |
| str picurv_cli.core.ERROR_CODE_CFG_FILE_NOT_FOUND = "CFG_FILE_NOT_FOUND" |
| str picurv_cli.core.ERROR_CODE_CFG_GRID_PARSE = "CFG_GRID_PARSE" |
| str picurv_cli.core.ERROR_CODE_CFG_INCONSISTENT_COMBO = "CFG_INCONSISTENT_COMBO" |
| str picurv_cli.core.ERROR_CODE_DEPENDENCY_MISSING = "DEPENDENCY_MISSING" |
| tuple picurv_cli.core.RESTART_RUN_DIR_REQUIRED_MESSAGE |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| dict picurv_cli.core.POST_RUN_CONTROL_ALIASES |
| dict picurv_cli.core.GRID_GENERATOR_HYPHEN_KEY_HINTS |
| tuple picurv_cli.core.RETIRED_GENERATOR_DESTINATION_KEYS |
| tuple picurv_cli.core.RETIRED_INITIAL_CONDITION_DESTINATION_KEYS = ("output_file", "summary_json", "spectrum_csv") |
| dict picurv_cli.core.POST_SPECTRA_TASKS |
| tuple picurv_cli.core.POST_SPECTRA_SYMBOLS = ("continuum", "discrete") |
| tuple picurv_cli.core.POST_SPECTRA_MEAN_MODES = ("none", "domain", "sample") |
| tuple picurv_cli.core.POST_FIELD_STATISTICS_OUTPUTS = ("mean", "reynolds_stress", "rms", "tke", "flux", "point_variance") |
| tuple picurv_cli.core.POST_FIELD_STATISTICS_DEFAULT_OUTPUTS = POST_FIELD_STATISTICS_OUTPUTS[:-1] |
| tuple picurv_cli.core.POST_FIELD_STATISTICS_FORMATS = ("vtk", "csv") |
| tuple picurv_cli.core.GRID_MODES = ("file", "programmatic_c", "grid_gen") |
| tuple picurv_cli.core.DOMAIN_DIMENSIONALITY_MODES = ("3D", "2D") |
| tuple picurv_cli.core.GRID_GENERATOR_TYPES = ("box", "sweep") |
| tuple picurv_cli.core.GRID_CROSS_SECTION_KINDS = ("rectangle", "circle") |
| tuple picurv_cli.core.GRID_WALL_SEGMENT_KINDS = ("flat", "step", "ramp", "arc", "sine", "gaussian", "hill") |
| tuple picurv_cli.core.GRID_PATH_SEGMENT_KINDS = ("straight", "arc") |
| tuple picurv_cli.core.GRID_TRANSFORM_KINDS = ("anchor", "translate", "scale", "rotate", "mirror", "permute", "reverse") |
| tuple picurv_cli.core.PARTICLE_RESTART_MODES = ("init", "load") |
| tuple picurv_cli.core.POST_EULERIAN_PIPELINE_TASKS = ("q_criterion", "normalize_field", "nodal_average") |
| tuple picurv_cli.core.POST_LAGRANGIAN_PIPELINE_TASKS = ("specific_ke",) |
| tuple picurv_cli.core.STUDY_TYPES = ("grid_independence", "timestep_independence", "sensitivity") |
| tuple picurv_cli.core.NEWTON_KRYLOV_PRECONDITIONER_MODELS = ("none", "frozen_momentum_jacobian") |
| tuple picurv_cli.core.NEWTON_KRYLOV_PRECONDITIONER_STRUCTURES = ("none", "point_block") |
| tuple picurv_cli.core.POISSON_PRECONDITIONER_TYPES = ("multigrid",) |
| dict picurv_cli.core.POISSON_PRECONDITIONER_SPELLINGS = {"mg": "multigrid", "pcmg": "multigrid"} |
| tuple picurv_cli.core.PRESCRIBED_FLOW_SOURCE_TYPES = ("file", "generated", "field_slice") |
| tuple picurv_cli.core.VERIFICATION_SCALAR_PROFILES = ("CONSTANT", "LINEAR_X", "SIN_PRODUCT") |
| dict picurv_cli.core.SCALAR_TRANSPORT_FLAGS |
| dict picurv_cli.core.SCALAR_TRANSPORT_CASE_PATHS |
| tuple picurv_cli.core.STUDY_PLOT_FORMATS = ("png", "pdf", "svg") |
| tuple picurv_cli.core.PROFILING_TIMESTEP_MODES = ("off", "selected", "all") |
| dict picurv_cli.core.RENAMED_MONITOR_FUNCTIONS |
| tuple picurv_cli.core.REMOVED_MONITOR_FUNCTIONS |
| tuple picurv_cli.core.GMRES_RESTART_METHODS = ("gmres", "fgmres", "lgmres") |
| dict picurv_cli.core.POISSON_KSP_METHODS |
| dict picurv_cli.core.POISSON_KSP_REFUSED |
| tuple picurv_cli.core.ANALYTICAL_SOLUTION_TYPES = ("TGV3D", "ZERO_FLOW", "UNIFORM_FLOW") |
| tuple picurv_cli.core.LEGACY_FIELD_INIT_SPELLINGS = ("Zero", "Constant", "Poiseuille") |
| tuple picurv_cli.core.PROJECTION_OPERATORS = ("continuum", "picurv_discrete") |
| tuple picurv_cli.core.METRIC_SOURCE_KINDS = ("statistics_csv", "csv", "log_regex", "log") |
| tuple picurv_cli.core.POST_SPECTRA_SCALAR_COLUMNS |
| tuple picurv_cli.core.POST_STAGE_NAMES = ("fields", "spectra", "reducers") |
| dict picurv_cli.core.POST_REDUCER_TASKS |
| dict picurv_cli.core.POST_REDUCER_FRICTION_SOURCES |
|
protected |
| dict picurv_cli.core.POST_PARAVIEW_SERIES_SCOPES = {"run", "lineage"} |
| dict picurv_cli.core.POST_PROCESS_REASON_LABELS |
| dict picurv_cli.core.GENERATED_PROFILE_GENERATORS = {"square_duct_poiseuille"} |
| dict picurv_cli.core.GRID_GENERATOR_CHOICE_FLAGS |
| dict picurv_cli.core.GRID_GENERATOR_SPEC_FLAGS |
| dict picurv_cli.core.BC_FACE_MAP |
| dict picurv_cli.core.BC_TYPE_MAP |
| tuple picurv_cli.core.PARTICLE_BOUNDARY_POLICIES = ("reflect", "remove", "wrap") |
|
protected |
|
protected |
|
protected |
| tuple picurv_cli.core.RANS_PLANNED_REFUSAL |
| dict picurv_cli.core.STATISTICS_ELIGIBLE_FIELDS |
| dict picurv_cli.core.STATISTICS_PARTICLE_FIELDS |
| tuple picurv_cli.core.POST_STATISTICS_ENSEMBLE_SOURCES = ("particles", "eulerian") |
| tuple picurv_cli.core.STATISTICS_MOMENT_NAMES = ("first", "second") |
| tuple picurv_cli.core.STATISTICS_WEIGHTING_MODES = ("sample", "physical_time") |
|
protected |
|
protected |
|
protected |
| tuple picurv_cli.core.INPUT_CONVERSION_SITES = ("cli", "c", "staging", "provider", "evaluator", "reference", "passthrough", "") |
| tuple picurv_cli.core.UNITLESS = (DIMENSIONLESS, "") |
| dict picurv_cli.core.BC_PARAM_QUANTITIES |
| dict picurv_cli.core.IC_PARAM_QUANTITIES |
| tuple picurv_cli.core.RUN_OWNED_DIRECTORY_KEYS = ("log", "output") |
| str picurv_cli.core.UNSAFE_PATHS_OVERRIDE_KEY = "allow_unsafe_paths" |
| tuple picurv_cli.core.RESERVED_RUN_DIRECTORY_NAMES = ("config", "scheduler", "checkpoints", "visualization") |
| dict picurv_cli.core.RUN_DIRECTORY_DEFAULTS = {"log": "logs", "output": "output"} |
| tuple picurv_cli.core.RESERVED_DIRECTORY_FLAGS |
| tuple picurv_cli.core.RESERVED_INDIRECTION_FLAGS = ("-options_file", "-options_file_yaml", "-alias") |
| tuple picurv_cli.core.UNSAFE_DIRECTORY_CHARACTERS = ('"', "'", "#", "\n", "\r", "\t") |
| str picurv_cli.core.PHYSICAL_VERDICT_CONTAINED = "contained" |
| str picurv_cli.core.PHYSICAL_VERDICT_RELATIVE_ESCAPE = "relative_escape" |
| str picurv_cli.core.PHYSICAL_VERDICT_EXTERNAL_ABSOLUTE = "external_absolute" |
| picurv_cli.core.WAIVABLE_PHYSICAL_VERDICTS = frozenset({PHYSICAL_VERDICT_EXTERNAL_ABSOLUTE}) |
|
protected |
| str picurv_cli.core.RUNTIME_MEMORY_FILE = "Runtime_Memory.csv" |
| str picurv_cli.core.PROFILING_TIMESTEP_FILE = "Profiling_Timestep_Summary.csv" |
| dict picurv_cli.core.DIAGNOSTICS_PETSC_KEYS |
| tuple picurv_cli.core.PROGRAMMATIC_BRIDGE_GRID_KEYS |
| tuple picurv_cli.core.GRID_DA_PROCESSOR_KEYS = ("da_processors_x", "da_processors_y", "da_processors_z") |
| dict picurv_cli.core.IC_PAYLOAD_DIMENSIONS = {0: VELOCITY, 1: VOLUME_FLUX} |
| dict picurv_cli.core.GENERATED_IC_PROVIDERS |
| dict picurv_cli.core.PARTICLE_SETTABLE_FIELDS = {"Psi": 1} |
| tuple picurv_cli.core.PETSC_INDEX_BITS_CHOICES = ("32", "64") |
| dict picurv_cli.core.LES_MODEL_NAMES = {1: "constant_smagorinsky", 2: "dynamic_smagorinsky", 3: "vreman", 4: "wale"} |
| dict picurv_cli.core.LES_MODEL_OWNED_KEYS |
| dict picurv_cli.core.LES_MODEL_KEY_OWNER_DESCRIPTIONS |
| tuple picurv_cli.core.LES_AVERAGING_DIRECTION_AXES = ("i", "j", "k") |
| dict picurv_cli.core.SOLVER_MONITORING_POISSON_FLAG_MAP |
| dict picurv_cli.core.SOLVER_MONITORING_MOMENTUM_FLAG_MAP |
| dict picurv_cli.core.KRYLOV_KSP_TYPES |
|
protected |
| dict picurv_cli.core.ASSET_KIND_DIRECTORIES |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| dict picurv_cli.core.SUMMARY_TABLES |