perf: параллельный расчёт физики через OpenMP#40
Open
kranks-uga wants to merge 4 commits into
Open
Conversation
|
Я бы использовал OneAPI TBB, он быстрее и стабильнее, хоть и новая зависимость, но хорошую вычислительную систему без OneAPI сложно представить. |
Author
|
perf: replace OpenMP with Intel oneAPI TBB Перешел на TBB. |
Owner
Merged main into perf/openmp-physics to resolve broken build caused by partial World architecture adoption in the TBB commit. TBB parallelization and vectorization fixes (ivdep + __restrict__ in lambda captures) preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Я сам, не понял в чем проблема потому решил оботиться к claude. |
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.

Добавил параллельное выполнение физики через OpenMP. симуляция теперь
использует все ядра процессора.
Что изменено:
расчёт сил между атомами (ForceField.cpp)
построение списка соседей (NeighborList.cpp)
шаг интегратора (VerletScheme.cpp)
подключение OpenMP в сборке (CMakeLists.txt)
Главная сложность была в том, что расчёт сил использует третий закон
Ньютона — каждая пара атомов пишет силу сразу в два места одновременно.
Поэтому я решил создать буфер на каждый поток дабы не было гонки данных.
В конце всё суммируеться
Ожидаемое ускорение: 4–8× на 8-ядерном процессоре при 50k+ атомов.(Сам я не проверял)