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

Further improve GSD performance. #1541

Merged
merged 10 commits into from
May 1, 2023
Merged

Conversation

joaander
Copy link
Member

@joaander joaander commented Apr 28, 2023

Description

Add write buffers to further improve GSD performance.

Motivation and context

See glotzerlab/gsd#237.

Most users will not need to change the write buffer size. I make the API available so that users wishing to push the limits can increase the buffer size.

How has this been tested?

  • Existing unit tests pass after adding needed calls to flush().
  • Will report on performance tests on Frontier.

TODO:

  • Test and update tutorial notebooks as needed.

Change log

Added:

* ``hoomd.write.GSD.maximum_write_buffer_size`` - Set the maximum size of the GSD write buffer.
* ``hoomd.write.GSD.flush`` - flush the write buffer of an open GSD file.
* On importing ``hoomd``, install a ``SIGTERM`` handler that calls ``sys.exit(1)``.

Checklist:

Also move initFileIO to the constructor. This prevents the need for
double caching of the buffer size prior to opening the file.
Ensure that we do not rely on Python's garbage collector to ensure
that the file is written after the call to write() ends.
@joaander
Copy link
Member Author

Frontier performance (Orion) with 1 rank writing frames with N positions:

Log-only files show a massive improvement:

  • Default buffer size (64 MiB): 31134 frames/second
  • 256 MiB write buffer: 32028 frames/second
  • 1 byte buffer: 82 frames/second

The limitation here might be the index buffer limit. Perhaps we should re-implement the index buffer limit as a fraction of the write buffer so they scale together. Not that there is anything wrong with a 380x speedup, but there might be room for a little more.

Also check for errors in new GSD API calls.
@joaander joaander force-pushed the further-improve-gsd-performance branch from 34cee0a to 9c17fe5 Compare April 28, 2023 16:28
@joaander joaander added the validate Execute long running validation tests on pull requests label Apr 28, 2023
@joaander joaander marked this pull request as ready for review May 1, 2023 15:03
@joaander joaander requested review from a team, b-butler and pepak13 and removed request for a team May 1, 2023 15:03
Copy link
Member

@b-butler b-butler left a comment

Choose a reason for hiding this comment

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

LGTM

@joaander joaander enabled auto-merge May 1, 2023 18:35
@joaander joaander merged commit 0c5e8c8 into trunk-major May 1, 2023
@joaander joaander deleted the further-improve-gsd-performance branch May 1, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants