XGCa
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
LoadBalance Class Reference

#include <load_balance.hpp>

Collaboration diagram for LoadBalance:
Collaboration graph
[legend]

Public Types

enum  WeightingAlgorithm { WeightingAlgorithm::SingleRegionBalance =0, WeightingAlgorithm::ParticleBalance, WeightingAlgorithm::Fortran, WeightingAlgorithm::Default }
 
enum  ConstraintOption { ConstraintOption::ParticleCount =0 }
 
enum  ReweightOption { ReweightOption::Always =0, ReweightOption::IfBetter }
 

Public Member Functions

 LoadBalance (NLReader::NamelistReader &nlr, const DomainDecomposition< DeviceType > &pol_decomp)
 
void rebalance (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const VelocityGrid &vgrid, Plasma &plasma, DomainDecomposition< DeviceType > &pol_decomp, ReweightOption reweight_option, WeightingAlgorithm weighting_algorithm=WeightingAlgorithm::Default)
 

Private Member Functions

double get_even_division (const View< double *, HostType > &input, int n) const
 
bool greedily_fill_partition (const View< double *, HostType > &weight, const View< double *, HostType > &constraint1, double target_weight_per_rank)
 
double get_largest_predicted_time (const View< int *, CLayout, HostType > &partition, const View< double *, HostType > &weight) const
 
void one_weight_balance (const View< double *, HostType > &weight, const View< double *, CLayout, HostType > constraint1)
 
bool recommend_proposed_partition ()
 
void print_new_partition ()
 
void update_model (const View< int *, CLayout, HostType > &current_partition)
 
void initialize_model ()
 
bool model_is_initialized ()
 
void propose_new_partition (const Kokkos::View< double *, Kokkos::LayoutRight, HostType > &ptl_count, WeightingAlgorithm weighting_algorithm)
 
void set_new_partition (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const VelocityGrid &vgrid, Plasma &plasma, DomainDecomposition< DeviceType > &pol_decomp, WeightingAlgorithm weighting_algorithm)
 
void redistribute_load (const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, const VelocityGrid &vgrid, Plasma &plasma, DomainDecomposition< DeviceType > &pol_decomp, const View< int *, CLayout, HostType > &old_partition)
 
bool will_rebalance (ReweightOption reweight_option, WeightingAlgorithm weighting_algorithm, double f0_cost)
 

Private Attributes

WeightingAlgorithm default_weighting_algorithm
 
std::vector< LoadRegionregions
 
View< int *, CLayout, HostTypeproposed_partition
 Which processors get which vertices. More...
 
double threshold_to_rebalance
 
bool verbose
 
double constraint1_max
 

Member Enumeration Documentation

Enumerator
ParticleCount 
Enumerator
Always 
IfBetter 
Enumerator
SingleRegionBalance 
ParticleBalance 
Fortran 
Default 

Constructor & Destructor Documentation

LoadBalance::LoadBalance ( NLReader::NamelistReader nlr,
const DomainDecomposition< DeviceType > &  pol_decomp 
)
inline

Here is the call graph for this function:

Member Function Documentation

double LoadBalance::get_even_division ( const View< double *, HostType > &  input,
int  n 
) const
inlineprivate

Here is the caller graph for this function:

double LoadBalance::get_largest_predicted_time ( const View< int *, CLayout, HostType > &  partition,
const View< double *, HostType > &  weight 
) const
inlineprivate

Here is the caller graph for this function:

bool LoadBalance::greedily_fill_partition ( const View< double *, HostType > &  weight,
const View< double *, HostType > &  constraint1,
double  target_weight_per_rank 
)
inlineprivate

Here is the caller graph for this function:

void LoadBalance::initialize_model ( )
inlineprivate
bool LoadBalance::model_is_initialized ( )
inlineprivate
void LoadBalance::one_weight_balance ( const View< double *, HostType > &  weight,
const View< double *, CLayout, HostType constraint1 
)
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

void LoadBalance::print_new_partition ( )
inlineprivate

Here is the caller graph for this function:

void LoadBalance::propose_new_partition ( const Kokkos::View< double *, Kokkos::LayoutRight, HostType > &  ptl_count,
WeightingAlgorithm  weighting_algorithm 
)
inlineprivate

Here is the call graph for this function:

void LoadBalance::rebalance ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const VelocityGrid vgrid,
Plasma plasma,
DomainDecomposition< DeviceType > &  pol_decomp,
ReweightOption  reweight_option,
WeightingAlgorithm  weighting_algorithm = WeightingAlgorithm::Default 
)
inline

Here is the call graph for this function:

Here is the caller graph for this function:

bool LoadBalance::recommend_proposed_partition ( )
inlineprivate

Here is the caller graph for this function:

void LoadBalance::redistribute_load ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const VelocityGrid vgrid,
Plasma plasma,
DomainDecomposition< DeviceType > &  pol_decomp,
const View< int *, CLayout, HostType > &  old_partition 
)
inlineprivate

Here is the call graph for this function:

void LoadBalance::set_new_partition ( const Simulation< DeviceType > &  sml,
const Grid< DeviceType > &  grid,
const MagneticField< DeviceType > &  magnetic_field,
const VelocityGrid vgrid,
Plasma plasma,
DomainDecomposition< DeviceType > &  pol_decomp,
WeightingAlgorithm  weighting_algorithm 
)
inlineprivate

Here is the call graph for this function:

void LoadBalance::update_model ( const View< int *, CLayout, HostType > &  current_partition)
inlineprivate
bool LoadBalance::will_rebalance ( ReweightOption  reweight_option,
WeightingAlgorithm  weighting_algorithm,
double  f0_cost 
)
inlineprivate

Here is the call graph for this function:

Member Data Documentation

double LoadBalance::constraint1_max
private
WeightingAlgorithm LoadBalance::default_weighting_algorithm
private
View<int*,CLayout,HostType> LoadBalance::proposed_partition
private

Which processors get which vertices.

std::vector<LoadRegion> LoadBalance::regions
private
double LoadBalance::threshold_to_rebalance
private
bool LoadBalance::verbose
private

The documentation for this class was generated from the following file: