Recommended way to combine functions from different checkpoint files based on the same mesh #2917
Unanswered
stephankramer
asked this question in
Firedrake support
Replies: 2 comments
-
Not an answer, but in defcon I do |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think you are right. It is expected that we can load a mesh from fileA, using which we can load a function from fileB. The following simple example works.
With this in mind, I think, the alternative approach should be used as we do not want to rely on that the user has provided correct mesh with correct distribution/overlap and that the user has constructed correct function spaces on the mesh. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My question is basically how to best fix checkpointing for Thetis (see also issue thetisproject/thetis#336)
The current (broken) pattern is that the user provides a mesh, Thetis creates a solver object with various function spaces and necessary functions, and also the user may specify various additional user created functions, all based on that same mesh/domain, and then after that the user can decide to apply some user defined initial condition, or load the initial condition from a checkpoint created in a previous run. Currently loading from the checkpoint involves loading the function from the checkpoint file using the mesh that's stored in the checkpoint file (see https://github.com/thetisproject/thetis/blob/master/thetis/exporter.py#L222) and then we assign its values to the already previously created function which was based on the user supplied mesh. That last step is currently broken as firedrake (ufl?) has gotten stricter on not allowing assignment between functions on (what it thinks are) different domains.
One hacky solution would be to simply copy
.dat.data[:]
values instead of calling assign. Is this safe in parallel? What about if I restart on a different number of cores?Alternatively we would have to force the user to read the mesh from one of the checkpoint files (possibly with some helper function) and then build on top of that. Note that there are typically multiple checkpointfiles involved, each with different functions that we want to use: say some preprocessed bathymetry, then an initial condition for velocity and an initial condition for elevation. But am I right in saying that we are allowed to load the mesh from one checkpoint file A, and then load functions from another checkpoint file B using the mesh from checkpoint A instead of loading the mesh from B?
Beta Was this translation helpful? Give feedback.
All reactions