#include <HierarchicalLB.h>
Public Member Functions | |
HierarchicalLB (const CkLBOptions &) | |
HierarchicalLB (CkMigrateMessage *m) | |
void | avg_load_reduction (double x) |
void | done_hier () |
void | turnOn () |
void | turnOff () |
void | setup_tree () |
void | calc_load_over () |
void | lb_tree_msg (double const child_load, int const child, cont_hier_objid_t load, int child_size) |
child_load_t * | find_min_child () |
void | down_tree_msg (int const &from, cont_hier_objid_t excess_load, bool final_child) |
void | transfer_objects (int const &to_pe, std::vector< int > const &lst) |
void | finished_transfer_requests () |
void | send_down_tree () |
void | distribute_amoung_children () |
bool | QueryBalanceNow (int step) |
Static Public Member Functions | |
static hier_objid_t | convert_to_hier_objid (int const &obj_id, int const &pe) |
static int | hier_objid_get_pe (hier_objid_t const &id) |
static int | hier_objid_get_id (hier_objid_t const &id) |
Private Attributes | |
int | rank = 0 |
int | nproc = 0 |
double | my_load = 0.0 |
double | avg_load = 0.0 |
double | thr_avg = 0.0 |
double | total_child_load = 0.0 |
bool | tree_is_setup = false |
cont_hier_objid_t | obj_sample |
cont_hier_objid_t | given_objs |
cont_hier_objid_t | taken_objs |
cont_hier_objid_t | load_over |
std::unordered_map< int, child_load_t * > | children |
std::unordered_map< int, child_load_t * > | live_children |
Definition at line 39 of file HierarchicalLB.h.
HierarchicalLB::HierarchicalLB | ( | const CkLBOptions & | opt | ) |
Definition at line 37 of file HierarchicalLB.C.
References Converse::CkMyPe().
HierarchicalLB::HierarchicalLB | ( | CkMigrateMessage * | m | ) |
void HierarchicalLB::avg_load_reduction | ( | double | x | ) |
Definition at line 528 of file HierarchicalLB.C.
References avg_load, calc_load_over(), cb, children, Converse::CkMyPe(), Converse::CkNumPes(), CkStartQD(), load_over, my_load, parent(), rank, and thr_avg.
void HierarchicalLB::done_hier | ( | ) |
void HierarchicalLB::turnOn | ( | ) |
Definition at line 46 of file HierarchicalLB.C.
void HierarchicalLB::turnOff | ( | ) |
Definition at line 58 of file HierarchicalLB.C.
HierarchicalLB::hier_objid_t HierarchicalLB::convert_to_hier_objid | ( | int const & | obj_id, | |
int const & | pe | |||
) | [static] |
Definition at line 86 of file HierarchicalLB.C.
int HierarchicalLB::hier_objid_get_pe | ( | hier_objid_t const & | id | ) | [static] |
Definition at line 93 of file HierarchicalLB.C.
int HierarchicalLB::hier_objid_get_id | ( | hier_objid_t const & | id | ) | [static] |
Definition at line 99 of file HierarchicalLB.C.
Referenced by calc_load_over().
void HierarchicalLB::setup_tree | ( | ) |
Definition at line 150 of file HierarchicalLB.C.
References children, Converse::CkMyPe(), Converse::CkNumPes(), nproc, parent(), rank, and tree_is_setup.
void HierarchicalLB::calc_load_over | ( | ) |
Definition at line 199 of file HierarchicalLB.C.
References avg_load, hier_objid_get_id(), load_over, my_load, obj_sample, rank, and size.
Referenced by avg_load_reduction().
void HierarchicalLB::lb_tree_msg | ( | double const | child_load, | |
int const | child, | |||
cont_hier_objid_t | load, | |||
int | child_size | |||
) |
Definition at line 237 of file HierarchicalLB.C.
References avg_load, children, given_objs, rank, and total_child_load.
ChildLoadInfo * HierarchicalLB::find_min_child | ( | ) |
Definition at line 336 of file HierarchicalLB.C.
References c, ChildLoadInfo::cur_load, live_children, ChildLoadInfo::node_size, ChildLoadInfo::pe, and rank.
Referenced by distribute_amoung_children(), and send_down_tree().
void HierarchicalLB::down_tree_msg | ( | int const & | from, | |
cont_hier_objid_t | excess_load, | |||
bool | final_child | |||
) |
Definition at line 361 of file HierarchicalLB.C.
References avg_load, given_objs, my_load, rank, send_down_tree(), and taken_objs.
Definition at line 566 of file HierarchicalLB.C.
void HierarchicalLB::finished_transfer_requests | ( | ) |
Definition at line 581 of file HierarchicalLB.C.
References avg_load, Converse::CkNumPes(), MigrateInfo::from_pe, given_objs, LDObjHandle::handle, load_over, LBMigrateMsg::moves, msg, my_load, LBMigrateMsg::n_moves, MigrateInfo::obj, obj_sample, rank, PUP::t, taken_objs, thr_avg, MigrateInfo::to_pe, and total_child_load.
void HierarchicalLB::send_down_tree | ( | ) |
Definition at line 398 of file HierarchicalLB.C.
References avg_load, c, children, Converse::CkMyPe(), ChildLoadInfo::cur_load, find_min_child(), given_objs, ChildLoadInfo::node_size, ChildLoadInfo::pe, rank, and ChildLoadInfo::recs.
Referenced by down_tree_msg().
void HierarchicalLB::distribute_amoung_children | ( | ) |
Definition at line 480 of file HierarchicalLB.C.
References avg_load, c, ChildLoadInfo::cur_load, find_min_child(), given_objs, ChildLoadInfo::node_size, parent(), ChildLoadInfo::pe, rank, ChildLoadInfo::recs, and total_child_load.
Definition at line 74 of file HierarchicalLB.h.
int HierarchicalLB::rank = 0 [private] |
Definition at line 77 of file HierarchicalLB.h.
Referenced by avg_load_reduction(), calc_load_over(), distribute_amoung_children(), done_hier(), down_tree_msg(), find_min_child(), finished_transfer_requests(), lb_tree_msg(), send_down_tree(), and setup_tree().
int HierarchicalLB::nproc = 0 [private] |
double HierarchicalLB::my_load = 0.0 [private] |
Definition at line 78 of file HierarchicalLB.h.
Referenced by avg_load_reduction(), calc_load_over(), down_tree_msg(), and finished_transfer_requests().
double HierarchicalLB::avg_load = 0.0 [private] |
Definition at line 78 of file HierarchicalLB.h.
Referenced by avg_load_reduction(), calc_load_over(), distribute_amoung_children(), down_tree_msg(), finished_transfer_requests(), lb_tree_msg(), and send_down_tree().
double HierarchicalLB::thr_avg = 0.0 [private] |
Definition at line 78 of file HierarchicalLB.h.
Referenced by avg_load_reduction(), and finished_transfer_requests().
double HierarchicalLB::total_child_load = 0.0 [private] |
Definition at line 78 of file HierarchicalLB.h.
Referenced by distribute_amoung_children(), finished_transfer_requests(), and lb_tree_msg().
bool HierarchicalLB::tree_is_setup = false [private] |
cont_hier_objid_t HierarchicalLB::obj_sample [private] |
Definition at line 82 of file HierarchicalLB.h.
Referenced by calc_load_over(), and finished_transfer_requests().
cont_hier_objid_t HierarchicalLB::given_objs [private] |
Definition at line 82 of file HierarchicalLB.h.
Referenced by distribute_amoung_children(), done_hier(), down_tree_msg(), finished_transfer_requests(), lb_tree_msg(), and send_down_tree().
cont_hier_objid_t HierarchicalLB::taken_objs [private] |
Definition at line 82 of file HierarchicalLB.h.
Referenced by done_hier(), down_tree_msg(), and finished_transfer_requests().
cont_hier_objid_t HierarchicalLB::load_over [private] |
Definition at line 82 of file HierarchicalLB.h.
Referenced by avg_load_reduction(), calc_load_over(), and finished_transfer_requests().
std::unordered_map<int, child_load_t*> HierarchicalLB::children [private] |
Definition at line 83 of file HierarchicalLB.h.
Referenced by avg_load_reduction(), lb_tree_msg(), send_down_tree(), and setup_tree().
std::unordered_map<int, child_load_t*> HierarchicalLB::live_children [private] |