Memory Optimization for Hcontainer Class in Parallel Execution #6459
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.
This pull request addresses issue #6377
7d4fe5a
Modify the transfer function
transfer_dm_2d_to_gint. Removed the temporary variable dm_full when transitioning from serial to 2D block parallelism in Hcontainer. At the same time, update thegint_old.cppfile accordingly.A temporary variable DM2D_tmp was created to split the 2D block parallel dm into smaller blocks, which are then handled by DM2D_tmp. The function transferParallels2Serials is directly called to convert DM2D_tmp into dm_gint. This approach avoids the large memory consumption that would occur if a large matrix dm_full was first used to hold DM2D and then split into smaller matrices dm_gint.
some detail need to modify
b5a0f8f
Delete the function that fills the lower triangle matrix when nspin=4, and integrate it into function
transfer_hr_gint_to_hR.Following a similar approach as described above, the temporary variable
hr_gint_full, which was used in the conversion of HContainer from serial to 2D block distributed parallel layout, has been removed. Instead, a smaller auxiliary matrixhR_tmpis now used to partitionhRinto blocks, facilitating the type conversion. The data transfer path has been changed from the originalhr_gint_part → hr_gint_full → hRtohr_gint_part → hR_tmp → hR.todo: