AppendAfterSteps #4236
Replies: 8 comments
-
|
Beta Was this translation helpful? Give feedback.
-
The problem is I can do that, but if I loop on the |
Beta Was this translation helpful? Give feedback.
-
I don't understand your statement. What does "loop on the put" mean? I assume after calling put() for all variables that go into the checkpoint, you close the file, and next time you open again (with |
Beta Was this translation helpful? Give feedback.
-
I don't close the file, just keep it open. The workflow is like this: Open file Define variable Loop to run the program
When finished doing the work close the file. i.e. We don't bother closing the checkpoint file until then end of the program. We do sync after writing the variable to persist it. |
Beta Was this translation helpful? Give feedback.
-
That's not how anyone else is doing checkpointing. Close would write out the current data. And whenever you want a new checkpoint, you open, write and close again. The open(mode) argument as well as the AppendAfterSteps parameter only play a role when opening the file. They are acting for the moment of opening, they will not have any effect later. By "sync" you mean calling end_step() or what? |
Beta Was this translation helpful? Give feedback.
-
So AppendAfterSteps will only work between file closes? i.e. only the steps that are visible on file open will be considered? |
Beta Was this translation helpful? Give feedback.
-
The purpose of AppendAfterSteps is to reset data files, other than the checkpoint file, to the restarting point, when restarting the application. Imagine you write a checkpoint every 100 iterations and you write a data file every 10 iterations. You may end up with a checkpoint written at iteration 600, while the data file may have 64 steps (iteration 0, 10, 20, ..630). If you simply open the data file for appending when restarting the application, the next step will be the 65th in the data file, even though you restart from iteration 600 and the next data step is ought to be 610. By setting AppendAfterSteps=60 for the data file, adios will truncate it after 60 steps and the next output will be the 61st (with data from iteration 610). For the checkpoint file itself, you just should use write mode, and open/close at every checkpoint step. The |
Beta Was this translation helpful? Give feedback.
-
Thanks, understood. |
Beta Was this translation helpful? Give feedback.
-
I've a file that I want to overwrite the dataset inside each time I do I/O. i.e. a checkpoint where I only want the latest to survive. I've tried using AppendAfterSteps=0 and opening the file in append mode but it still creates multiple steps, i.e. creates new versions of the variable every time a put is called, is this expected?
I'm programming in Fortran and do the following:
Should I be doing something different?
Beta Was this translation helpful? Give feedback.
All reactions