You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
The text was updated successfully, but these errors were encountered:
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
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.The text was updated successfully, but these errors were encountered: