-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix gatherv overflow when the combined packed mesh size exceeds 2^31. #117
Merged
Algiane
merged 10 commits into
develop
from
wissambouymedj-feature/fix-centralized-output
Aug 6, 2024
Merged
Fix gatherv overflow when the combined packed mesh size exceeds 2^31. #117
Algiane
merged 10 commits into
develop
from
wissambouymedj-feature/fix-centralized-output
Aug 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…in PMMG_gather_parmesh exceeds INT_MAX This problem occurs when the size of the first np-1 of the compressed mesh parts exceeds INT_MAX. This commit introduces an error message for this circumstance, which replaces an error on a negative allocation size. It also shows the allocation size in the error message for allocation failur so that this kind of problem is easier to diagnose.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #117 +/- ##
===========================================
+ Coverage 63.07% 63.10% +0.02%
===========================================
Files 46 46
Lines 18955 18960 +5
Branches 3542 3544 +2
===========================================
+ Hits 11956 11964 +8
+ Misses 6073 6071 -2
+ Partials 926 925 -1 ☔ View full report in Codecov by Sentry. |
- If ran using 1 mpi process, the rcv_buffer variable has to be filled by the packed parmesh; - the pointer toward the buffer provided to the mpipack_parmesh function is modified by the function so cannot be used anymore after the function call.
… larger than INT_MAX.
Algiane
force-pushed
the
wissambouymedj-feature/fix-centralized-output
branch
from
August 6, 2024 09:54
7351df6
to
84be939
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix gatherv overflow when the combined packed mesh size exceeds 2^31.
In this case, the array of displacements provided to
MPI_gatherv
overflow the INT32_MAX value while the function expect an array ofint32_t
.This PR follows on from the PRs #113 and #114 that have to be credited to @mpotse and @wissambouymedj.
Fix
The gatherv has been replaced by MPI_Send / Recv calls.
Validation
-DENABLE_GATHERV
, the program calls thegatherv
function, otherwise it calls thesend/recv
ones. The integer type of arraysdispls
andbuf_idx
as to be defined when building the program (-DINT_TYPE=int
or-DINT_TYPE=
size_t`)INT_TYPE
defined tosize_t
we can obxerve the gatherv failure while thesend/recv
messages succeed.Todo
The mesh packing inside a char array implies that we need large intergers to store the message size. An alternative that was implemented in the past (and was working I think) used hierarchical
MPI_Struct
to define the C structures used in the mesh (points, xpoints, tetra...) as well as the mesh itself. It should allow to easier the mesh communication and to reduce the size of the integer used to provide the message size (because the MPI structures will be larger than chars which is the minimal unit for the type of variables).See issue #118