Skip to content

Commit

Permalink
plugin: use plugin_factors map to fetch weights
Browse files Browse the repository at this point in the history
Instead of hard-coding the weights for all of the
priority factors in the priority_calculation() function,
fetch the weights stored in the plugin_factors map, which
contains information about the various priority factors and
their associated weights defined in the flux-accounting DB
plugin_factor_table. If for some reason the weight of either
factor cannot be found, a weight of 0 will be used in the
priority calculation of a job.
  • Loading branch information
cmoussa1 committed Apr 22, 2022
1 parent 2133c71 commit 0e20615
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/mf_priority.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ int64_t priority_calculation (flux_plugin_t *p,
int fshare_weight, queue_weight;
struct bank_info *b;

fshare_weight = 100000;
queue_weight = 10000;
// fetch associated weights of all of the priority factors
fshare_weight = plugin_factors["fairshare"];
queue_weight = plugin_factors["queue"];

if (urgency == FLUX_JOB_URGENCY_HOLD)
return FLUX_JOB_PRIORITY_MIN;
Expand Down

0 comments on commit 0e20615

Please sign in to comment.