Skip to content
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

Merged
merged 2 commits into from
Nov 1, 2021

Conversation

dongahn
Copy link
Member

@dongahn dongahn commented Oct 29, 2021

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.

@dongahn dongahn requested a review from milroy October 29, 2021 23:50
Copy link
Member

@milroy milroy left a 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()) {
Copy link
Member

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.

Copy link
Member Author

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.
@dongahn dongahn force-pushed the moldable-default-fix branch from 57c1833 to c172bff Compare November 1, 2021 21:20
@codecov
Copy link

codecov bot commented Nov 1, 2021

Codecov Report

Merging #879 (c172bff) into master (eed1166) will decrease coverage by 0.0%.
The diff coverage is 100.0%.

@@           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     
Impacted Files Coverage Δ
resource/libjobspec/jobspec.hpp 100.0% <ø> (ø)
resource/libjobspec/jobspec.cpp 85.6% <100.0%> (-0.2%) ⬇️
qmanager/modules/qmanager_callbacks.cpp 73.5% <0.0%> (-0.5%) ⬇️

@dongahn dongahn added the merge-when-passing mergify.io - merge PR automatically once CI passes label Nov 1, 2021
@mergify mergify bot merged commit 4519914 into flux-framework:master Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-passing mergify.io - merge PR automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants