Skip to content

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

Draft
prehner wants to merge 1 commit into
dft_developmentfrom
rayon_dft
Draft

Use rayon to parallelize the evaluation of the functional#378
prehner wants to merge 1 commit into
dft_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

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