-
Notifications
You must be signed in to change notification settings - Fork 15
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 lazy input standard #588
Conversation
Pull Request Test Coverage Report for Build 3576649601
💛 - Coveralls |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
spx = pr.create_job('Sphinx', 'spx_sxextopt_Al')
spx.structure = pr.create.structure.bulk('Al', cubic=True)
spx.server.run_mode.interactive = True
spx.calc_static()
sxextopt = spx.create_job('SxExtOptInteractive', 'sxextopt_Al')
sxextopt.save()
sxextopt = pr.load('sxextopt_Al')
sxextopt.run() This is still not working and I have no idea why. Do you see a problem? @pmrv |
Not sure from the error message. Have you checked the HDF5 files themselves? Can it be that they are somehow overwritten in between and therefore the lazy loading reaches into nothing? I probably won't have time this week to have a detailed look. |
Now in principle I understood where the problem comes from but I don't know how to solve it In spx = sxextopt._load_all_child_jobs(sxextopt._load_job_from_cache(sxextopt._job_name_lst[0]))
spx.project_hdf5.remove_group()
spx.project_hdf5 = job.project_hdf5.__class__(sxextopt.project, job.job_name, h5_path="/" + spx.job_name) Now the difference is that |
For now I guess I'll wait for your reply @pmrv. It might be important to figure it out, because I realised that |
This actually sounds like a latent bug in how this was handled before. I'm assuming this happens:
So the issue is created in step three, from the code you posted above. The solution is probably to check first whether this move of data is necessary (it seems to be deleting it and then writing it back to the same location to me) and if so reload the child job afterwards. |
That's what I also guessed. The problem is even without those lines there are errors (although they are probably different ones). |
I just realised that there's another problem: job = pr.create.job.Sphinx('spx')
job.structure = pr.create.structure.bulk('Al', cubic=True)
job.run()
job = pr.load('spx')
job.input.copy() This leads to a recursion error in the last line. It can be prevented by simply calling |
And I just realised that what I said about the workaround (calling |
ok actually it works only if |
I know you told me not say that all the time, but that sounds weird. I'll give it a try. |
I ran your snippet in one cell and it comes out fine for me. |
Are you sure that you did it in this branch (i.e. with |
Ah, no not. :| |
Possible solution: copy the ref_job either in |
So I found out again that if I call Cell 1 spx = pr.create_job('Sphinx', 'spx_sxextopt_Al')
spx.structure = pr.create.structure.bulk('Al', cubic=True)
spx.server.run_mode.interactive = True
spx.calc_static()
sxextopt = spx.create_job('SxExtOptInteractive', 'sxextopt_Al')
sxextopt.save()
sxextopt = pr.load('sxextopt_Al') Cell 2 sxextopt.ref_job.input Cell 3 sxextopt.run() This works. I remember there was something that had to be executed to have the same effect, right? @pmrv |
it's |
I have a question for @pmrv and @jan-janssen because I'm not really sure what the solution should look like. The current problem is that the input is not loaded in Now the question is obviously how to solve the problem for |
I made a bit more progress. In particular, I came back to the problem with spx = pr.create_job('Sphinx', 'spx_sxextopt_Al')
spx.structure = pr.create.structure.bulk('Al', cubic=True)
spx.server.run_mode.interactive = True
spx.calc_static()
sxextopt = spx.create_job('SxExtOptInteractive', 'sxextopt_Al')
sxextopt.save()
sxextopt = pr.load('sxextopt_Al')
### From here what `pop` does:
job_name_to_return = sxextopt._job_name_lst[-1]
job_to_return = sxextopt._load_all_child_jobs(sxextopt._load_job_from_cache(job_name_to_return))
# job_to_return.input._force_load()
job_to_return.project_hdf5.remove_group()
job_to_return.project_hdf5 = sxextopt.project_hdf5.__class__(
sxextopt.project, job_to_return.job_name, h5_path="/" + job_to_return.job_name
) |
Here's my guess of what's happening inside
If the list above is correct, then there are several solution possibilities:
I would love the avoid the first solution, because then the advantage of |
I'm just having a discussion with @pmrv and realized that the option 3 is actually not really available. |
Maybe we should simplify have different levels of load on the job level. We already have |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Do the tests use the conda environment for |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
I realised that by using
lazy=True
it becomes much faster in SPHInX, so I make it standard.