-
Notifications
You must be signed in to change notification settings - Fork 51
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
Should Iteration::close(flush=true) write files? #986
Comments
The complete code is here https://gist.github.com/eschnett/d891cebca607f178aa0a1344c615dac0 . Since it is part of the Einstein Toolkit, it won't compile on its own. |
Hi @eschnett, Thanks for the detailed example!
I think that is reasonable with a few details to know about small, high-frequent data outputs (see below). Let's check this again,
Yes, keeping the Background & MumblingWe implement quite a few options to output iteration data with respect to series of data over iterations. We can encode them in individual files ( We document them in openPMD-standard but not yet well enough in the manual of openPMD-api, which should be fixed. The The output mode you used encodes the iterations in the file itself in groups ( As mentioned, we just added the If you like to try the latest |
flush
doesn't write files?
cc @franzpoeschel reading out latest changes to the In the WarpX case, I call |
I need a stronger guarantee. I want to delete old checkpoint files when news ones are on the disk. I also want to ensure files are written safely in case the job aborts for some reason (out of queue time, writing data just before a known crash, etc.). |
I'm using |
Yes, that makes sense and I actually have a similar need. We should expose a function for that. Potentially on |
Most of this has already been discussed, just a few notes:
Theoretically, you can also (1) use the normal (groupbased) layout, (2) use the streaming API and (3) set
Noted.
To put this stronger: ADIOS will keep it in the buffer until either closing a step or the whole file. There is currently no way around that.
See issue above. TLDR:
You might want to think about simply using filebased iteration layout for that by opening the filename
|
I am now using
and the file is indeed written on However, memory is not released! I need to This is the current development version of openPMD, and the current release of ADIOS2. |
Oh good point, that is another ADIOS2 feature - buffering as much as it can for larger write chunks. The parameter should be e.g. We also have some ideas for future improvements with the ADIOS2 team about the dynamic size of this buffer: |
This doesn't work: ADIOS2 aborts with
I have no single variable that is that large. This must be the aggregate size of all variables, likely even over several processes combined. (I am using 4 processes, and Silo stores all data from a single process in 5 GByte.) |
That's right, the buffer usage should be as large as the accumulated size of variables you write in the step from a rank and should not grow after Can you fit a copy of your data in RAM? If you remove the upper cap given by |
Yes, if I destroy the (Since ADIOS2 cannot append to files, this also means that I need to create a separate file for each iteration.) |
That destroying the Series over Update: We should be able to reproduce this probably with our own example and replacing |
I don't have a small reproducer. This is with the Einstein Toolkit outputting the initial conditions for a binary black hole simulation. If you can reproduce this with your example, that would be convenient. |
@franzpoeschel let us not forget to get back to this, this memory issue might be from a regression in the streaming API. @eschnett do you call |
@eschnett Can you paste the output of I assume that you call |
I also recently faced a somewhat similar confusion. i feel this doc page is not fully clear with explaining what |
We don't have full control about what exactly the backend does upon |
Yes, I understand that. My point was more that the documentation could be more explicit about it, as with writing it's not obvious that calling |
Ah, ok. I've added it as a Todo to this PR because it fits well within it. |
What do you want to achieve, please describe.
I want to use openPMD to output data in the Einstein Toolkit. We are using AMReX and it's mesh refinement. I am currently experimenting with a first prototype of an openPMD-based I/O module for the Einstein Toolkit.
I looked at the examples and the API. I am puzzled by one thing: Files are created, but they remain empty (0 bytes) until the
Series
object is destroyed.The code is approximately:
I need to call
series.reset()
to have the data written to file. It is my impression that closing the iteration should already write all data to the file.It is also my impression that it is more efficient to keep the
Series
object around. (I think this is implied from the ADIOS2 documentation.)I installed
openPMD-api
via Spack a few days ago. I am using macOS. I am using ADIOS2 as back end.The text was updated successfully, but these errors were encountered: