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

Add checkpointing/restarting with HDF5 #35

Open
agzimmerman opened this issue Jan 29, 2019 · 5 comments
Open

Add checkpointing/restarting with HDF5 #35

agzimmerman opened this issue Jan 29, 2019 · 5 comments
Labels
enhancement New feature or request SmallProject

Comments

@agzimmerman
Copy link
Member

agzimmerman commented Jan 29, 2019

Right now, solutions are only written to VTK files. For post-processing, this is only accurate for CG1 bases. For restarting simulations, this is mostly useless.

sapphire.Simulation should have a simplified interface to firedrake.DumbCheckpoint for checkpointing and restarting.

@agzimmerman agzimmerman added enhancement New feature or request SmallProject labels Jan 29, 2019
@agzimmerman agzimmerman changed the title Use .json and HDF5 for all input/output Use JSON and HDF5 for all input/output Jan 29, 2019
@agzimmerman
Copy link
Member Author

As of right now, the built-in firedrake.DumbCheckpoint has much of the needed functionality for checkpointing with HDF5. In Sapphire, I still want to leverage the structure of the Simulation class to make checkpointing and restarting simulatoins, as well as post-processing simulation results, more convenient.

@agzimmerman
Copy link
Member Author

agzimmerman commented Apr 11, 2020

To instantiate a simulation, the module in simulations and the arguments to its Simulation.__init__ must be specified.

Many of the arguments are keyword arguments that are readily handled by a kwargs dict. These are in turn readily handled by a JSON.

Some arguments are more complicated. Every module in simulations specifies the weak_form and the element, but the mesh, initial_values, and dirichlet_boundary_conditions are left unspecified. For all of these, as well as some less-used arguments such as nullspace, Python code must be written to specify the argument.

Therefore, in order for Sapphire to have the ability to instantiate a simulation from a JSON, certain requirements must be met, and much generality must be hidden. Specifying a simulation with a JSON is straightforward for any of the modules in benchmarks, because much is assumed about the mesh, initial_values, and boundary_conditions. This reveals that there is a special subset of classes based on sapphire.Simulation which currently only involves the modules in benchmarks. Relating to #29, formalizing which simulations can be run from JSON could help better organize and document Sapphire.

@agzimmerman
Copy link
Member Author

agzimmerman commented Apr 11, 2020

The water freezing benchmark will make a nice test for the JSON specification and checkpoint/restart functionality. Rather than the somewhat complicated implementation currently in sapphire/benchmarks.freeze_water_in_cavity, the initial values can be generated by solving the independently implemented heat driven water cavity benchmark.

@agzimmerman agzimmerman changed the title Use JSON and HDF5 for all input/output Add interfaces for JSON and HDF5 input/output Apr 11, 2020
@agzimmerman
Copy link
Member Author

The JSON idea was attached to this issue a while back and it still might be nice to provide a simplified interface accepting JSON input for fully specified simulation classes; but right now it's not clear that this will be very useful.

What's really needed is the checkpointing/restarting with HDF5.

@agzimmerman agzimmerman changed the title Add interfaces for JSON and HDF5 input/output Add checkpointing/restarting with HDF5 Apr 11, 2020
@agzimmerman
Copy link
Member Author

Firedrake should handle what we need right now: https://www.firedrakeproject.org/checkpointing.html

At a minimum, sapphire.Simulation should have interfaces to firedrake.DumbCheckpoint.store and firedrake.DumbCheckpoint.load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SmallProject
Projects
None yet
Development

No branches or pull requests

1 participant