Skip to content

Add support for batching and parallelization#15

Merged
PardhavMaradani merged 3 commits into
MDAnalysis:mainfrom
PardhavMaradani:batching-and-parallelization
Jun 26, 2026
Merged

Add support for batching and parallelization#15
PardhavMaradani merged 3 commits into
MDAnalysis:mainfrom
PardhavMaradani:batching-and-parallelization

Conversation

@PardhavMaradani

@PardhavMaradani PardhavMaradani commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Changes made in this Pull Request:

  • Add batching support for analysis widgets
    • BufferedTrajectory wrapper for existing trajectory reader
    • Negative indexing to access last n timesteps in deque buffer
    • Added run_per_frame and run_batch handlers
  • Add parallelization support for analysis widgets
    • Run parallel jobs using joblib.Parallel in separate thread
    • Dynamically patch IMDReader to support serialization
    • Added get_parallel_job and apply_parallel_results handlers
  • Update ROG to support both per-frame and batch run frequencies
  • Update ROG to support both serial and parallel run modes
  • Use calc_bonds and center_of_mass with unwrap for COM distance
  • Move execute code support to use run_cell directly in core
  • Fix future resolve only for comm_msg message types
  • Tests for all new backend and frontend functionality
  • Added docs for all new methods and classes

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Hi @orbeckst, @jeremyleung521, @amruthesht, @HeydenLabASU,

This PR adds support for batching and parallelization of analysis widgets.

The existing ROG widget has been updated to support both per-frame and batch run frequencies along with serial and parallel run modes. All of these can also be changed dynamically at runtime as well.

Here is a screenshot of ROG running in all the different configurations:

mdadash-batch-parallel

ROG support both the run frequencies (per-frame / batch) and is configurable as shown below:

image

It also support both the run modes (serial / parallel) and is configurable as shown below:

image

The batch size is configurable under 'Universe Configuration' in Settings as shown below:

image

The number of parallel jobs is also configurable under 'Dashboard Configuration' in Settings as shown below:

image

Changes to the number of parallel jobs is dynamic and can be updated at runtime while the simulation is running.

Thanks

- Add batching support for analysis widgets
  - `BufferedTrajectory` wrapper for existing trajectory reader
  - Negative indexing to access last n timesteps in deque buffer
  - Added `run_per_frame` and `run_batch` handlers
- Add parallelization support for analysis widgets
  - Run parallel jobs using joblib.Parallel in separate thread
  - Dynamically patch `IMDReader` to support serialization
  - Added `get_parallel_job` and `apply_parallel_results` handlers
- Update ROG to support both `per-frame` and `batch` run frequencies
- Update ROG to support both `serial` and `parallel` run modes
- Use `calc_bonds` and `center_of_mass` with unwrap for COM distance
- Move execute code support to use `run_cell` directly in core
- Fix future resolve only for `comm_msg` message types
- Test for all new backend and frontend functionality
- Added docs for all new methods and classes
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c7c8729) to head (c549553).

Additional details and impacted files
Components Coverage Δ
frontend 100.00% <100.00%> (ø)
backend 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PardhavMaradani PardhavMaradani merged commit d0dbbe5 into MDAnalysis:main Jun 26, 2026
20 checks passed
@PardhavMaradani PardhavMaradani deleted the batching-and-parallelization branch June 26, 2026 07:00
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