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

Interface for restarts #254

Merged
merged 9 commits into from
May 16, 2023
Merged

Interface for restarts #254

merged 9 commits into from
May 16, 2023

Conversation

pabloferz
Copy link
Member

This adds two ways of restarting runs:

  1. From a stored Result (this is compatible with our MPI interface). One change introduced here is that the last snapshot of a simulation is now also part of Result instances. The interface looks like
    pysages.run(result: Result, context_generator: Callable, timesteps: int, *other_args, **kwargs)
    (that is, one would switch method by result when restarting).

  2. From a SamplingContext (which is a renaming of our ContextWrapper). This is useful for interactive sessions, say in a jupyter notebook, or for debugging purposes.

FFS is left out for now as it is too different and requires other changes to its interface.

@trunk-io
Copy link

trunk-io bot commented Feb 28, 2023

😎 Merged successfully (details).

@pabloferz pabloferz force-pushed the restarts branch 3 times, most recently from 3a5a313 to b6f7150 Compare February 28, 2023 21:57
@pabloferz pabloferz marked this pull request as ready for review February 28, 2023 21:57
@pabloferz pabloferz added the API label Mar 2, 2023
Copy link
Collaborator

@gustavor101 gustavor101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restart functionality works well with pickle files and multiple calls in notebooks, but a couple of examples could be useful for the user like showing that the loggers are now incorporated in SamplingContext and not in pysages.run as before.

@pabloferz pabloferz mentioned this pull request Apr 3, 2023
InnocentBug
InnocentBug previously approved these changes Apr 18, 2023
@trunk-io trunk-io bot merged commit b9157bc into main May 16, 2023
@pabloferz pabloferz deleted the restarts branch May 16, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants