-
Notifications
You must be signed in to change notification settings - Fork 12
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
Panicks when more than 16 lasers #55
Comments
Currently the laser samplers store per-laser quantities in a fixed-size array of length 16, see Short fix, you could raise the cap (just modify the |
Note that performance was faster with fixed arrays, but we could debate whether it's worth the flexibility. A few posts down, it says:
|
Ok, thanks ! I'll have a look. It just that the 16 limits seemed a bit low. A simple MOT already has 6 beams so it's fairly easy to go above 16. |
Yeah agreed, especially when you also have e.g. sidebands in some setups. |
Could you profile the benchmark simulation as a function of the array size? |
I simply measured the duration time for the benchmark example on a i7-1165G7 @ 2.80GHz. I went a bit high for the upper limit because I want to have a MOT with many sidebands but I imagine it's an extreme case. I had to remove |
Thanks Damien, there's obviously an overhead with shuffling larger arrays around in memory (as expected). It looks like 32 would be a safe short term extension (which allows serialize,deserialize traits to be preserved), and we can return to whether a |
Also maybe a more explicit error message could be helpful ? I also just noticed that the lasers are cached with a LASER_CACHE_SIZE in some files, but I didn't change this value in the previous runs. |
The |
Have you considered using constant generics to pass the control over maximum number of lasers to the user while still having a fixed-length array? |
That's a great idea. There will be a rewrite at some point in the future to support other cooling transitions/models of scattering rates, and we should add the change then. |
Hi, |
@zpbaldo I hadn't actually added constant generic support yet, although I do think minghuaw's suggestion is a good one. My intention has been to return to atomecs once bevy has stabilised a bit more (I was working on #3 after specs got deprecated; there's good benching data in there and to be fair it has now been a bit of time and bevy has matured, so I should return to this). But this does also sound like a bug, as in #55 (comment) this should just refer to a batch size for looping through a more generalisable number of lasers. What specific setup are you encountering this on? |
@ElliotB256 Yes I read LASER_CACHE_SIZE is the batch size but I found that modifying it would allow me to add a generic number of beams in the simulation. |
I was trying to increase the number of cooling lasers to replicate sidebands.
Every time I add more than 16 lasers to the world, a thread panicks.
Any thoughts on what could be causing the problem ?
The text was updated successfully, but these errors were encountered: