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

Refactor SendBufferPosition, fail on query with rank outside of range #1421

Merged
merged 1 commit into from
Feb 19, 2020

Conversation

jakobj
Copy link
Contributor

@jakobj jakobj commented Feb 10, 2020

During code review with @suku248 we realized one could query the SendBufferPosition with ranks that are outside of the range for which a specific thread is responsible, returning nonsense values due to modulo arithmetic. This PR addresses that issue by adding two specific asserts.

Depends on #1416, should be merged after.

@hakonsbm @heplesser @jougs @stinebuu @jarsi

@@ -110,6 +114,8 @@ inline SendBufferPosition::SendBufferPosition( const AssignedRanks& assigned_ran
inline thread
SendBufferPosition::rank_to_index_( const thread rank ) const
{
assert( begin_rank_ <= rank );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are the important asserts

@terhorstd terhorstd added ZC: Kernel DO NOT USE THIS LABEL I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) ZP: PR Created DO NOT USE THIS LABEL S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. labels Feb 19, 2020
@heplesser
Copy link
Contributor

Reviewed in VC by @suku248, @terhorstd, @heplesser, merging without further review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. ZC: Kernel DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants