-
Notifications
You must be signed in to change notification settings - Fork 125
Add ntasks and cpus_per_task options, fix db_conn in slurmdb_jobs #146
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
73c1655
Fix ntasks job option,work_dir job option and slurmdb_jobs db connection
1db9996
Add options involving ntasks_set and cpus_set
swillner 0710eb9
Use db_conn of class and fix cleanup
swillner de14f3a
Merge slurmdb_jobs.__free into slurmdb_jobs.__dealloc__
swillner 7c5e949
Add num_tasks output
swillner cf0e4c0
Add simple test for submitting with ntasks and cpus_per_task
swillner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,10 +7,17 @@ | |
|
|
||
| def test_job_submit(): | ||
| """Job: Test job().submit_batch_job().""" | ||
| test_job = {"wrap": "sleep 3600", "job_name": "pyslurm_test_job"} | ||
| test_job = { | ||
| "wrap": "sleep 3600", | ||
| "job_name": "pyslurm_test_job", | ||
| "ntasks": 2, | ||
| "cpus_per_task": 3, | ||
| } | ||
| test_job_id = pyslurm.job().submit_batch_job(test_job) | ||
| test_job_search = pyslurm.job().find(name="name", val="pyslurm_test_job") | ||
| assert_true(test_job_id in test_job_search) | ||
| assert_equals(test_job_search["cpus_per_task"], 3) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
| assert_equals(test_job_search["num_tasks"], 2) | ||
|
|
||
|
|
||
| def test_job_get(): | ||
|
|
@@ -58,6 +65,7 @@ def test_job_scontrol(): | |
| assert_equals(test_job_info["nice"], int(sctl_dict["Nice"])) | ||
| assert_equals(test_job_info["num_cpus"], int(sctl_dict["NumCPUs"])) | ||
| assert_equals(test_job_info["num_nodes"], int(sctl_dict["NumNodes"])) | ||
| assert_equals(test_job_info["num_tasks"], int(sctl_dict["NumTasks"])) | ||
| assert_equals(test_job_info["partition"], sctl_dict["Partition"]) | ||
| assert_equals(test_job_info["priority"], int(sctl_dict["Priority"])) | ||
| assert_equals(test_job_info["state_reason"], sctl_dict["Reason"]) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we work on some tests for these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
submit_batch_jobdoes not seem to be tested beyond giving awrapscript and ajob_name. I added simple tests forntasksandcpus_per_task...