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

Mercury crashes after commit_parameters() is called #95

Closed
jilkoval opened this issue Feb 7, 2017 · 2 comments
Closed

Mercury crashes after commit_parameters() is called #95

jilkoval opened this issue Feb 7, 2017 · 2 comments

Comments

@jilkoval
Copy link
Contributor

jilkoval commented Feb 7, 2017

A minimal example:

from amuse.units import units
from amuse.ext.solarsystem import new_solar_system
from amuse.community.mercury.interface import Mercury

solar_system = new_solar_system()

mercury = Mercury()
mercury.particles.add_particles(solar_system)
mercury.commit_particles()
mercury.parameters.info_file = "m_info_file.out"
mercury.parameters.timestep = (1.|units.day)
mercury.commit_parameters()

mercury.evolve_model(1.|units.yr)
mercury.stop()

with an error message Exception: While calling commit_parameters of Mercury: No transition from current state state 'CHANGE_PARAMETERS_RUN' to state 'INITIALIZED' possible.

@ipelupessy
Copy link
Member

ipelupessy commented Feb 7, 2017

this is not (necessiraly) an error; if you remove the commit_ statements the state will be handled by the code and everything works (they should not be necessary). if you do call a commit_particles then there is an implicit commit_parameters and the following call should be a recommit_parameters. you can check the call seq. by putting at the start of your script:

import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("code").setLevel(logging.DEBUG)

@jilkoval
Copy link
Contributor Author

jilkoval commented Feb 7, 2017

Ah, I see. Indeed, it works just fine after removing commit statements or with calling only one (after all parameters and particles are set).

Thanks for the clarification!

@jilkoval jilkoval closed this as completed Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants