From 0b13b20360f49ce41213a01a2afbb38403934bb1 Mon Sep 17 00:00:00 2001 From: jdolence Date: Fri, 3 Nov 2023 12:00:21 -0600 Subject: [PATCH] try to fix some things --- src/mesh/amr_loadbalance.cpp | 2 +- src/mesh/mesh.cpp | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/mesh/amr_loadbalance.cpp b/src/mesh/amr_loadbalance.cpp index c02f95babb8d..49219de78bab 100644 --- a/src/mesh/amr_loadbalance.cpp +++ b/src/mesh/amr_loadbalance.cpp @@ -486,7 +486,7 @@ void Mesh::ResetLoadBalanceVariables() { // make a local copy to make CUDA happy auto bcost = block_cost; parthenon::par_for( - loop_pattern_flatrange_tag, "reset cost_d", DevExecSpace(), 0, + loop_pattern_flatrange_tag, PARTHENON_AUTO_LABEL, DevExecSpace(), 0, block_list.size() - 1, KOKKOS_LAMBDA(const int b) { bcost(b) = TINY_NUMBER; }); for (int b = 0; b < block_list.size(); b++) block_cost_host[b] = TINY_NUMBER; diff --git a/src/mesh/mesh.cpp b/src/mesh/mesh.cpp index 9aa60df70f86..821c972b19de 100644 --- a/src/mesh/mesh.cpp +++ b/src/mesh/mesh.cpp @@ -1143,13 +1143,7 @@ void Mesh::Initialize(bool init_problem, ParameterInput *pin, ApplicationInput * // caching nbtotal the private variable my be updated in the following function const int nb_before_loadbalance = nbtotal; // don't trust costs during problem initialization - for (int i = 0; i < nmb; ++i) - block_cost_host[i] = 1.0; -#ifdef ENABLE_LB_TIMERS - parthenon::par_for( - loop_pattern_flatrange_tag, PARTHENON_AUTO_LABEL, DevExecSpace(), 0, nmb - 1, - KOKKOS_LAMBDA(const int b) { block_cost(b) = 1.0; }); -#endif + ResetLoadBalanceVariables(); LoadBalancingAndAdaptiveMeshRefinement(pin, app_in); if (nbtotal == nb_before_loadbalance) { init_done = true;