Memory Optimized HPC #97
Open
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.
Memory Optimized HPC
Overview
This PR optimizes memory usage in our HPC code by updating the Blob exchange operators to use a single unified container with ghost cells rather than maintaining separate containers for the original core data and the exchanged (ghost-expanded) data. In our 1-processor tests, the total allocated memory dropped from approximately 15.63 GB down to 14.53 GB—yielding about a 1 GB improvement. In a 4-processor run, memory usage in BlobExchangeOP dropped nearly by half.
Changes
1. BlobsExchangeOP Updates
The operator now uses a single container (
_vecAllBlobsWithGhosts) that is initialized with the core data. Only even-numbered processors (the “prime” processors) lazily expand this container to include extra ghost columns before the exchange.Instead of preallocating ghost cells in the constructor, the container is expanded only in
StartExchange()on even-numbered processors. InEndExchange(), these processors merge the received ghost data into the expanded container. Odd-numbered processors (which send data) keep their container unchanged.2. BlobBoxesDegExchangeOP Updates
Similarly, BlobBoxesDegExchangeOP now maintains a single unified container (
_vecAllBlobBoxesDegWithGhosts).3. TagExchangeOP Design
TagExchangeOP still maintains separate “original” versus “exchanged” Tag data. This decision is based on:
GlobalTimefor each Tag. Keeping a clean copy of the core data simplifies this update process and minimizes potential errors.Testing