Bug fix: zero-length write request to a record variable in a collective put API - #239
Open
wkliao wants to merge 3 commits into
Open
Bug fix: zero-length write request to a record variable in a collective put API#239wkliao wants to merge 3 commits into
wkliao wants to merge 3 commits into
Conversation
varp is needed to tell if a variable is a record variable. With this change, varid must be valid when reaching to put_varm(). Another fix is required to return error earlier in dispatcher when a invalid varid is detected.
When writing to a record variable, a collective call to MPI_Allreduce() is necessary to update and sync-ed the number of records among all processes. For fix-sized variables, such a call to MPI_Allreduce() is not necessary. The argument varid of a put API supplied by the user may point to either a fix-sized or record variable. Because there is no way to tell if an invalid varid is a fix-sized variable or a record variable, there is no consistent if-condition can be devised to determine whether to call MPI_Allreduce(). The solution adopted by this commit adds a call to MPI_Allreduce() to check the error returned from sanity_check(), which unfortunately adds some communication cost. Luckily, this fix is only necessary for collective blocking put APIs.
…put API This test program, provided by Blaise Bourdin, calls a collective blocking put API to write to a record variable where one of the processes makes a zero-length request. When writing to a record variable, PnetCDF calls MPI_Allreduce to update and sync the number of records among all processes. If a subset of the processes has a zero-length request, these processes may not participate the call to MPI_Allreduce, causing program to hang. See PR Parallel-NetCDF#239.
This file contains hidden or 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
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.
This PR fixes the issue reported in #238