aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.H
diff options
context:
space:
mode:
authorGravatar Michael E Rowan <38045958+mrowan137@users.noreply.github.com> 2020-04-02 16:58:45 -0700
committerGravatar GitHub <noreply@github.com> 2020-04-02 16:58:45 -0700
commit9381c4c6d12fb2800485a11123c3e3c968b51a6d (patch)
tree1c1211a7380aaa0f4f27805d07acf7d9996a0581 /Source/WarpX.H
parentb51c9ad1d610736cfbc89284f9bd6eddd5ebf7fc (diff)
downloadWarpX-9381c4c6d12fb2800485a11123c3e3c968b51a6d.tar.gz
WarpX-9381c4c6d12fb2800485a11123c3e3c968b51a6d.tar.zst
WarpX-9381c4c6d12fb2800485a11123c3e3c968b51a6d.zip
Load balance efficiency threshold (#887)
* Efficiency safeguard Add load balance efficiency threshold Formatting Minor EOL [skip ci] Minor [skip ci] Fix * EOL
Diffstat (limited to 'Source/WarpX.H')
-rw-r--r--Source/WarpX.H18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/WarpX.H b/Source/WarpX.H
index 3c66a6cd7..6d209b604 100644
--- a/Source/WarpX.H
+++ b/Source/WarpX.H
@@ -493,6 +493,18 @@ public:
*/
void ComputeCostsHeuristic (amrex::Vector<std::unique_ptr<amrex::Vector<amrex::Real> > >& costs);
+ /** \brief Computes the average cost per MPI rank given a distribution mapping
+ * and vector of cost for each FAB.
+ * @param[in] dm distribution mapping (mapping from FAB to MPI processes)
+ * @param[in] cost vector which gives mapping from FAB index space to the
+ * respective FAB's cost
+ * @param[out] efficiency average cost per MPI process computed from the
+ * given distribution mapping and and cost
+ */
+ void ComputeDistributionMappingEfficiency (const amrex::DistributionMapping& dm,
+ const amrex::Vector<amrex::Real>& cost,
+ amrex::Real& efficiency);
+
protected:
/**
@@ -708,6 +720,12 @@ private:
* `load_balance_knapsack_factor=2` limits the maximum number of boxes that can
* be assigned to a rank to 8. */
amrex::Real load_balance_knapsack_factor = 1.24;
+ /** Threshold value that controls whether to adopt the proposed distribution
+ * mapping during load balancing. The new distribution mapping is adopted
+ * if the ratio of proposed distribution mapping efficiency to current
+ * distribution mapping efficiency is larger than the threshold; 'efficiency'
+ * here means the average cost per MPI rank. */
+ amrex::Real load_balance_efficiency_ratio_threshold = 0;
/** Weight factor for cells in `Heuristic` costs update.
* Default values on GPU are determined from single-GPU tests on Summit.
* The problem setup for these tests is an empty (i.e. no particles) domain