Skip to content

Use rayon to parallelize the evaluation of the functional - #378

Merged
prehner merged 2 commits into
developmentfrom
rayon_dft
Aug 20, 2026
Merged

Use rayon to parallelize the evaluation of the functional#378
prehner merged 2 commits into
developmentfrom
rayon_dft

Conversation

@prehner

@prehner prehner commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Uses rayon to parallelize the evaluation of the Helmholtz energy density (and its derivatives) in DFT. The implementation uses chunks rather than zipping in order to avoid having to reimplement all DFT models.

Timings for some test cases:

2D (512x256) with rayon deactivated

Time spent calculating weighted densities:      0.95 s  ( 9.03 %)
Time spent calculating partial derivatives:     7.07 s  (67.56 %)
Time spent calculating functional derivative:   1.17 s  (11.16 %)
Time spent doing other stuff:                   1.28 s  (12.25 %)
                                              ---------------------
                                               10.47 s

2D (512x256) with rayon activated

Time spent calculating weighted densities:      1.00 s  (22.04 %)
Time spent calculating partial derivatives:     1.16 s  (25.50 %)
Time spent calculating functional derivative:   1.19 s  (26.28 %)
Time spent doing other stuff:                   1.19 s  (26.18 %)
                                              ---------------------
                                                4.53 s

1D (2048) not affected by the rayon feature

Time spent calculating weighted densities:      2.96 ms  (11.67 %)
Time spent calculating partial derivatives:    16.60 ms  (65.39 %)
Time spent calculating functional derivative:   2.55 ms  (10.04 %)
Time spent doing other stuff:                   3.27 ms  (12.90 %)
                                              ---------------------
                                               25.38 ms

@prehner
prehner force-pushed the rayon_dft branch 2 times, most recently from 7550c7f to 622f8ff Compare August 20, 2026 14:54
@prehner
prehner changed the base branch from dft_development to num_dual_update August 20, 2026 14:54
@prehner
prehner force-pushed the num_dual_update branch 3 times, most recently from f5483fd to c59bf1c Compare August 20, 2026 15:31
Base automatically changed from num_dual_update to development August 20, 2026 15:34
@prehner
prehner merged commit 3a06cc6 into development Aug 20, 2026
18 checks passed
@prehner
prehner deleted the rayon_dft branch August 20, 2026 15:45
@prehner
prehner restored the rayon_dft branch August 20, 2026 15:46
@prehner
prehner deleted the rayon_dft branch August 20, 2026 15:47
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