|
chombo-discharge
|
Static class which contains various load balancing routines. More...
#include <CD_LoadBalancing.H>
Static Public Member Functions | |
| template<class T > | |
| static void | makeBalance (Vector< int > &a_ranks, const Vector< T > &a_loads, const Vector< Box > &a_boxes) |
| Load balancing, assigning ranks to boxes. | |
| template<class T > | |
| static void | makeBalance (Vector< int > &a_ranks, Loads &a_rankLoads, const Vector< T > &a_boxLoads, const Vector< Box > &a_boxes) |
| Load balancing, assigning ranks to boxes. | |
| template<typename T > | |
| static void | sort (Vector< Vector< Box > > &a_boxes, Vector< Vector< T > > &a_loads, const BoxSorting a_whichSorting) |
| Sorts boxes and loads over a hierarchy according to some sorting criterion. | |
| template<typename T > | |
| static void | sort (Vector< Box > &a_boxes, Vector< T > &a_loads, const BoxSorting a_which) |
| Sorting function for sorting boxes and loads. | |
| static void | sort (Vector< Box > &a_boxes, const BoxSorting a_which) |
| Sorts boxes (according to sorting argument) | |
| static void | gatherBoxes (Vector< Box > &a_boxes) |
| Gather boxes. | |
| static void | gatherLoads (Vector< Real > &a_loads) |
| Gather computational loads. | |
| static void | gatherLoads (Vector< int > &a_loads) |
| Gather compute loads. | |
| static void | gatherLoads (Vector< long > &a_loads) |
| Gather compute loads. | |
| static void | gatherBoxesAndLoads (Vector< Box > &a_boxes, Vector< int > &a_loads) |
| Gather boxes and loads. | |
Static Protected Member Functions | |
| template<class T > | |
| static std::vector< std::pair< Box, T > > | packPairs (const Vector< Box > &a_boxes, const Vector< T > &a_loads) |
| Utility function which packs boxes and loads into a vector of pairs. | |
| template<class T > | |
| static void | unpackPairs (Vector< Box > &a_boxes, Vector< T > &a_loads, const std::vector< std::pair< Box, T > > &a_pairs) |
| Splits vector pair into separate boxes and loads. | |
| template<class T > | |
| static void | standardSort (Vector< Box > &a_boxes, Vector< T > &a_loads) |
| Standard box sorting, calls C++ std::sort. | |
| template<class T > | |
| static void | shuffleSort (Vector< Box > &a_boxes, Vector< T > &a_loads) |
| Randomly shuffles boxes and loads. | |
| template<class T , int DIM> | |
| static void | sortSFC (Vector< Box > &a_boxes, Vector< T > &a_loads, const std::function< uint64_t(const std::array< uint32_t, DIM >)> &a_sfcEncoder) noexcept |
| Generic SFC sorting function. | |
| template<int DIM> | |
| static uint64_t | mortonIndex (const std::array< uint32_t, DIM > a_coords) noexcept |
| Helper function for computing a Morton code using 21 bits per direction. | |
| template<int DIM> | |
| static uint64_t | hilbertIndex (const std::array< uint32_t, DIM > &a_coords) |
| Helper function for computing a Hilbert index. | |
Static class which contains various load balancing routines.
Gather boxes.
| [in,out] | a_boxes | Local boxes |
Gather boxes and loads.
| [in,out] | a_boxes | Grid boxes |
| [in,out] | a_loads | Computational loads |
Gather compute loads.
| [in,out] | a_loads | Computational loads |
Gather compute loads.
| [in,out] | a_loads | Computational loads |
Gather computational loads.
| [in,out] | a_loads | Computational loads |
|
static |
Load balancing, assigning ranks to boxes.
This version does not take into loads already assigned to ranks and will thus always start assigning from rank 0.
| [out] | a_ranks | Vector containing processor IDs corresponding to boxes (and loads) |
| [in] | a_loads | Computational loads |
| [in] | a_boxes | Grid boxes |
|
static |
Load balancing, assigning ranks to boxes.
This version takes into account loads already assigned to ranks, and assigns grid subsets to the least loaded ranks.
| [out] | a_ranks | Vector containing processor IDs corresponding to boxes (and loads) |
| [in,out] | a_rankLoads | MPI rank loads so far |
| [in] | a_boxLoads | Computational loads for each box |
| [in] | a_boxes | Grid boxes |
|
staticprotectednoexcept |
Helper function for computing a Morton code using 21 bits per direction.
| [in] | a_coords |
|
staticprotected |
Utility function which packs boxes and loads into a vector of pairs.
| [in] | a_boxes | Grid boxes |
| [in] | a_loads | Computational loads |
|
staticprotected |
Randomly shuffles boxes and loads.
| [in,out] | a_boxes | Grid boxes to be shuffled. |
| [in,out] | a_loads | Computational loads to be shuffled. |
This shuffles the boxes and loads so that the box distribution is random.
|
static |
Sorts boxes (according to sorting argument)
| [in,out] | a_boxes | Grid boxes |
|
static |
Sorting function for sorting boxes and loads.
| [in,out] | a_boxes | Grid boxes |
| [in,out] | a_loads | Computational loads |
| [in] | a_whichSorting |
|
static |
Sorts boxes and loads over a hierarchy according to some sorting criterion.
| [in,out] | a_boxes | Grid boxes |
| [in,out] | a_loads | Computational loads |
| [in] | a_whichSorting |
|
staticprotectednoexcept |
Generic SFC sorting function.
| [in,out] | a_boxes | Grid boxes to be sorted |
| [in,out] | a_loads | Computational loads to be sorted along with the boxes. |
| [in] | a_sfcEncoder | Function for turning a grid index into an SFC index. |
|
staticprotected |
Standard box sorting, calls C++ std::sort.
| [in,out] | a_boxes | Boxes to be sorted. |
| [in,out] | a_loads | Loads to be sorted. |
This uses lexicographical indexing of boxes. On output, the boxes/loads are sorted with this ordering.
|
staticprotected |
Splits vector pair into separate boxes and loads.
| [out] | a_boxes | Boxes. |
| [out] | a_loads | Loads. |
| [out] | a_pairs | Boxes and loads, stored as a pair. |