SimVascular / SimVascular/svZeroDSolver

Minor feature request: streaming SAX reader for json input files

Open
#207 4 comments 0 reactions 1 assignee View on GitHub

@zasexton is already working on this.

Since Dec 4, 2025.

enhancement
Dominant language
C++
Stars
22
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Problem

When running very large models (millions of blocks / DOFs) the solver currently needs to hold the entire solver.in JSON file in memory at once. On HPC systems with per‑process memory limits, this can contribute to high memory usage and, in some cases, out‑of‑memory failures before the actual simulation starts. This is especially noticeable for large synthetic vascular trees where the JSON file itself is very large (~2 million vessel blocks).

Solution

Add support for a streaming / SAX‑style JSON reader for the main configuration file so that:

  • The solver does not need to materialize the full JSON DOM in memory at once.
  • Blocks, vessels, and boundary conditions can be constructed incrementally as the file is read.
  • Memory usage during input parsing scales with the size of the “active” portion being processed, rather than with the size of the entire JSON file.

Ideally this would be implemented using a streaming API (nlohmann::json SAX interface or a similar streaming parser) behind the existing configuration loading functions, so that the rest of the code can remain largely unchanged.

Additional context

We used this approach to run large synthetic vascular models on the order of 4,000,000+ blocks and ~8,000,000 DOFs on Sherlock; however this has not yet been integrated with the main branch. The JSON configuration file for these cases is very large, and a streaming reader kept the input stage memory footprint under control and within per‑process memory limits otherwise OOM failures are seen.

Code of Conduct
  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.