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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this should go exactly like this here.
What do you think about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admittedly, this is exactly what is done a few lines earlier, isn't it? Why is that not called, I wonder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the values of
num_dump_particles
andParticleFlushOffset
for this problem?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
num_dump_particles=0
ParticleFlushOffset=1000
so is_last_flush_and_never_particles (= is_last_flush_to_step && num_dump_particles == 0 && ParticleFlushOffset == 0) will be false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, got it.
If
ParticleFlushOffset > 0
that means at some point, at least one rank had particles to write.We need to check if maybe in the call where we write particles (earlier), we have a logic mistake that forgets to call
SetupPos
collectively.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, maybe we filter twice and forget
num_fraction
in one case? Let's take a look wherenum_fraction
is applied and if the counter is done correctly afterwards.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the offsets are set in the BTD object, and when it calls flush(), the filters are then applied in the underlying flush formats during copyParticles(). Unlike other filters, the random filter affected the offsets of the caller BTD object.
I think the workaround is the easy and harmless. Otherwise, have to collect the particles written from all processes and update the offset in BTD.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather like to fix the underlying issue in the BTD offset counter. We need consistent meta data.
cc @RevathiJambunathan :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it makes sense, can apply the random filter before BTD calls flush(). It will make things cleaning and easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we probably need to add this to: