PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
Configuration Reference: Monitor YAML

For the full commented template, see:

# ==============================================================================
#                 PICurv Master Monitor Configuration Template
# ==============================================================================
#
# PURPOSE:
# This file defines the OBSERVATION and DATA MANAGEMENT strategy for a SOLVER run.
# It controls console verbosity, performance profiling, I/O frequency, and
# detailed monitoring of the numerical solvers.
#
# IMPORTANT:
# Changing this file will NEVER change the scientific result of the simulation.
# It only changes what is observed and recorded.
#
# ==============================================================================

# ==============================================================================
# 1. LOGGING
#    Controls what is printed to the console and saved in the main .log file.
# ==============================================================================
logging:
  # --- Verbosity Level ---
  # Sets the master LOG_LEVEL for the C-code.
  # Options: ERROR, WARNING, INFO, DEBUG, TRACE, VERBOSE
  # WARNING is the production default: quiet runtime, still shows warnings.
  # The startup banner remains visible and reports walltime-guard status.
  # Runtime metrics such as logs/search_metrics.csv may still be written even
  # when console verbosity stays low.
  verbosity: WARNING

  # --- Function Allow-List ---
  # For targeted debugging. If this list is empty, picurv omits the whitelist
  # file so the C runtime falls back to its built-in default allow-list.
  # Example: allow-list LOG_SEARCH_METRICS with DEBUG verbosity when you want
  # compact console summaries in addition to the always-written
  # logs/search_metrics.csv artifact for particle-enabled runs.
  enabled_functions: []

# ==============================================================================
# 2. PROFILING
#    Controls the performance measurement system.
# ==============================================================================
profiling:
  # --- Per-Step Profiling Output ---
  # Controls whether timestep-level profiling rows are written to a dedicated file.
  # mode:
  #   off      -> no timestep profiling output
  #   selected -> write only the listed functions
  #   all      -> write every instrumented function that ran that step
  timestep_output:
    mode: "off"
    # functions:
    #   - AdvanceSimulation
    #   - Flow_Solver
    file: "Profiling_Timestep_Summary.csv"

  # --- Final Profiling Summary ---
  # Controls the end-of-run aggregated profiling summary file.
  final_summary:
    enabled: true

# ==============================================================================
# 3. DIAGNOSTICS
#    Controls PETSc-native diagnostics and the compact runtime memory log.
# ==============================================================================
diagnostics:
  petsc:
    # These options are passed on the solver/postprocessor command line so
    # PETSc sees them during PetscInitialize().
    # Example:
    #   malloc_debug: true  -> executable arg: -malloc_debug
    #   log_view: true      -> executable args: -log_view :runs/<run_id>/logs/PETSc_LogView_Solver.log
    #   objects_dump: all   -> executable args: -objects_dump all
    malloc_debug: false
    malloc_test: false
    malloc_dump: false
    # Boolean true uses run-local default log files where PETSc supports file
    # output. A non-empty string can override the PETSc viewer/path.
    malloc_view: false
    malloc_view_threshold: null
    memory_view: false
    log_view: false
    log_view_memory: false
    log_all: false
    log_trace: false
    objects_dump: false
    options_left: null

  runtime_memory_log:
    # This custom PICurv log is emitted from the runtime through control-file
    # flags, independent of PETSc-native diagnostics above.
    enabled: true
    file: "Runtime_Memory.log"

# ==============================================================================
# 4. I/O AND DATA MANAGEMENT
#    Controls data file generation and locations for the SOLVER.
# ==============================================================================
io:
  # --- Frequency Control ---
  # How often data is written or printed, measured in timesteps.
  
  # Frequency for saving full simulation field data (for restarts/post-processing).
  # [Integer] -> -tio
  data_output_frequency: 100

  # Frequency for printing particle snapshots into the main solver log.
  # If omitted, picurv uses data_output_frequency. Set to 0 to disable periodic
  # particle console snapshots entirely.
  # [Non-negative Integer] -> -particle_console_output_freq
  particle_console_output_frequency: 100

  # --- Particle Tracking Row Subsampling ---
  # Within each particle console snapshot, print only every Nth particle row.
  # [Integer] -> -logfreq
  particle_log_interval: 50

  # --- Directory Management ---
  # Specifies subdirectory names within the run folder. If omitted, C-code
  # defaults will be used.
  directories:
    output: "output"    # [string] -> -output_dir
    restart: "restart"  # [string] -> -restart_dir
    log: "logs"         # [string] -> -log_dir
    eulerian_subdir: "eulerian"  # [string] -> -euler_subdir
    particle_subdir: "particles" # [string] -> -particle_subdir

