fnalacceleratormodeling / synergia2

Synergia is a accelerator modeling and simulation package developped at Fermilab.
Other
8 stars 4 forks source link

Core dump depending on simulation/lattice variable scope #106

Closed e-carlin closed 1 year ago

e-carlin commented 1 year ago

Hi - I'm running into a core dump issue using synergia. It seems to depend on the scope of the simulation and/or lattice variables.

Steps to reproduce:

-main() +sim = main()

EOF

- See error:

~$ python synergia-example-from-web.py Propagator: starting turn 1, final turn 10

Propagator: maximum number of turns reached Propagator: total time = 5.293s terminate called after throwing an instance of 'std::runtime_error' what(): Kokkos allocation "corr" is being deallocated after Kokkos::finalize was called ```

Turning on DEBUG level logging in the simlog object doesn't yield any additional information about the possible cause.

Do you have any idea what might be causing this? Is there a way to resolve it?

Let me know if I can provide more info. Thanks for your help.

egstern commented 1 year ago

I think what you are seeing is that all classes and objects that hold Kokkos objects have to be destroyed either by going out-of-scope or explicit del in Python before the program terminates. It looks like you are trying to sneak sim object out of the run() into the top level.

e-carlin commented 1 year ago

Aha, thanks @egstern. So it is about the scoping. I guess I'll modify the generation code to cope the variables or do a del. I appreciate the speedy reply.