8#ifndef SRC_DECOMPOSITION_DLB_HPP_
9#define SRC_DECOMPOSITION_DLB_HPP_
60 SAR_HEURISTIC, UNBALANCE_THRLD
66 THRLD_LOW = 5, THRLD_MEDIUM = 7, THRLD_HIGH = 10
109 float t_max = t, t_avg = t;
150 std::cerr <<
"Error: Un-balance value must be set before checking DLB.";
void endIteration(size_t t)
Set the end time when the previous rebalance has been performed.
void setSimulationStartTime(size_t t)
Set start time for the simulation.
DLB(Vcluster<> &v_cl)
Constructor for DLB class.
bool SAR()
Function that gather times informations and decides if a rebalance is needed it uses the SAR heuristi...
void setHeurisitc(Heuristic h)
Set the heuristic to use (default: un-balance threshold)
void setThresholdLevel(ThresholdLevel t)
threshold of umbalance to start a rebalance
float w_n
Wn for SAR heuristic.
size_t getSimulationEndTime()
Get end time for the simulation.
Heuristic heuristic
Type of the heuristic to use.
ThresholdLevel
Level of un-balance needed to trigger the re-balance.
bool unbalanceThreshold()
Check if the un-balance has exceeded the threshold.
ThresholdLevel thl
Threshold value.
float i_time
Idle time accumulated so far, needed for SAR heuristic.
Heuristic
Type of DLB heuristics.
Vcluster & v_cl
Runtime virtual cluster machine.
bool rebalanceNeeded()
check if a re-balance is needed using the selected heuristic
void startIteration(size_t t)
Set start time for the single iteration.
Times timeInfo
Structure that will contain all the timings.
void setUnbalance(float u)
Set un-balance value.
size_t getNTimeStepSinceDLB()
Get how many time-steps have passed since the last re-balancing.
void startIteration()
Set start time for the single iteration.
float c_c
Computation cost for SAR heuristic.
openfpm::vector< long > times
Vector to collect all timings.
void setTimeStep(double t)
Set delta time step for one iteration (Computation time)
void setComputationCost(size_t computation)
Set time step for the single iteration.
float unbalance
Un-balance value.
size_t n_ts
Number of time-steps since the previous DLB.
Heuristic getHeurisitc()
Get the heuristic.
void setSimulationEndTime(size_t t)
Set end time for the simulation.
void endIteration()
Set end time for the single iteration.
size_t getSimulationStartTime()
Get start time for the simulation.
void execute()
Execute all the requests.
void sum(T &num)
Sum the numbers across all processors and get the result.
size_t getProcessingUnits()
Get the total number of processors.
void max(T &num)
Get the maximum number across all processors (or reduction with infinity norm)
Implementation of VCluster class.
Implementation of 1-D std::vector like structure.
Time structure for statistical purposes.
size_t simulationStartTime
starting time of the simulation (0)
size_t simulationEndTime
End iteration of the simulation.
size_t iterationStartTime
Interval between teo rebalance.
size_t iterationEndTime
End time.
double timeStep
integration time