#478 Parallelization of Lindemann Index Calculation #479
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.
Description:
The current implementation of the Lindemann index calculation algorithm in the lindemann package is primarily executed in a serial manner, which limits its performance and scalability, especially for large datasets typically processed in high-performance computing (HPC) environments. The goal is to optimize the existing algorithm by introducing parallelization using Numba's just-in-time (JIT) compilation and parallel processing capabilities (numba prange).
Proposed Solution:
Enhance the performance of the Lindemann index calculation by implementing a parallel version of the algorithm using Numba. The key steps involved in this enhancement include:
Implementation of Parallel Variance Calculation:
Chunk-wise Processing:
Combining Results:
Code Implementation:
The following functions were developed in parallel_trj.py to achieve the parallelization:
parallel_variance
: Computes the variance in parallel using Welford's algorithm.calculate_chunk
: Processes a chunk of frames to compute mean and variance distances.calculate
: Divides the data into chunks and uses parallel processing to compute the Lindemann index.Benefits:
Next Steps: