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

idea: allow priority function to be expressed in TOML config #296

Open
garlick opened this issue Nov 8, 2022 · 0 comments
Open

idea: allow priority function to be expressed in TOML config #296

garlick opened this issue Nov 8, 2022 · 0 comments
Labels
idea An idea for a new feature or change

Comments

@garlick
Copy link
Member

garlick commented Nov 8, 2022

Following up on a ☕ time discussion:

The current mf_priority.so plugin hardwires its priority function. Work in #295 proposes to make the weights of the factors in the calculation configurable (all good!) A step further might be to allow the function itself to be expressed in the TOML config.

A first idea was to use mustache templates in an arithmetic expression like

[accounting]
priority-expression = "({{fshare}} * 100000) + ({{queue}} * 10000) + ({{urgency}} - 16)"

The code would substitute the templates with numerical values, then pass the resulting expression to an off the shelf arithmetic evaluator such as (googling...) gnu libmatheval or expr which is embeddable.

Another thought is that maybe the expression could be a lua function that is passed a table of factors. That idea probably raises more questions than answers, and might be pretty unwieldy if someone decides to embed substantial lua in a TOML config file (although TOML does have support for multi-line strings using pythonish triple quotes (""")). But flux-core already has lua bindings so this might be fairly simple to implement without taking on new dependencies.

@cmoussa1 cmoussa1 added the idea An idea for a new feature or change label Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea An idea for a new feature or change
Projects
None yet
Development

No branches or pull requests

2 participants