Particle Ids: Add int Constants#3338
Merged
WeiqunZhang merged 1 commit intoAMReX-Codes:developmentfrom Jun 6, 2023
Merged
Conversation
Ideally we do not need them, because 2B particles generated per GPU is very low, but we do need this temporarily until we find a way to generalize large id values again for pure SoA particle layouts.
| next = the_next_id++; | ||
|
|
||
| if (next > LastParticleID) | ||
| if (next > IntParticleIds::LastParticleID) |
Member
There was a problem hiding this comment.
If the user adds particles in large batches, then this check could miss an overflow after which next would be negative.
Member
Author
There was a problem hiding this comment.
Yes, fully agree. I am doubtful about a lot of these checks here.
The same problem is present for the (signed) Long ids.
I guess the idea about those is that one catches at least some problem if assigning ids contiguously. One could improve the checks here (and for the Longs) slightly by checking hat a next id is also not negative. But probably a separate PR.
Member
Author
|
ping @atmyers @AlexanderSinn ready to merge? :) |
WeiqunZhang
approved these changes
Jun 6, 2023
WeiqunZhang
added a commit
to WeiqunZhang/amrex
that referenced
this pull request
Jun 6, 2023
Explicitly convert amrex::Long to int.
ax3l
pushed a commit
that referenced
this pull request
Jun 6, 2023
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.
Summary
Ideally we do not need them, because 2B particles
generated per GPU is very low, but we do need this temporarily until we find a way to generalize large id values again for pure SoA particle layouts.
cc @AlexanderSinn
Additional background
Follow-up to #2878.
Checklist
The proposed changes: