#include <BCP_process.hpp>
Public Member Functions | |
BCP_scheduler () | |
Default constructor. More... | |
void | setParams (double OverEstimationStatic, double SwitchToRateThreshold, double TimeRootNodeSolve, double FactorTimeHorizon, double OverEstimationRate, double MaxNodeIdRatio, int MaxNodeIdNum, int MaxSbIdNum, int MinSbIdNum) |
Method for setting scheduler parameters. More... | |
void | add_free_ids (int numIds, const int *ids) |
Pass in a list of freeIds_ to add. More... | |
int | request_sb_ids (int numIds, int *ids) |
Request for a number of id's to do some strong branching. More... | |
void | release_sb_id (int id) |
Gives back to scheduler an id used for strong branching. More... | |
int | request_node_id () |
Request an id for processing nodes. More... | |
void | release_node_id (int id) |
Give back an id to scheduler used for processing a node. More... | |
bool | has_free_node_id () const |
Decide if there is an id that can be returned for processin a node. More... | |
int | numNodeIds () const |
Return the number of busy LP processes. More... | |
int | maxNodeIds () const |
Return the maximum possible number of busy LP processes. More... | |
double | node_idle (int p) |
Return how much time did process p spent idling as a node process. More... | |
double | sb_idle (int p) |
Return how much time did process p spent idling as a SB process. More... | |
void | update_idle_times () |
Update idle times with the last idle time. More... | |
Private Member Functions | |
int | max_id_allocation (int numIds) |
Compute max allowed allocation of CPUs. More... | |
void | update_rates (int add_req, int add_rel) |
Update the counts and the static_ flag. More... | |
Private Attributes | |
std::map< int, double > | sb_idle_time_ |
the SB idle time for each process More... | |
std::map< int, double > | node_idle_time_ |
the node idle time for each process More... | |
std::map< int, double > | last_release_type_ |
the type of the last release (0: algo start, 1: from SB, 2: from node More... | |
std::map< int, double > | last_release_time_ |
when was the process release last time More... | |
int | totalNumberIds_ |
Store the total number of CPUs. More... | |
std::vector< int > | freeIds_ |
List of free CPUs ids. More... | |
int | numNodeIds_ |
number of lp ids served. More... | |
int | maxNodeIds_ |
The maximum number of lp ids that can be served. More... | |
double | maxNodeIdRatio_ |
At most this fraction of the total number of ids can be used as a nodeid. More... | |
int | maxNodeIdNum_ |
At most this many ids can be used as a nodeid. More... | |
int | maxSbIds_ |
Upper threshold for IDs returned at a request. More... | |
int | minSbIds_ |
Lower threshold for IDs returned at a request. More... | |
double | rho_static_ |
overestimation factor for static strategy More... | |
double | switch_thresh_ |
percentage threshold to swtich to rate-based strategy More... | |
int | numSecRateInterval_ |
Number of seconds in time horizon for rate computation. More... | |
std::vector< int > | request_counts_ |
vector for counting id requests per time unit More... | |
int | request_counts_tot_ |
total number of requests in considered time interval More... | |
std::vector< int > | release_counts_ |
vector for counting released sb id requests per time unit More... | |
int | release_counts_tot_ |
total number of releases in considered time interval More... | |
int | counts_ptr_ |
Array counter. More... | |
time_t | time_last_action_ |
Time stamp of last request or release. More... | |
double | rho_rate_ |
overestimation factor for rate-based strategy More... | |
bool | static_ |
flag indicating whether we are in the static or the rate-based phase More... | |
bool | have_rates_ |
flag indicating whether we have rate information (i.e., the time horizon has passed at least once) More... | |
Definition at line 49 of file BCP_process.hpp.
BCP_scheduler::BCP_scheduler | ( | ) |
Default constructor.
Definition at line 19 of file BCP_process.cpp.
void BCP_scheduler::setParams | ( | double | OverEstimationStatic, |
double | SwitchToRateThreshold, | ||
double | TimeRootNodeSolve, | ||
double | FactorTimeHorizon, | ||
double | OverEstimationRate, | ||
double | MaxNodeIdRatio, | ||
int | MaxNodeIdNum, | ||
int | MaxSbIdNum, | ||
int | MinSbIdNum | ||
) |
Method for setting scheduler parameters.
OverEstimationStatic,: | Factor for providing more IDs in static strategy. |
SwitchToRateThreshold,: | When more than SwitchToRateThreshold times the number of strong-branching CPUs are busy, which to rate-based strategy. |
TimeRootNodeSolve,: | Time to solve root node NLP (in secs) |
FactorTimeHorizon,: | This number times TimeRootNodeSolve is used to compute the rates |
OverEstimationRate,: | Factor for providing more IDs in rate-based strategy. |
MaxNodeIdRatio,: | At most this fraction of the total number of ids can be used as a nodeid. |
MaxNodeIdNum,: | At most this many ids can be used as a nodeid. |
Definition at line 29 of file BCP_process.cpp.
Pass in a list of freeIds_ to add.
Definition at line 67 of file BCP_process.cpp.
Request for a number of id's to do some strong branching.
NOTE: ids must be already allocated to be at least numIds
size.
numIds | : number of ids requested |
ids | : filled vector with the number of ids served. |
Definition at line 85 of file BCP_process.cpp.
Gives back to scheduler an id used for strong branching.
Definition at line 121 of file BCP_process.cpp.
int BCP_scheduler::request_node_id | ( | ) |
Request an id for processing nodes.
Definition at line 135 of file BCP_process.cpp.
Give back an id to scheduler used for processing a node.
Definition at line 145 of file BCP_process.cpp.
|
inline |
Decide if there is an id that can be returned for processin a node.
Definition at line 91 of file BCP_process.hpp.
|
inline |
Return the number of busy LP processes.
Definition at line 95 of file BCP_process.hpp.
|
inline |
Return the maximum possible number of busy LP processes.
Definition at line 99 of file BCP_process.hpp.
|
inline |
Return how much time did process p spent idling as a node process.
Definition at line 103 of file BCP_process.hpp.
|
inline |
Return how much time did process p spent idling as a SB process.
Definition at line 107 of file BCP_process.hpp.
void BCP_scheduler::update_idle_times | ( | ) |
Update idle times with the last idle time.
Definition at line 158 of file BCP_process.cpp.
Compute max allowed allocation of CPUs.
Definition at line 217 of file BCP_process.cpp.
Update the counts and the static_ flag.
Definition at line 175 of file BCP_process.cpp.
|
private |
the SB idle time for each process
Definition at line 121 of file BCP_process.hpp.
|
private |
the node idle time for each process
Definition at line 123 of file BCP_process.hpp.
|
private |
the type of the last release (0: algo start, 1: from SB, 2: from node
Definition at line 125 of file BCP_process.hpp.
|
private |
when was the process release last time
Definition at line 127 of file BCP_process.hpp.
|
private |
Store the total number of CPUs.
Definition at line 129 of file BCP_process.hpp.
|
private |
List of free CPUs ids.
Definition at line 131 of file BCP_process.hpp.
|
private |
number of lp ids served.
Definition at line 133 of file BCP_process.hpp.
|
private |
The maximum number of lp ids that can be served.
Definition at line 135 of file BCP_process.hpp.
|
private |
At most this fraction of the total number of ids can be used as a nodeid.
Definition at line 139 of file BCP_process.hpp.
|
private |
At most this many ids can be used as a nodeid.
This is a parameter to the class. The true max is stored in maxNodeIds_
Definition at line 142 of file BCP_process.hpp.
|
private |
Upper threshold for IDs returned at a request.
If more than that number are requested (and are available) we still return this many.
Definition at line 145 of file BCP_process.hpp.
|
private |
Lower threshold for IDs returned at a request.
If less than that number are requested, we still return less.
Definition at line 148 of file BCP_process.hpp.
|
private |
overestimation factor for static strategy
Definition at line 151 of file BCP_process.hpp.
|
private |
percentage threshold to swtich to rate-based strategy
Definition at line 153 of file BCP_process.hpp.
|
private |
Number of seconds in time horizon for rate computation.
Definition at line 155 of file BCP_process.hpp.
|
private |
vector for counting id requests per time unit
Definition at line 157 of file BCP_process.hpp.
|
private |
total number of requests in considered time interval
Definition at line 159 of file BCP_process.hpp.
|
private |
vector for counting released sb id requests per time unit
Definition at line 161 of file BCP_process.hpp.
|
private |
total number of releases in considered time interval
Definition at line 163 of file BCP_process.hpp.
|
private |
Array counter.
Definition at line 165 of file BCP_process.hpp.
|
private |
Time stamp of last request or release.
Definition at line 167 of file BCP_process.hpp.
|
private |
overestimation factor for rate-based strategy
Definition at line 169 of file BCP_process.hpp.
|
private |
flag indicating whether we are in the static or the rate-based phase
Definition at line 172 of file BCP_process.hpp.
|
private |
flag indicating whether we have rate information (i.e., the time horizon has passed at least once)
Definition at line 175 of file BCP_process.hpp.