Skip to content
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

Make PT-TEMPO save memory by writing results to file during computation #30

Open
gefux opened this issue Nov 16, 2021 · 4 comments
Open
Assignees
Labels
enhancement New feature or request someday Maybe something to work on someday

Comments

@gefux
Copy link
Member

gefux commented Nov 16, 2021

With the new FileProcessTensor it is possible to write a process tensor to disc part for part. When the final time is larger then the non-Markovian memory time, the first parts of the process tensor are calculated before the entire computation has finished. As a result one can easily save memory during the computation of such a process tensor. It would be good if the code would be changed to do that.

@gefux gefux added the enhancement New feature or request label Nov 16, 2021
@gefux gefux self-assigned this Nov 16, 2021
@piperfw
Copy link
Collaborator

piperfw commented Mar 23, 2024

What is the status of this issue? I noticed if oqupy.pt_tempo_compute call (with a filepath argument) is interrupted a file is left on disk, but this gives a ValueError if subsequently used in a dynamics calculation.

@gefux gefux added the someday Maybe something to work on someday label Mar 29, 2024
@gefux
Copy link
Member Author

gefux commented Mar 29, 2024

This is because when called with a filepath argument, a FileProcessTensor is created and the corresponding hdf5 file is initiated. It makes sense in my opinion to initiate that file at the beginning of the computation because then there is at least the possibility to write to disc the completed parts of the process tensor as proposed in this issue.
One could start the initialization of the file with a field that signals that the content is not yet a valid process tensor to be able to create a more helpful error message when loaded. I think it will come to no surprise to most users that an interupted computation will not give you a valid process tensor file, so I don't see this to be a significant issue at the moment.

@piperfw
Copy link
Collaborator

piperfw commented Mar 30, 2024

Thanks for the update, I wasn't sure if this had been worked on. Agree nonissue.

@gefux
Copy link
Member Author

gefux commented Jun 24, 2024

With commit 73e8259 there is now a "writing" flag in the FileProcessTensor set while the tensors are being populated. When a file with this flag on is imported then a warning "File was closed during writing process and hence may be corrupt" is put out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request someday Maybe something to work on someday
Projects
None yet
Development

No branches or pull requests

2 participants