Restarting SeBa has certain particles cause a crash
Describe the bug When restarting a simulation whose particles are evolved up to a certain age, if they are either classified as 'Hertzsprung gap' (stellar type 2) or 'first giant branch' (stellar type 3) particles, the code crashes.
To Reproduce With the attached particle set ( seba_crasher.zip), one can run this script to reproduce the error:
import numpy as np from amuse.lab import read_set_from_file, units from amuse.community.seba.interface import SeBa
particles = read_set_from_file("seba_crasher.amuse") particles.relative_mass = particles.mass # To allow checkpoint in SeBa particles.relative_age = 100 | units.Myr # For example, set the age to 100 Myr
working_set = particles[particles.stellar_type == 1 | units.stellar_type] failing_set = particles[particles.stellar_type < 6 | units.stellar_type] for pset in [working_set, failing_set]: print(f"Stellar types: {np.unique(pset.stellar_type, return_counts=True)}...") code = SeBa() code.particles.add_particles(pset) code.evolve_model(1 | units.Myr) code.stop() print("Evolved particles successfully !")
Expected behavior The first loop will succeed, giving back the print statement successfully. However, in the second the code will fail.
Logs Error message returns:
"amuse.support.exceptions.CodeException: Exception when calling function 'evolve_system', of code 'SeBaInterface', exception was 'Error in code: no error message - code probably died, sorry.'"
Environment (please complete the following information):
- OS and version: Ubuntu 20.04.5 LTS
- Compiler: gcc (conda-forge gcc 11.4.0-13) 11.4.0
SeBa cannot yet restart a particle set properly, even if it does not crash.
See #677
I think this restarting issue has since been fixed with the commits here with the additional relative_age and relative_mass attributes.
I've been told by @spzwart that the Torch group has found a fix for this.
It's issue 73 for Torch.