Closed carterbox closed 2 years ago
So I ran into a bug while using this API where it is unsafe to call Reconstruction.get_result() before the context is closed because it moves all the parameters back to the host in the middle of the reconstruction (side effects!). I need advice on how to handle this.
The user wants to get the PtychoParameters struct back in its entirety after closing the context, but they cannot be allowed to access it while the context is open. What about tracking whether the context is still open internally and raising an error if get_result() is called before the context is closed?
Is the context changing the parameters? If not, showing a duplicate when needed might be better than not allowing it when it is open.
Yes. The parameters include both variable (the probe, scan position) and constant (hyperparams) parameters.
Then like in monitoring iterative algorithms, you can monitor the “states”, which can be pulled or broadcasted at regular intervals.
Related to #148
Purpose
Enable online reconstructions; i.e. checking the result without dumping everything from the GPU and adding additional data mid-reconstruction.
Approach
Pre-Merge Checklists
Submitter
Reviewer