Skip to content

Commit

Permalink
Add links to parallelization docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelLerchner committed Jan 22, 2024
1 parent 9d2a595 commit 63367ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/Parallelization.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ If the `DirectSumContainer` is used, the parallelization is done by neglecting t
For the `LinkedCellsContainer`, there are two parallelization methods available, which can be selected before compiling using the cmake option `PARALLEL_V2_OPT`.:

1. Parallelization by domain splitting (`PARALLEL_V2_OPT=OFF`, default):
- See: [Pull Request #95](https://github.com/ManuelLerchner/MolSim-WS23-24/pull/95)
- The simulation domain is split into multiple groups of cells, which ensure that no two threads access the same particles at the same time.
- Individial groups get executed sequentially. But all cells of that group are updated in parallel using all available threads.
- The cell-spacing of this approach assures that two conflicting cells will never be executed concurrently. And therefore no locks or synchronization are needed.
- Individial groups get executed sequentially. But all cells of that group are updated in parallel using all available threads.
- The cell-spacing of this approach assures that two conflicting cells will never be executed concurrently. And therefore no locks or synchronization are needed.
- The optimization using Newton's third law is still possible without further complications.
- This method has basically no overhead. Except a minor reduction in cache locality.

2. Parallelization by particle locking (`PARALLEL_V2_OPT=ON`):
- See: [Pull Request #97](https://github.com/ManuelLerchner/MolSim-WS23-24/pull/97)
- Each particle has a lock, which is used to ensure that no two threads access the same particle at the same time.
- The execution of force calculations is randomized: A random cell is picked which calculates all the forces for its particles
- During each update both affected particles are locked.
- During each update both affected particles are locked.
- The randomization helps to pick mostly indepent particle pairs so that the wait time for each thread is kept small.
- The drawback of this method is the overhead due to the locking of the particles

0 comments on commit 63367ea

Please sign in to comment.