# ==============================================================================
# 5. SOLVER MONITORING (PASSTHROUGH)
# ==============================================================================
#
# This section exposes common solver-monitor controls with readable names.
# PICurv maps these keys to the C/PETSc flags written into the generated
# `.control` file.
#
# For advanced one-off PETSc flags, keep them under `petsc_passthrough_options`.
#
# ==============================================================================
solver_monitoring:
  poisson:
    # Custom PICurv pressure-correction residual monitor.
    pic_true_residual: true       # -> -ps_ksp_pic_monitor_true_residual
    # PETSc's standard true residual monitor.
    true_residual: false          # -> -ps_ksp_monitor_true_residual
    # Print the KSP convergence/divergence reason.
    converged_reason: true        # -> -ps_ksp_converged_reason
    # View the pressure-correction KSP object configuration.
    view: false                   # -> -ps_ksp_view

  petsc_passthrough_options:
    # Raw escape hatch for PETSc monitor/debug flags not yet exposed above.
    # Boolean true emits a switch-only flag; false omits it.
    # -ps_pc_svd_monitor: true
    # -ts_monitor: true

monitor.yml controls observability, diagnostics, and run I/O behavior.

1. io

io:
data_output_frequency: 100
particle_console_output_frequency: 100
particle_log_interval: 10
directories:
output: "output"
restart: "restart"
log: "logs"
eulerian_subdir: "eulerian"
particle_subdir: "particles"

Mappings:

  • data_output_frequency -> -tio
  • particle_console_output_frequency -> -particle_console_output_freq
  • particle_log_interval -> -logfreq
  • directories.output -> -output_dir
  • directories.restart -> -restart_dir
  • directories.log -> -log_dir
  • directories.eulerian_subdir -> -euler_subdir
  • directories.particle_subdir -> -particle_subdir

Semantics:

  • data_output_frequency controls file/restart output cadence.
  • particle_console_output_frequency controls how often particle snapshots are printed to the main log.
  • particle_log_interval controls row subsampling within each particle snapshot.
  • If particle_console_output_frequency is omitted, picurv defaults it to data_output_frequency.
  • If particle_console_output_frequency is 0, periodic particle console snapshots are disabled.

2. logging

logging:
verbosity: "WARNING"
enabled_functions: []
  • verbosity maps to environment variable LOG_LEVEL via picurv launcher.
  • enabled_functions is serialized into whitelist.run only when non-empty.
  • If enabled_functions is empty, picurv omits whitelist.run and the C runtime falls back to its default allow-list.
  • An explicitly provided whitelist.run must contain at least one function name; an empty whitelist file is invalid.
  • config/monitors/Standard_Output.yml uses WARNING with an empty allow-list for quiet production runs; the startup banner still reports the walltime-guard status.
  • Some runtime artifacts are independent of console verbosity. For particle-enabled runs, logs/search_metrics.csv is written automatically and includes both raw search counters and derived signals such as search_failure_fraction, search_work_index, and re_search_fraction; allow-listing LOG_SEARCH_METRICS only affects the optional compact console summary.
  • Use Search Robustness Metrics Reference for the exact metric definitions and formulas.

Supported verbosity strings:

  • ERROR
  • WARNING
  • INFO
  • DEBUG
  • TRACE
  • VERBOSE

3. profiling

profiling:
timestep_output:
mode: "selected"
functions:
- Flow_Solver
- AdvanceSimulation
file: "Profiling_Timestep_Summary.csv"
final_summary:
enabled: true

Rules:

  • timestep_output.mode:
    • off: disable per-step profiling output
    • selected: write only the listed functions each timestep
    • all: write all instrumented functions seen in a timestep
  • timestep_output.functions is required only when mode: selected
  • timestep_output.file sets the filename written under the run logs/ directory
  • final_summary.enabled controls the end-of-run ProfilingSummary_*.log file

