-
Notifications
You must be signed in to change notification settings - Fork 21
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
Final solution dump after exception can run into "file exists" error #167
Comments
To reproduce, run diff --git a/examples/vortex-mpi.py b/examples/vortex-mpi.py
index b61148f..3e265cc 100644
--- a/examples/vortex-mpi.py
+++ b/examples/vortex-mpi.py
@@ -61,8 +61,8 @@ def main(ctx_factory=cl.create_some_context):
allocator=cl_tools.MemoryPool(cl_tools.ImmediateAllocator(queue)))
dim = 2
- nel_1d = 16
- order = 3
+ nel_1d = 160
+ order = 5
exittol = .09
t_final = 0.1
current_cfl = 1.0 (Observe how it's not adjusting the time step, hence the solution disagrees.)
|
Correct, that's why we need this check: if current_t != checkpoint_t:
if rank == 0:
logger.info("Checkpointing final state ...")
my_checkpoint(current_step, t=current_t,
dt=(current_t - checkpoint_t),
state=current_state) This check was complained about and commented by someone. But it served a purpose, and that was to make sure we don't try to overwrite the soln file that was just written in the last step in case the time stepping stops right on an output step. Edit: |
IMO we should find a solution that doesn't require repeating this logic in every driver. And without a comment, I (that someone you refer to IIRC) simply didn't get the logic, so it's not impossible that someone else might not either. |
Agreed. FWIW, I didn't think it was you personally that commented it. I think it very likely was me responding to complaints about it - but then I never properly fixed it up. Ideally, there would have been a test surrounding this to expose and address the need. Can we unit test the drivers? I couldn't agree more about not leaving this to the drivers to get right or wrong. I'm also sensitive to exporting too much to the back-end, however. |
I'm a little unclear on what the desired behavior actually should be in this case. If the intent is to write a final dump after a mismatch has occurred, isn't this what should happen if the file already exists? The alternative would be to force it to be overwritten, which seems wrong if we're not allowing that behavior in other circumstances. I guess you could do a final dump to a different file on error ( |
I get it now. 🙂 The issue is that it gives that error even if the file didn't exist before the run started. |
This should not happen IMO.
The text was updated successfully, but these errors were encountered: