-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use copy(deepcopy=true)
for checkpointing
#172
Conversation
Before I start working on the TODOs of this PR, I wanted to understand what was going on here since I didn't experience any issues in the partitioned heat tutorial. Tests (without the suggested fix)
What's wrong with
|
Since the odd behavior isn't solely restricted to the OpenFOAM-FEniCS perpendicular flap tutorial but also to cases where the FEniCS adapter isn't used at all, my guess would be that there is a bug elsewhere as well. What do you think? |
The OpenFOAM-OpenFOAM failure definitely makes this more confusing. Otherwise I could imagine that something goes wrong in the Python bindings, and hence all Python-based participants produce failures. |
I could imagine that you have two independent issues here. Maybe ignoring OpenFOAM for the moment is the more sane strategy. |
@NiklasVin I assume you already did this: Can you also do the experiment from above including the changes from precice/tutorials#554 but without |
Exactly. I tested it without |
Based on the current state I would still suggest to merge this PR and use @IshaanDesai, @uekerman, @NiklasVin: Any comments? If not, I would like to merge this PR. |
Makes sense, lets merge this 👍 |
A short comment regarding the performance aspect: I tested the runtime of copying a dolfin function both with and without deep-copying. On average, the deep-copy variant is about 13% slower (only copying the function, not the whole execution of the simulation). So, the overall runtime shouldn't be affected too much, at least, it wasn't when comparing precice/tutorials#554 with the suggested changes here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. 👍
I am opening an issue regarding the crash of the OpenFOAM-OpenFOAM example from above.
There seems to be a bug when using checkpointing. I stumbled across this with subcycling:
solid.py
by settingfenics_dt = precice_dt / 10
. Here, OpenFOAM runs into an exception after some time. The vtk files also start to obviously look faulty after some time.Looking at the value of
u_n
in any of these cases shows that we do not correctly load the checkpoint we originally stored. I assume there is some unintended pointer-magic happening. I used the following debugging statements insolid.py
to sample the solution at the tip of the flap:The fixes applied here seem to avoid the error.
There are still some todos: