-
Notifications
You must be signed in to change notification settings - Fork 41
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
jobspec: make max/operator/operand optional #879
Conversation
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.
Nice work @dongahn! I found two residual typos, but the PR itself looks great.
throw parse_error (cnode, "Key \"max\" missing from count"); | ||
} | ||
if (!cnode["max"].IsScalar()) { | ||
if (cnode["max"] && !cnode["max"].IsScalar()) { |
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.
Nits: you may want to fix the "interger" typo in line 48 and "existance" in line 60 above.
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.
:-). Great catch, human valgrind! They must have been in there from day 1. I will do a fix up commit.
Problem: libjobspec within Fluxion currently requires all four keys for a "moldable" jobspec to be present under the resources.count: min, max, operator, and operand. This does not comply with RFC14, as it specifies: "The default value for max SHALL be infinite, therefore a count which specifies only the min key SHALL be considered a request for at least that number of a resource, and the scheduler SHALL generate the R that contains the maximum number of the resource that is available and subject to the operator and operand. By contrast, if a fixed count is given to the count key, the scheduler SHALL match any resource that contains at least count of the resource, but its R SHALL contain exactly count of the resource (potentially leaving excess resources unutilized). Handle the optional keys (max, operator, operand) appropriately and adjust the relevant test cases.
57c1833
to
c172bff
Compare
Codecov Report
@@ Coverage Diff @@
## master #879 +/- ##
========================================
- Coverage 73.3% 73.3% -0.1%
========================================
Files 76 76
Lines 8384 8381 -3
========================================
- Hits 6151 6147 -4
- Misses 2233 2234 +1
|
This PR adds a quick fix for Issue #876. This was written on top of PR #878 so don't merge it before PR #878.
Problem: libjobspec within Fluxion currently requires all
four keys for a "moldable" jobspec to be present under
the resources.count: min, max, operator, and operand.
This does not comply with RFC14, as it specifies:
"The default value for max SHALL be infinite, therefore
a count which specifies only the min key SHALL be considered
a request for at least that number of a resource, and
the scheduler SHALL generate the R that contains the maximum
number of the resource that is available and subject to the
operator and operand. By contrast, if a fixed count is given
to the count key, the scheduler SHALL match any resource that
contains at least count of the resource, but its R SHALL
contain exactly count of the resource (potentially leaving
excess resources unutilized).
Handle the optional keys (max, operator, operand) appropriately
and adjust the relevant test cases.
I wanted to do a bit more work but found that there are some issues we need to fix in flux-core before having an end-to-end demonstration. So I created an Issue at flux-framework/flux-core#3928 and decide to have this reviewed and landed into fluxion first.