-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin: create new Association class
Problem: The plugin uses its own bank_info struct to hold user/bank information and has a number of methods for access and modification of these structs. As the plugin's feature set has grown, so have the requirements for the bank_info struct, resulting in a very large and hard-to-parse piece of code. Begin to clean up this plugin. Start by creating a new Association class and place it in a separate file that gets compiled with the plugin. Replace all instances of "struct bank_info" with the new "Association" class type.
- Loading branch information
Showing
5 changed files
with
93 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/************************************************************\ | ||
* Copyright 2024 Lawrence Livermore National Security, LLC | ||
* (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
* | ||
* This file is part of the Flux resource manager framework. | ||
* For details, see https://github.com/flux-framework. | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0 | ||
\************************************************************/ | ||
|
||
#include "accounting.hpp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/************************************************************\ | ||
* Copyright 2024 Lawrence Livermore National Security, LLC | ||
* (c.f. AUTHORS, NOTICE.LLNS, COPYING) | ||
* | ||
* This file is part of the Flux resource manager framework. | ||
* For details, see https://github.com/flux-framework. | ||
* | ||
* SPDX-License-Identifier: LGPL-3.0 | ||
\************************************************************/ | ||
|
||
// header file for the Accounting class | ||
|
||
#ifndef ACCOUNTING_H | ||
#define ACCOUNTING_H | ||
|
||
#include <vector> | ||
#include <string> | ||
#include <map> | ||
#include <iterator> | ||
|
||
// all attributes are per-user/bank | ||
class Association { | ||
public: | ||
std::string bank_name; // name of bank | ||
double fairshare; // fair share value | ||
int max_run_jobs; // max number of running jobs | ||
int cur_run_jobs; // current number of running jobs | ||
int max_active_jobs; // max number of active jobs | ||
int cur_active_jobs; // current number of active jobs | ||
std::vector<long int> held_jobs; // list of currently held job ID's | ||
std::vector<std::string> queues; // list of accessible queues | ||
int queue_factor; // priority factor associated with queue | ||
int active; // active status | ||
}; | ||
|
||
#endif // ACCOUNTING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters