Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce MPI communication overhead #4414

Merged
merged 12 commits into from
Mar 28, 2022
Merged

Reduce MPI communication overhead #4414

merged 12 commits into from
Mar 28, 2022

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Jan 3, 2022

Fixes #4415, fixes #3638

Description of changes:

  • mark classes Utils::Array, Utils::Vector and Utils::Quaternion as MPI datatypes and bitwise serializable
  • remove MPI communication overhead for Utils::Vector and Particle by removing tracking information and metadata
  • check in unit tests that all Particle substructs are bitwise serializable
  • use compact vectors for the bond list and exclusion list

For a LJ fluid simulation, the speed-up is around 8% on maxset configuration and 3% on empty configuration.

Re-order struct data members to reduce padding. New sizes in bytes:
sizeof(Particle): 624 -> 592
sizeof(ParticleLocal): 48 -> 40
sizeof(ParticleProperties): 328 -> 304
sizeof(StoredParticleProperty): 24 -> 16
Since the size of Array and Vector objects is known at compile time,
it doesn't have to be communicated. This spares an integer and a
prefix code during MPI communication operations, thus reducing the
serialization buffer size by 33% for Vector3i (from 24 to 16 bytes)
and by 22% for Vector3d (from 36 to 28 bytes).
jngrad added 7 commits January 3, 2022 14:38
Change the Boost serialization object class info to elide two
short ints (version for Utils::detail::Storage and Utils::Array),
thus reducing the serialization buffer size by 25% for Vector3i
(from 16 to 12 bytes) and by 14% for Vector3d (from 28 to 24 bytes).
Since Array and Vector objects are not communicated by pointers,
it is not necessary for Boost to track double deserialization.
@jngrad jngrad force-pushed the fix-4415 branch 2 times, most recently from 52c7295 to d525961 Compare January 3, 2022 15:47
@jngrad jngrad changed the title Improve Vector and Particle serialization Reduce MPI communication overhead Jan 3, 2022
Provide a mechanism to walk through a serialization tree recursively
to check for a specific trait. Check that all fixed-length members
of the Particle struct are statically serializable. The std::vector
objects should be the only non-statically serializable members.
@jngrad jngrad marked this pull request as ready for review March 17, 2022 17:55
@jngrad jngrad added this to the Espresso 4.2 milestone Mar 22, 2022
@jngrad jngrad requested a review from reinaual March 22, 2022 13:57
reinaual
reinaual previously approved these changes Mar 28, 2022
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jngrad jngrad added the automerge Merge with kodiak label Mar 28, 2022
@kodiakhq kodiakhq bot merged commit 4a5022a into espressomd:python Mar 28, 2022
@jngrad jngrad deleted the fix-4415 branch March 28, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MPI communication overhead Make use of boost container custimization
2 participants