Skip to content

Commit

Permalink
Remove WarpX:roundrobin_sfc
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Aug 14, 2024
1 parent db66ea7 commit 4babfd5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 0 additions & 10 deletions Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -1242,16 +1242,6 @@ protected:
//! This function is called in amrex::AmrCore::InitFromScratch.
void PostProcessBaseGrids (amrex::BoxArray& ba0) const final;

//! If this is true, AMReX's RRSFC strategy is used to make
//! DistributionMapping in the virtual function MakeDistributionMap. The
//! default is false. Note that the DistributionMapping made by the
//! MakeDistributionMap function could still be overridden by load
//! balancing. In the RRSFC strategy, the Round robin method is used to
//! distribute Boxes orderd by the space filling curve. This might help
//! avoid some processes running out of memory due to having too many
//! particles during initialization.
static bool roundrobin_sfc;

//! Use this function to override how DistributionMapping is made.
[[nodiscard]] amrex::DistributionMapping
MakeDistributionMap (int lev, amrex::BoxArray const& ba) final;
Expand Down
14 changes: 12 additions & 2 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,6 @@ WarpX::ReadParameters ()
maxLevel() == 0 || !do_current_centering,
"Finite-order centering of currents is not implemented with mesh refinement"
);

pp_warpx.query("roundrobin_sfc", roundrobin_sfc);
}

{
Expand Down Expand Up @@ -3584,6 +3582,18 @@ WarpX::getField(FieldType field_type, const int lev, const int direction) const
amrex::DistributionMapping
WarpX::MakeDistributionMap (int lev, amrex::BoxArray const& ba)
{
bool roundrobin_sfc = false;
ParmParse pp("warpx");
pp.query("roundrobin_sfc", roundrobin_sfc);

// If this is true, AMReX's RRSFC strategy is used to make
// DistributionMapping. Note that the DistributionMapping made by the
// here could still be overridden by load balancing. In the RRSFC
// strategy, the Round robin method is used to distribute Boxes orderd
// by the space filling curve. This might help avoid some processes
// running out of memory due to having too many particles during
// initialization.

if (roundrobin_sfc) {
auto old_strategy = amrex::DistributionMapping::strategy();
amrex::DistributionMapping::strategy(amrex::DistributionMapping::RRSFC);
Expand Down

0 comments on commit 4babfd5

Please sign in to comment.