diff options
Diffstat (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp')
-rw-r--r-- | Source/Utils/WarpXAlgorithmSelection.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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<std::string, int> gathering_algo_to_int = { {"default", GatheringAlgo::EnergyConserving } }; +const std::map<std::string, int> 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 |