From c8b1d2175fce8eb8c98933fb5729840e7f8e8f45 Mon Sep 17 00:00:00 2001 From: Michael E Rowan <38045958+mrowan137@users.noreply.github.com> Date: Mon, 2 Mar 2020 09:26:45 -0800 Subject: Heuristic load balance based on number of particles and number of cells (#737) * Issue #713: Load Balance w.r.t. number of cells + particles README: Update Badged to `master` (#725) * README: Update Badged to `master` Update the badges to check the `master` branch as development branch. * Docs: More dev->master updates - release workflow - contribution guide link Galilean PSATD with shift (#704) * Read Galilean velocity * Prepare structures for Galilean solver * Started implementing Galilean equations * Analytical limits for X1, X2, X3, X4 coefficients added * Slight changes added * Added Galilean position pusher * Scale galilean velocity * Remove unneeded Abort * Fix Galilean pusher * Allocate Theta2 array * Fix definition of coefficients * Increase guard cells for Galilean * Add guard cell in particle exchange * Type corrected * v_gal added to warpx_current_deposition * v_gal added to WarpXParticleContainer.H * Bug fixed - update particle x-position over one time step * Fix issues with merge from dev * Preparation for merging dev into galilean. * Adding galilean shift * Implemented galilean shift * Changed method's name from GalileanShift to ShiftGalileanBoundary * Added doxygen string for ShiftGalileanBoundary * Removed never used method LowerCornerWithCentering * Removed temporary comments * Removed dt as a variable from DepositCharge method and its dependencies * Converted tab to spaces * Removed EOL white space * Add documentation and automated tests * Fix compilation error * Add automated test * Update automated test * Removed temporary used galilean shift * Removed temporary used particle's push for Galilean PSATD * Removed unused statement * Remove EOL white space. * Added zero shift for LowerCorner in RZ geometry * Minor changes to Galilean implementation * Modifications for GPU * Fix typo Co-authored-by: Remi Lehe [mini-PR] when a cufft error occurs, print a meaningful error message (#728) * added method to translate cufft errors * fixed style * bug fixing avoid duplicate tests and plot less often (#726) * avoid duplicate tests and plot less often * fix tests I broke when trying to save plotfiles doc install yt on Summit (#729) * doc install yt on Summit * eol Do not use local Redistribute for electrostatic solver (#731) Add Reset Random Seed Feature (#717) * Add ResetRandomSeed * Add doc * Modify and change location of the code. * Small fix * Try to fix an alert * Try to fix an alert * Modify based on suggestions * Use INT_MAX * Modify based on suggestions. * Modify based on suggestions. openPMD: warn if step is already written (#718) * making sure iterations are written at most once. * prints a warning when iteration is written more than once writting is not stopped * Fixed tabs * included as requested by Axel Minor refactoring of space-charge calculation (#732) Improve clarity and documentation Minor Update GNUmakefile Update based on comments Update GNU Makefile Formatting Formatting Formatting Formatting Remove unneeded function Removed unneeded function Formatting Formatting Formatting Whitespace Minor Formatting Formatting Formatting Formatting Formatting Formatting Formatting whitespace Formatting Minor Formatting Remove unneeded template function Change import Minor Formatting Remove unused variable Formatting Update Source/WarpX.H Co-Authored-By: MaxThevenet Update Source/Parallelization/WarpXRegrid.cpp Co-Authored-By: MaxThevenet Remove `n_particles` and `n_cells` Update Source/WarpX.H Co-Authored-By: MaxThevenet Revert clear costs in case of edge case Update to use new load_balance_api in AMReX Tabs Minor * minor: indentation in Source/WarpX.H Co-authored-by: MaxThevenet --- Source/Utils/WarpXAlgorithmSelection.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp') diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp index 54eff8d01..066353222 100644 --- a/Source/Utils/WarpXAlgorithmSelection.cpp +++ b/Source/Utils/WarpXAlgorithmSelection.cpp @@ -52,6 +52,12 @@ const std::map gathering_algo_to_int = { {"default", GatheringAlgo::EnergyConserving } }; +const std::map load_balance_costs_update_algo_to_int = { + {"timers", LoadBalanceCostsUpdateAlgo::Timers }, + {"heuristic", LoadBalanceCostsUpdateAlgo::Heuristic }, + {"default", LoadBalanceCostsUpdateAlgo::Timers } +}; + int GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){ @@ -74,13 +80,15 @@ GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key ){ algo_to_int = charge_deposition_algo_to_int; } else if (0 == std::strcmp(pp_search_key, "field_gathering")) { algo_to_int = gathering_algo_to_int; + } else if (0 == std::strcmp(pp_search_key, "load_balance_costs_update")) { + algo_to_int = load_balance_costs_update_algo_to_int; } else { std::string pp_search_string = pp_search_key; amrex::Abort("Unknown algorithm type: " + pp_search_string); } // Check if the user-input is a valid key for the dictionary - if (algo_to_int.count(algo) == 0){ + if (algo_to_int.count(algo) == 0) { // Not a valid key ; print error message std::string pp_search_string = pp_search_key; std::string error_message = "Invalid string for algo." + pp_search_string -- cgit v1.2.3