Introduce Deterministic Frame Map-Reduce Execution for Scalable LevelDAG Processing#359
Merged
harryswift01 merged 4 commits intoJun 16, 2026
Merged
Conversation
jimboid
approved these changes
Jun 16, 2026
jimboid
left a comment
Member
There was a problem hiding this comment.
This PR brings a necessary refactor to enable further enhancements to the parallel execution model. The PR is complete with the required code changes, docs and unit tests completed in one pass. The regression tests have not changed which is a very healthy sign that the changes brought here, although extensive are still delivering the same scientific outputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the hierarchy-level frame execution pathway into a deterministic frame/chunk map-reduce architecture.
The main purpose is to separate workflow orchestration from frame execution, Dask scheduling, worker task construction, and parent-side reduction.
LevelDAGnow owns the high-level workflow order, while the newlevels.executionpackage owns chunking, scheduling, worker-side frame tasks, and deterministic reduction of covariance and neighbour outputs.This PR also moves frame-dependent neighbour counting into the frame/chunk execution path, so each frame task now computes both covariance and neighbour-count contributions. Conformational/dihedral map-reduce is intentionally left for a follow-up PR.
Changes
Add frame map-reduce execution layer:
CodeEntropy.levels.executionpackage for frame execution infrastructure.chunk_frame_indices.ExecutionPolicyto keep chunk size and in-flight task limits internal.FrameSchedulerto choose between serial execution and Dask execution.Move reduction out of
LevelDAG:CovarianceReducer.NeighborReducer.LevelDAG.Move neighbour counts into the frame path:
Simplify
LevelDAGandFrameGraphresponsibilities:LevelDAGnow focuses on static setup, neighbour metadata initialisation, frame-stage delegation, and finalisation.FrameGraphnow only owns frame-local DAG execution and trajectory positioning.LevelDAGprivate helpers for Dask execution and covariance reduction.Update tests and documentation:
Impact
LevelDAGcomplexity by moving low-level execution and reduction details into dedicated modules.