Skip to content

Render graphs in parallel - #740

Open
jacobwilliams wants to merge 2 commits into
Fortran-FOSS-Programmers:masterfrom
jacobwilliams:118-parallel-graphs
Open

jacobwilliams wants to merge 2 commits into
Fortran-FOSS-Programmers:masterfrom
jacobwilliams:118-parallel-graphs

Conversation

@jacobwilliams

@jacobwilliams jacobwilliams commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Speed up the "Generating graphs" stage on large projects by running them in parallel.

Disclaimer: this is from Claude Opus 5.5. It seems to work for me, but should be checked. The graph generating was a huge bottleneck for large projects, so this should be a good feature to have.

Fixes #118

Also Fixes #741

jacobwilliams and others added 2 commits October 3, 2026 09:28
Running graphviz was done serially when each graph was constructed,
and dominated the "Generating graphs" stage on large projects.

Graph construction now only builds the dot source; `FortranGraph.render`
runs graphviz, and `GraphManager.graph_all` renders all graphs using a
thread pool sized by the `parallel` setting (0 still means serial).
Since rendering happens in a subprocess, threads give real parallelism
without needing to pickle the graphs. `svg_src` and `scaled` render
lazily if accessed before an explicit render.

`output_graphs` uses the same thread pool instead of `process_map`.
This fixes saving graphs to `graph_dir`, which with the default
`parallel` setting failed to pickle the graphs and wrote no files.
Procedures' "uses" graphs are now also saved.

Also remove the unused `Documentation.parallel` attribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
json-fortran, FLAP, FiNeR, and VTKFortran have all moved or removed
their Ford project files upstream, causing the corpus regression tests
to fail before Ford parsed anything:

- json-fortran: `json-fortran.md` -> `ford.md`
- FLAP, FiNeR, VTKFortran: `doc/main_page.md` -> `docs/ford.md`

Fixes Fortran-FOSS-Programmers#741
@jacobwilliams

Copy link
Copy Markdown
Member Author

@Fortran-FOSS-Programmers/contributors any takers for a reviewing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_corpus currently broken Using multiple cores

1 participant