Skip to content

expand queue_info - #965

Open
johrstrom wants to merge 2 commits into
masterfrom
expand-queue-info
Open

expand queue_info#965
johrstrom wants to merge 2 commits into
masterfrom
expand-queue-info

Conversation

@johrstrom

Copy link
Copy Markdown
Contributor

Please review our Contributing Guide before submitting a pull request.

What does this PR do?

Expands the attributes of the QueueInfo class.

Related issue

Closes #955

Testing

  • Tests included
  • No tests needed — reason: ___

Checklist

  • Follows project code style and conventions
  • Documentation provided (if new feature, adapter or behavior change)
  • This is a large feature and was discussed in an issue first (if applicable)

Anything else?

  • I'm wondering about the nil defaults. Specifically around UNLIMITED and not given. I wonder if using nil as a default and value (to represent UNLIMITED) is a good idea.
  • I'm also wondering if max_cpus shouldn't just be max_cpus_per_node directly. I think we need to consider how auto_cores is going to be used both in batch connect and in the project manager. As in, maybe we need an auto_cores_per_node specifically to differentiate the use cases.
  • There's also some technical debt around helper methods. For this duration_in_seconds is a method in the outer class Slurm, not the inner class Slurm::Batch. I just duplicated it instead of refactoring it, but it should be refactored at some point along with some other maybe class methods.

Comment thread lib/ood_core/job/queue_info.rb Outdated
Comment on lines +90 to +91
return 1 if max.nil?
return nil if max.to_s == 'UNLIMITED'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I definitely am not sure about these defaults. Why would the max default to 1 if unset? It seems like both the unset and unlimited case would have the same behavior: defer to the cluster's limitations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - these have been changed to default to nil.

Comment thread lib/ood_core/job/queue_info.rb Outdated
Comment on lines +53 to +54
@max_nodes = parse_max(opts.fetch(:max_nodes, 1))
@max_cpus = parse_max(opts.fetch(:max_cpus, 1))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also seems like we are setting the 1 default in two different places. Is this necessary? Couldn't we default to nil here and parse_max would still convert it to 1?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea that's not good. These have been updated to default to nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expand queue_info

2 participants