Skip to content

Avoiding overflow in Simulation.num_cells #2413

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged

Conversation

momchil-flex
Copy link
Collaborator

For wrong settings, it was possible to get overflow in the Simulation.num_cells even with 64-bit precision integers.

Copy link
Collaborator

@yaugenst-flex yaugenst-flex left a comment

Choose a reason for hiding this comment

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

I guess this relates to the min grid spacing validator. from #2335

@momchil-flex
Copy link
Collaborator Author

Well, kind of, but do those validators only check absolute bounds? In the problematic simulation I was investigating, the grid spacing was as if for ~1um wavelength, but the simulation domain was on the order of tens of mm in each direction. Neither of these is prohibited on its own, but the combination produces an immense amount of grid points. If it were not for overflow making the total number of cells negative, the simulation would have hit various validators, at the very least the pre-upload one.

@momchil-flex momchil-flex merged commit 83fc99f into develop Apr 28, 2025
32 of 35 checks passed
@momchil-flex momchil-flex deleted the momchil/overflow branch April 28, 2025 12:17
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants