Skip to content

Commit

Permalink
plugin: add bank name to bank_info struct
Browse files Browse the repository at this point in the history
Problem: the bank_info struct does not contain the name of the bank in
the struct, which can make it more tedious to find the name of the bank
because you have to look at the key of the map in order to find it. It
would be more convenient if the name was also in the struct.

Add the bank name to the struct attached with each user/bank
combination.
  • Loading branch information
cmoussa1 committed Jan 10, 2024
1 parent 3365ce9 commit 510fd5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/plugins/mf_priority.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ std::map<std::string, struct queue_info> queues;
std::map<int, std::string> users_def_bank;

struct bank_info {
std::string bank_name;
double fairshare;
int max_run_jobs;
int cur_run_jobs;
Expand Down Expand Up @@ -524,6 +525,7 @@ static void rec_update_cb (flux_t *h,
struct bank_info *b;
b = &users[uid][bank];

b->bank_name = bank;
b->fairshare = fshare;
b->max_run_jobs = max_running_jobs;
b->max_active_jobs = max_active_jobs;
Expand Down Expand Up @@ -755,6 +757,7 @@ static void add_missing_bank_info (flux_plugin_t *p, flux_t *h, int userid)
b = &users[userid]["DNE"];
users_def_bank[userid] = "DNE";

b->bank_name = "DNE";
b->fairshare = 0.1;
b->max_run_jobs = BANK_INFO_MISSING;
b->cur_run_jobs = 0;
Expand Down

0 comments on commit 510fd5c

Please sign in to comment.