Skip to content

Shared memory parallelization for the bond loop#5244

Merged
jngrad merged 87 commits intoespressomd:pythonfrom
hidekb:bond_shared_memory
Apr 1, 2026
Merged

Shared memory parallelization for the bond loop#5244
jngrad merged 87 commits intoespressomd:pythonfrom
hidekb:bond_shared_memory

Conversation

@hidekb
Copy link
Copy Markdown
Contributor

@hidekb hidekb commented Feb 2, 2026

Description of changes:

  • Convert arrays of structs (AoS) to structs of arrays (SoA) to improve the performance of the bond loop.
  • The bond loop is decomposed into three distinct components, namely pair bond, angular relationships, and dihedral configurations.

@RudolfWeeber
Copy link
Copy Markdown
Contributor

Given the rather large number of member variables this adds to the CellStructure, would it be possible to move all the bond list managment business inclduing the clearing/allocating functions into its own class, say LocalBondState and only hold the unique pointer to that in the CellStructure?

@hidekb
Copy link
Copy Markdown
Contributor Author

hidekb commented Mar 26, 2026

What ws the reason for the additoin of kvisc=[nearly ero] in the oif_volume_conservation test?

I modified the implementation within the conditional branch if (kvisc > tiny_oif_elasticity_coefficient), and the accompanying test script must execute this path to satisfy coverage requirements. The comment within this branch indicates that it is not fully implemented. Hence, we may disable it entirely by commenting it out. At the time, I used a very small value of kvisc for preliminary testing.

@hidekb
Copy link
Copy Markdown
Contributor Author

hidekb commented Mar 27, 2026

Given the rather large number of member variables this adds to the CellStructure, would it be possible to move all the bond list managment business inclduing the clearing/allocating functions into its own class, say LocalBondState and only hold the unique pointer to that in the CellStructure?

I refactored the code. Now, variable- and function-related bond storage has been moved from CellStructure to LocalBondState.

RudolfWeeber
RudolfWeeber previously approved these changes Mar 31, 2026
@jngrad jngrad self-assigned this Mar 31, 2026
Copy link
Copy Markdown
Member

@jngrad jngrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node-level performance improvement: a LJ simulation with harmonic bonds is now faster with 4 OpenMP threads and 1 MPI rank vs. 1 OpenMP thread and 4 MPI ranks.

@jngrad jngrad added this to the ESPResSo 5.1 milestone Apr 1, 2026
@jngrad jngrad merged commit 95999fa into espressomd:python Apr 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants