Skip to content
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

Monitor+Nonlinear invariants+Aperture yields SegFault #762

Open
cemitch99 opened this issue Nov 24, 2024 · 3 comments · May be fixed by #795
Open

Monitor+Nonlinear invariants+Aperture yields SegFault #762

cemitch99 opened this issue Nov 24, 2024 · 3 comments · May be fixed by #795
Assignees
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: diagnostics all types of outputs component: elements Elements/external fields

Comments

@cemitch99
Copy link
Member

The test script below yields a SegFault. However, the script runs successfully in any of the following cases:

  1. If the flag "nonlinear_lens_invariants=True" is changed to "nonlinear_lens_invariants=False".
  2. If the Aperture element is removed or commented.
  3. If the first Monitor element is removed or commented.

The following is a Python script. (The change .py -> .txt was made to allow attachment to this Issue.)
run_aperture_test_segfault.txt

@cemitch99 cemitch99 self-assigned this Nov 24, 2024
@cemitch99 cemitch99 added the bug: affects latest release Bug also exists in latest release version label Nov 24, 2024
@cemitch99
Copy link
Member Author

This bug only affects users who model nonlinear integrable optics (NIO) with apertures.

@ax3l ax3l assigned ax3l and unassigned cemitch99 Jan 10, 2025
@ax3l ax3l added bug Something isn't working component: elements Elements/external fields component: diagnostics all types of outputs labels Jan 10, 2025
@ax3l
Copy link
Member

ax3l commented Jan 10, 2025

Ok, I see the issue. It's a bit intricate: for the nonlinear lens invariant calculation, because it is a per-particle property, we add extra runtime parameters to the beam (particle container). In the particle collection of lost particles we also deal with an extra runtime attribute, the position along s where the a particle was lost (s_lost). Both are not in sync, so there is some confusion that creates the crash. I'll clean that up.

@ax3l ax3l linked a pull request Jan 10, 2025 that will close this issue
1 task
@ax3l
Copy link
Member

ax3l commented Jan 10, 2025

Developed a bug fix in #795.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: affects latest release Bug also exists in latest release version bug Something isn't working component: diagnostics all types of outputs component: elements Elements/external fields
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants