Class MergingLoadBalancer merges the boxes generated by a load balancer in a final step to decrease the total number of boxes. In essence, it postprocesses the list of boxes generated by its parent class to try and coalesce the set of boxes on each process.
More...
#include <ibtk/MergingLoadBalancer.h>
|
| virtual void | loadBalanceBoxes (SAMRAI::hier::BoxArray< NDIM > &out_boxes, SAMRAI::hier::ProcessorMapping &mapping, const SAMRAI::hier::BoxList< NDIM > &in_boxes, const SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, const SAMRAI::hier::BoxArray< NDIM > &physical_domain, const SAMRAI::hier::IntVector< NDIM > &ratio_to_hierarchy_level_zero, const SAMRAI::hier::IntVector< NDIM > &min_size, const SAMRAI::hier::IntVector< NDIM > &max_size, const SAMRAI::hier::IntVector< NDIM > &cut_factor, const SAMRAI::hier::IntVector< NDIM > &bad_interval) const override |
| |
| void | setMaxWorkloadFactor (double factor, int level_number=-1) |
| |
| void | setWorkloadTolerance (double tolerance, int level_number=-1) |
| |
| void | setWorkloadPatchDataIndex (int data_id, int level_number=-1) |
| |
| void | setUniformWorkload (int level_number=-1) |
| |
| void | setBinPackMethod (const std::string &method, int level_number=-1) |
| |
| void | setIgnoreLevelDomainIsSingleBox (bool flag) |
| |
| bool | getLoadBalanceDependsOnPatchData (int level_number) const |
| |
| void | loadBalanceBoxes (hier::BoxArray< DIM > &out_boxes, hier::ProcessorMapping &mapping, const hier::BoxList< DIM > &in_boxes, const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, int level_number, const hier::BoxArray< DIM > &physical_domain, const hier::IntVector< DIM > &ratio_to_hierarchy_level_zero, const hier::IntVector< DIM > &min_size, const hier::IntVector< DIM > &max_size, const hier::IntVector< DIM > &cut_factor, const hier::IntVector< DIM > &bad_interval) const |
| |
| virtual void | printClassData (std::ostream &os) const |
| |
|
| void | getFromInput (tbox::Pointer< tbox::Database > db) |
| |
| void | chopUniformSingleBox (hier::BoxArray< DIM > &out_boxes, tbox::Array< double > &out_workloads, const hier::Box< DIM > &in_box, const hier::IntVector< DIM > &min_size, const hier::IntVector< DIM > &max_size, const hier::IntVector< DIM > &cut_factor, const hier::IntVector< DIM > &bad_interval, const hier::BoxArray< DIM > &physical_domain) const |
| |
| void | chopBoxesWithUniformWorkload (hier::BoxArray< DIM > &out_boxes, tbox::Array< double > &out_workloads, const hier::BoxList< DIM > &in_boxes, const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, int level_number, const hier::IntVector< DIM > &min_size, const hier::IntVector< DIM > &max_size, const hier::IntVector< DIM > &cut_factor, const hier::IntVector< DIM > &bad_interval, const hier::BoxArray< DIM > &physical_domain) const |
| |
| void | chopBoxesWithNonuniformWorkload (hier::BoxArray< DIM > &out_boxes, tbox::Array< double > &out_workloads, const hier::BoxList< DIM > &in_boxes, const tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, int level_number, const hier::IntVector< DIM > &ratio_to_coarsest_hierarchy_level, int wrk_indx, const hier::IntVector< DIM > &min_size, const hier::IntVector< DIM > &max_size, const hier::IntVector< DIM > &cut_factor, const hier::IntVector< DIM > &bad_interval, const hier::BoxArray< DIM > &physical_domain) const |
| |
| void | binPackBoxes (hier::BoxArray< DIM > &boxes, hier::ProcessorMapping &mapping, tbox::Array< double > &workloads, const std::string &bin_pack_method) const |
| |
| int | getWorkloadDataId (int level_number) const |
| |
| double | getMaxWorkloadFactor (int level_number) const |
| |
| double | getWorkloadTolerance (int level_number) const |
| |
| std::string | getBinPackMethod (int level_number) const |
| |
- Note
- During regridding, the boxes generated by this class are subsequently read by GriddingAlgorithm, which will enforce minimum and maximum size constraints; i.e., to take full advantage of this class one must set up the GriddingAlgorithm objects to have very large maximum box sizes.
◆ loadBalanceBoxes() [1/2]
| virtual void IBTK::MergingLoadBalancer::loadBalanceBoxes |
( |
SAMRAI::hier::BoxArray< NDIM > & |
out_boxes, |
|
|
SAMRAI::hier::ProcessorMapping & |
mapping, |
|
|
const SAMRAI::hier::BoxList< NDIM > & |
in_boxes, |
|
|
const SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > |
hierarchy, |
|
|
int |
level_number, |
|
|
const SAMRAI::hier::BoxArray< NDIM > & |
physical_domain, |
|
|
const SAMRAI::hier::IntVector< NDIM > & |
ratio_to_hierarchy_level_zero, |
|
|
const SAMRAI::hier::IntVector< NDIM > & |
min_size, |
|
|
const SAMRAI::hier::IntVector< NDIM > & |
max_size, |
|
|
const SAMRAI::hier::IntVector< NDIM > & |
cut_factor, |
|
|
const SAMRAI::hier::IntVector< NDIM > & |
bad_interval |
|
) |
| const |
|
overridevirtual |
◆ setMaxWorkloadFactor()
Set the max workload factor for either the specified level or all hierarchy levels. See discussion about inputs above for information on how this value is used during load balancing operations.
- Parameters
-
| factor | Double value of multiplier for average workload used in box chopping. The default value is 1.0. |
| level_number | Optional integer number for level to which factor is applied. If no value is given, the factor will be used for all levels. |
◆ setWorkloadTolerance()
Set the workload tolerance for either the specified level or all hierarchy levels. See discussion about inputs above for information on how this value is used during load balancing operations.
- Parameters
-
| factor | Double value of tolerance. The default value is 0.0; |
| level_number | Optional integer number for level to which factor is applied. If no value is given, the value will be used for all levels. |
◆ setWorkloadPatchDataIndex()
Configure the load balancer to use the data stored in the hierarchy at the specified descriptor index for estimating the workload on each cell.
- Parameters
-
| data_id | Integer value of patch data identifier for workload estimate on each cell. |
| level_number | Optional integer number for level on which data id is used. If no value is given, the data will be used for all levels. |
◆ setUniformWorkload()
Configure the load balancer to load balance boxes by assuming all cells on the specified level or all hierarchy levels are weighted equally.
- Parameters
-
| level_number | Optional integer number for level on which uniform workload estimate will be used. If the level number is not specified, a uniform workload estimate will be used on all levels. |
◆ setBinPackMethod()
Configure the load balancer to use the bin-packing procedure for mapping patches to processors indicated by the string.
- Parameters
-
| method | String value indicating bin-packing method to use. See input file description above for valid options. The default value is "GREEDY". |
| level_number | Optional integer number for level on which bin-packing method will be used. If no value is given, the prescribed methods will be used on all levels. |
◆ setIgnoreLevelDomainIsSingleBox()
Set the boolean flag to control chopping of level boxes when the union of the input boxes passed to the loadBalanceBoxes() routine is a single box. The default value is false, which means that the domain will be chopped to make patch boxes based on the (single box) union of the boxes describing the level regardless of the input boxes. When the value is set to true, the domain will be chopped by chopping each of the input boxes.
- Parameters
-
| flag | Boolean value indicating whether to ignore the set of input boxes to the loadBalanceBoxes() routine when the union of those boxes is a single box. |
◆ getLoadBalanceDependsOnPatchData()
Return true if load balancing procedure for given level depends on patch data on mesh; otherwise return false. This can be used to determine whether a level needs to be rebalanced although its box configuration is unchanged. This function is pure virtual in the LoadBalanceStrategy<DIM> base class.
- Returns
- Boolean value indicating whether load balance depends on patch data.
- Parameters
-
| level_number | Integer patch level number. |
Implements SAMRAI::mesh::LoadBalanceStrategy< DIM >.
◆ loadBalanceBoxes() [2/2]
| void SAMRAI::mesh::LoadBalancer< DIM >::loadBalanceBoxes |
( |
hier::BoxArray< DIM > & |
out_boxes, |
|
|
hier::ProcessorMapping & |
mapping, |
|
|
const hier::BoxList< DIM > & |
in_boxes, |
|
|
const tbox::Pointer< hier::PatchHierarchy< DIM > > |
hierarchy, |
|
|
int |
level_number, |
|
|
const hier::BoxArray< DIM > & |
physical_domain, |
|
|
const hier::IntVector< DIM > & |
ratio_to_hierarchy_level_zero, |
|
|
const hier::IntVector< DIM > & |
min_size, |
|
|
const hier::IntVector< DIM > & |
max_size, |
|
|
const hier::IntVector< DIM > & |
cut_factor, |
|
|
const hier::IntVector< DIM > & |
bad_interval |
|
) |
| const |
|
virtualinherited |
Given a list of boxes, representing the domain of a level in the AMR hierarchy, generate an array of boxes and an associated processor mapping from which the patches for the level will be generated and assigned. The resulting boxes and processor mapping will be determined based on parameters set via input or member functions above. This function is pure virtual in the LoadBalanceStrategy<DIM> base class.
- Parameters
-
| out_boxes | Output box array for generating patches on level. |
| mapping | Output processor mapping for patches on level. |
| in_boxes | Input box list representing union of patches on level. |
| hierarchy | Input patch hierarchy in which level will reside. |
| level_number | Input integer number of level in patch hierarchy. This value must be >= 0. |
| physical_domain | Array of boxes describing the physical extent of the problem domain in the index space associated with the level. This box array cannot be empty. |
| ratio_to_hierarchy_level_zero | Input integer vector indicating ratio between index space of level to load balance and hierarchy level 0 (i.e., coarsest hierarchy level). |
| min_size | Input integer vector of minimum dimensions for output boxes. All entries must be > 0. |
| max_size | Input integer vector of maximum dimensions for output boxes. All entries must be >= min_size. |
| cut_factor | Input integer vector used to create boxes with correct dimensions. The length of each box dimension will be an integer multiple of the corresponding cut factor vector entry. All vector entries must be > 0. See hier::BoxUtilities documentation for more details. |
| bad_interval | Input integer vector used to create boxes near physical domain boundary with sufficient number of cells. No box face will be closer to the boundary than the corresponding interval of cells to the boundary (the corresponding value is given by the normal direction of the box face) unless the face coincides with the boundary itself. The point of this argument is to have no patch live within a certain ghost cell width of the boundary if its boundary does not coincide with that boundary . That is, all ghost cells along a face will be either in the domain interior or outside the domain. All entries must be >= 0. See hier::BoxUtilities documentation for more details. |
Implements SAMRAI::mesh::LoadBalanceStrategy< DIM >.
◆ printClassData()
Print out all members of the class instance to given output stream.
◆ getFromInput()
◆ chopUniformSingleBox()
◆ chopBoxesWithUniformWorkload()
◆ chopBoxesWithNonuniformWorkload()
| void SAMRAI::mesh::LoadBalancer< DIM >::chopBoxesWithNonuniformWorkload |
( |
hier::BoxArray< DIM > & |
out_boxes, |
|
|
tbox::Array< double > & |
out_workloads, |
|
|
const hier::BoxList< DIM > & |
in_boxes, |
|
|
const tbox::Pointer< hier::PatchHierarchy< DIM > > |
hierarchy, |
|
|
int |
level_number, |
|
|
const hier::IntVector< DIM > & |
ratio_to_coarsest_hierarchy_level, |
|
|
int |
wrk_indx, |
|
|
const hier::IntVector< DIM > & |
min_size, |
|
|
const hier::IntVector< DIM > & |
max_size, |
|
|
const hier::IntVector< DIM > & |
cut_factor, |
|
|
const hier::IntVector< DIM > & |
bad_interval, |
|
|
const hier::BoxArray< DIM > & |
physical_domain |
|
) |
| const |
|
privateinherited |
◆ binPackBoxes()
◆ getWorkloadDataId()
◆ getMaxWorkloadFactor()
◆ getWorkloadTolerance()
◆ getBinPackMethod()
◆ d_object_name
◆ d_processor_layout_specified
◆ d_processor_layout
◆ d_ignore_level_box_union_is_single_box
◆ d_master_workload_data_id
◆ d_master_max_workload_factor
◆ d_master_workload_tolerance
◆ d_master_bin_pack_method
◆ d_workload_data_id
◆ d_max_workload_factor
◆ d_workload_tolerance
◆ d_bin_pack_method
◆ d_opt_for_single_box
◆ t_load_balance_boxes
◆ t_load_balance_boxes_remove_intersection
◆ t_bin_pack_boxes
◆ t_bin_pack_boxes_sort
◆ t_bin_pack_boxes_pack
◆ t_chop_boxes
The documentation for this class was generated from the following file: