-
Notifications
You must be signed in to change notification settings - Fork 36
Add total memory to job info 878 #879
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
Open
Oglopf
wants to merge
16
commits into
master
Choose a base branch
from
add-total-memory-to-job-info-878
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b62d135
update slurm adapter to provide total memory information
Oglopf 1331c37
add total memory method at top layer of info object
Oglopf bb9447b
add tests for info object using total_memory
Oglopf 726d989
fix broken test with missing data for build.
Oglopf 0c3fd4c
remove total_memory, add total_memory attribute
Oglopf 36ba2e1
remove some cruft, add compute_total_memory method
Oglopf f3b5b02
add helper to parse memory string and return the bytes used by job
Oglopf d18c69e
add tests for slurm total_memory using node or cpu context
Oglopf 2404760
remove total_memory test cases
Oglopf 5c8185e
fix typo in method
Oglopf d2df78f
remove unneded hash argument
Oglopf d7912ca
restore deleted field in info
Oglopf 69fcb3e
add guard against nil min_memory
Oglopf 3c905fb
try to validate the mem_str and unit for tests
Oglopf 30c9f73
add nil test case for min_memory
Oglopf 304449b
fix compute and parse logic
Oglopf 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 |
---|---|---|
|
@@ -69,6 +69,11 @@ class Info | |
# @return [Integer, nil] allocated total number of gpus | ||
attr_reader :gpus | ||
|
||
# Total memory used by job in bytes | ||
# @note computed from the adapter, if supported | ||
# @return [Integer, nil] total bytes used for job | ||
attr_reader :total_memory | ||
|
||
# List of job array child task statuses | ||
# @note only relevant for job arrays | ||
# @return [Array<Task>] tasks | ||
|
@@ -96,7 +101,7 @@ def initialize(id:, status:, allocated_nodes: [], submit_host: nil, | |
procs: nil, queue_name: nil, wallclock_time: nil, | ||
wallclock_limit: nil, cpu_time: nil, submission_time: nil, | ||
dispatch_time: nil, native: nil, gpus: 0, tasks: [], | ||
**_) | ||
total_memory: nil, **_) | ||
@id = id.to_s | ||
@status = Status.new(state: status.to_sym) | ||
@allocated_nodes = allocated_nodes.map { |n| NodeInfo.new(**n.to_h) } | ||
|
@@ -116,6 +121,7 @@ def initialize(id:, status:, allocated_nodes: [], submit_host: nil, | |
@status = job_array_aggregate_status unless @tasks.empty? | ||
|
||
@native = native | ||
@total_memory = total_memory | ||
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. This should likely keep the other behavior where we check for nil and cast to_i when ti's not nil, like gpus below it. |
||
@gpus = gpus && gpus.to_i | ||
end | ||
|
||
|
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
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.
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.
Where did you get this from? I'm unable to replicate this or see it in any job at OSC.