Skip to content

Optimize gRASPA batch setup with CIF caching and parallel processing#9

Merged
tdpham2 merged 1 commit into
mainfrom
feature/optimize-graspa-batch-setup
May 26, 2026
Merged

Optimize gRASPA batch setup with CIF caching and parallel processing#9
tdpham2 merged 1 commit into
mainfrom
feature/optimize-graspa-batch-setup

Conversation

@tdpham2

@tdpham2 tdpham2 commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Cache cell size computation per CIF file — each CIF is read once instead of once per (T, P) combination (e.g. 1 read instead of 104 for 4 temps x 26 pressures)
  • Process CIFs in parallel using ThreadPoolExecutor
  • Add --workers CLI flag and max_workers YAML config option to control parallelism

Files changed

  • src/matkit/graspa/graspa.py — add cell_size param to setup_simulation, new _setup_single_cif helper, refactor setup_batch with caching + threading
  • src/matkit/cli.py — add --workers option to batch-setup command
  • scripts/graspa/isotherm_config.yaml — add max_workers config
  • scripts/graspa/setup_isotherms.py — pass max_workers through to setup_batch

Test plan

  • All 10 existing gRASPA tests pass
  • Run matkit graspa batch-setup with a CIF directory and verify output matches previous behavior
  • Verify --workers flag controls thread count

Cache cell size computation per CIF so it is read once instead of once
per (T, P) combination. Process CIFs in parallel using ThreadPoolExecutor.
Add --workers CLI flag and max_workers YAML config option.
@tdpham2 tdpham2 merged commit 726ff69 into main May 26, 2026
5 checks passed
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.

1 participant