flux-framework / flux-accounting

bank/accounting interface for the Flux resource manager
GNU Lesser General Public License v3.0
3 stars 10 forks source link

plugin: initialize factor weights on plugin load #458

Closed cmoussa1 closed 3 months ago

cmoussa1 commented 3 months ago

Problem

Mentioned as possible cleanup in #455, the weight of each factor is checked every time the priority of a job is calculated. It would be cleaner to put this check somewhere else so it does not need to be repeated for every job.


This PR creates defaults for the weights of each factor used in the priority calculation of a job and initializes each weight when the plugin is first loaded. In the callback for conf.update, it then checks to see if these weights have been configured; if not, it will just continue to use the defaults defined at the top of the file.

cmoussa1 commented 3 months ago

Thanks for reviewing @grondo! I'll set MWP here