Skip to content

avoid NaN in maxParticleVelocity()#6831

Merged
JustinRayAngus merged 3 commits intoBLAST-WarpX:developmentfrom
JustinRayAngus:remove_nan_max_particle_velocity
May 5, 2026
Merged

avoid NaN in maxParticleVelocity()#6831
JustinRayAngus merged 3 commits intoBLAST-WarpX:developmentfrom
JustinRayAngus:remove_nan_max_particle_velocity

Conversation

@JustinRayAngus
Copy link
Copy Markdown
Contributor

@JustinRayAngus JustinRayAngus commented May 1, 2026

This PR is an attempt to fix a random job hang that I've experienced recently on Tuolumne.

I've tracked the hang down to mypc->maxParticleVelocity(), which is called from UpdateDtFromParticleSpeeds() when using dynamic time stepping. The code there does not guard against boxes with zero particles, which eventually results in taking the sqrt of an uninitialized value resulting in local max_v = nan. This PR avoids NaN values.

With this fix, I have not yet observed any random job hanging.

@JustinRayAngus JustinRayAngus requested review from atmyers and dpgrote May 1, 2026 21:23
@JustinRayAngus JustinRayAngus added the bug Something isn't working label May 1, 2026
Copy link
Copy Markdown
Member

@dpgrote dpgrote left a comment

Choose a reason for hiding this comment

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

Looks good

@JustinRayAngus JustinRayAngus changed the title remove nan. remove NaN in maxParticleVelocity() May 1, 2026
@JustinRayAngus JustinRayAngus changed the title remove NaN in maxParticleVelocity() avoid NaN in maxParticleVelocity() May 2, 2026
@JustinRayAngus JustinRayAngus merged commit e6db7c9 into BLAST-WarpX:development May 5, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants