All path and parallelism settings in Forti4D flow through a single central module —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/acdeveloper-sci/forti4d/llms.txt
Use this file to discover all available pages before exploring further.
config.py. It defines three configurable values: the Fortran source directory, the output directory, and the worker count for parallel steps. Each value is resolved at runtime using a consistent priority chain: an explicit CLI flag always wins, followed by the corresponding environment variable, and finally a hardcoded default. This means you can configure a project once via environment variables for a whole session, or override everything on a single command line without touching your shell.
Configuration Reference
| Environment Variable | CLI Flag | Default | Description |
|---|---|---|---|
FORT_SRC | --project DIR | tests/fixtures/ | Path to the directory containing the Fortran source files to analyze. Resolved to a pathlib.Path at startup. |
FORT_OUT | --output DIR | results/ | Root directory where all output files are written — CSVs, audit files, block topology files, DOT graphs, the HTML report, and the run log. |
FORT_WORKERS | --workers N | 1 | Number of parallel worker processes for the steps that support per-file parallelism (inventory, profiler, blocks). Must be a positive integer; non-integer values fall back silently to 1. |
Priority Order
Each setting is resolved byconfig.resolve_paths() and config.resolve_workers() at call time using this fixed precedence:
Explicit CLI flag
Values passed directly to
--project, --output, or --workers always take highest priority and override everything else.Environment variable
If no CLI flag is provided, Forti4D reads
FORT_SRC, FORT_OUT, or FORT_WORKERS from the current environment.Setting via CLI Flags (Recommended)
The--project and --output flags are the most explicit and portable way to configure a run. They require no shell setup and work identically across platforms:
--project and --output into FORT_SRC and FORT_OUT in the process environment, so every analyzer automatically picks up the correct paths without needing separate configuration.
Setting via Environment Variables
Environment variables are useful for one-off runs or when integrating Forti4D into shell scripts and CI pipelines:Output Directory Creation
FORT_OUT (the results directory) is created automatically by the pipeline before any step runs. You do not need to create it manually. The call is equivalent to Path(results_dir).mkdir(parents=True, exist_ok=True), so nested paths like deep/nested/output/ work without pre-creating intermediate directories.
Subdirectories required by individual steps — audit/ and blocks/ — are also created on demand by the steps that write to them.
Output Directory Layout
After a complete pipeline run, the results directory contains the following structure:audit/
Per-file
*_DEBUG.csv files produced by the profiler step. Each file contains a line-by-line statement classification for one source file. Required by the blocks step and several downstream analyzers.blocks/
Per-file
*_blocks.txt block topology reports produced by the blocks step. One file per source file processed during the profiler step.graph_*.dot
Graphviz DOT files generated by the
visual_graph step. Includes a full call graph, a simplified call graph, and one DOT file per entry point. Render with dot -Tsvg graph_full.dot -o graph_full.svg.report.html
Self-contained HTML report produced by the
html_report step. Contains a filterable and sortable unit table with all collected metrics. No external assets required — open directly in a browser.report_consolidated.csv, report_prioritization.csv, inventory_report.csv, and others), the executive summary (PROJECT_SUMMARY.md), and the run log (forti4d.log).
| Path | Produced by | Description |
|---|---|---|
<FORT_OUT>/audit/ | profiler | Per-file DEBUG CSV files, one per source file |
<FORT_OUT>/blocks/ | blocks | Per-file block topology text files |
<FORT_OUT>/graph_*.dot | visual_graph | Graphviz call graph DOT files |
<FORT_OUT>/report.html | html_report | Self-contained HTML report |
<FORT_OUT>/forti4d.log | Pipeline startup | Full DEBUG-level run log |
When running through the
forti4d CLI, FORT_SRC and FORT_OUT are set automatically from --project and --output before any step executes. Individual analyzer scripts invoked outside the pipeline rely on the environment variables or the config.py defaults directly.