4. diagnostics

Structured diagnostics for PETSc memory/object/function debugging plus a compact PICurv runtime memory log:

diagnostics:
petsc:
malloc_debug: false
malloc_test: false
malloc_dump: false
malloc_view: false
malloc_view_threshold: null
memory_view: false
log_view: false
log_view_memory: false
log_all: false
log_trace: false
objects_dump: false
options_left: null
runtime_memory_log:
enabled: true
file: "Runtime_Memory.log"

Rules:

  • PETSc initialization-time diagnostics such as malloc_debug and malloc_test are passed on the executable command line, not only through the generated .control file.
  • For example, this YAML:
diagnostics:
petsc:
malloc_debug: true
log_view: true
objects_dump: "all"

adds PETSc startup arguments like:

-malloc_debug -log_view :runs/<run_id>/logs/PETSc_LogView_Solver.log -objects_dump all

for the solver stage, with analogous PostProcessor log names for post runs.

  • malloc_view, log_view, and log_trace accept false, true, or a non-empty PETSc viewer/path string. When set to true, PICurv writes run-local defaults such as logs/PETSc_MallocView_Solver.log, logs/PETSc_LogView_Solver.log, and matching PostProcessor files.
  • objects_dump accepts false, true, or all.
  • options_left accepts true, false, or null; use null to omit the PETSc option entirely.
  • PETSc diagnostics that support output files use run-local defaults under logs/, with solver/postprocessor-specific filenames. Boolean-only PETSc diagnostics remain in the captured solver/post stream logs.
  • runtime_memory_log writes a rank-reduced, terminal-readable log with max process/PETSc allocation signals per step.
  • picurv summarize reports the latest runtime memory signals when the log is present.

5. solver_monitoring

Human-readable solver monitor controls. PICurv maps these keys to the raw C/PETSc flags written into the generated .control file:

solver_monitoring:
poisson:
pic_true_residual: true
true_residual: false
converged_reason: true
view: false
petsc_passthrough_options:
-ps_pc_svd_monitor: false

Mappings:

  • poisson.pic_true_residual -> -ps_ksp_pic_monitor_true_residual
  • poisson.true_residual -> -ps_ksp_monitor_true_residual
  • poisson.converged_reason -> -ps_ksp_converged_reason
  • poisson.view -> -ps_ksp_view

Rules:

  • The structured poisson.* keys are booleans.
  • petsc_passthrough_options remains available for raw PETSc flags not yet exposed as structured YAML. In passthrough, true emits a switch-only flag, false omits the flag, and non-boolean values emit flag value.
  • solver_monitoring is written into the generated .control file and consumed during solver setup, while diagnostics.petsc is placed on the executable command line for PETSc initialization-time diagnostics.
  • Legacy direct flag entries under solver_monitoring are still accepted for compatibility, but new profiles should prefer the structured form above.

6. Next Steps

Proceed to Configuration Reference: Postprocessor YAML.

Also see:

CFD Reader Guidance and Practical Use

This page describes Configuration Reference: Monitor YAML within the PICurv workflow. For CFD users, the most reliable reading strategy is to map the page content to a concrete run decision: what is configured, what runtime stage it influences, and which diagnostics should confirm expected behavior.

Treat this page as both a conceptual reference and a runbook. If you are debugging, pair the method/procedure described here with monitor output, generated runtime artifacts under runs/<run_id>/config, and the associated solver/post logs so numerical intent and implementation behavior stay aligned.

What To Extract Before Changing A Case

  • Identify which YAML role or runtime stage this page governs.
  • List the primary control knobs (tolerances, cadence, paths, selectors, or mode flags).
  • Record expected success indicators (convergence trend, artifact presence, or stable derived metrics).
  • Record failure signals that require rollback or parameter isolation.

Practical CFD Troubleshooting Pattern

  1. Reproduce the issue on a tiny case or narrow timestep window.
  2. Change one control at a time and keep all other roles/configs fixed.
  3. Validate generated artifacts and logs after each change before scaling up.
  4. If behavior remains inconsistent, compare against a known-good baseline example and re-check grid/BC consistency.