-
Notifications
You must be signed in to change notification settings - Fork 120
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
Wait_finished method for job API (regarding #240) #242
Conversation
Hi @JonaOtto thanks for the addition. I think instead of merging into the 21.08 branch, it would be better to directly merge into
|
Hi @JonaOtto just had another look at it. I think there might be a little problem with the logic though. The problem is that the only condition tested for here is the state of If you call Instead, it would be more benefitial to work with the raw job-pointer, and therefore the raw state info. I think we just need to extract the
With the pointer, we can then do:
The What do you think? |
Hi @tazend, EDIT: typo |
…oad_job functionality.
…e of the job(s), instead of None. Fixed some typos in comments.
Hello pyslurm devs,
I tested this in the container, again. Like before, the tests for Let me know what you think :) |
Hi @JonaOtto Except for the one thing I mentioned with the potential memory-leak which needs to be fixed, everything else looks good. |
Hi @tazend, |
Hi @JonaOtto I mentioned the memory leak in line 2921 (I hope my comment shows up there as review?) Yes, after line 2934 - still within the while loop, but after the for-loop, you need to add |
Hi @tazend Oh okay, maybe that's on me, I'm still a noob when it comes to all these cool GitHub features. I do not see your comment, but maybe I did not know where to look for. Anyway, we thought about the same thing anyway, give me a minute, I will do the fix. EDIT: typo |
Okay, fix pushed. There should now be pairs of |
alright, everything looks good! Anyway, we can merge it now, thanks for the contribution :) |
Thanks for merging :) |
* Fix introduced typo in partition information dictionary key. (#241) * Added wait_finished method to job class (#240). * Added test method for wait_finished method of the job class. * Added _load_single_job method to the job class to extract the slurm_load_job functionality. * Updated find_id and wait_finished to use _load_single_job. Co-authored-by: Jonathan Goodson <[email protected]>
Hello PySlurm developers,
This is my proposal for a method to wait for a job to finish, regarding #240, for the 21.08 version.
I added the
wait_finished
method to the job class. It is implemented using thefind_id
method of the job class. I also added a test method. I've tested this in the container, as mentioned in the README. At least the test forwait_finished
passes (although some others are not, which also fail in the version without my changes). Sadly, it turns out the cluster I am able to use, does not run a SLURM version, which I can use with PySlurm. Therefore, I could not test it on the real cluster (but we will get a SLURM update in the next weeks, maybe I will try this again over with a different version).I'm looking forward to your thoughts and comments!
Best,
Jonathan