diff --git a/src/phoebus_driver.cpp b/src/phoebus_driver.cpp index 38ceb8f3d..46c7e7dd7 100644 --- a/src/phoebus_driver.cpp +++ b/src/phoebus_driver.cpp @@ -698,11 +698,13 @@ TaskListStatus PhoebusDriver::RadiationPostStep() { if (do_lightbulb) { pdo_gain_reducer = rad->MutableParam>("do_gain_reducer"); } - TaskRegion &async_region = tc.AddRegion(num_independent_task_lists); - for (int ib = 0; ib < num_independent_task_lists; ib++) { - auto pmb = blocks[ib].get(); - auto &tl = async_region[ib]; - auto &sc0 = pmb->meshblock_data.Get(stage_name[integrator->nstages]); + //creating a new sync region for light bulb functions + TaskRegion &sync_region_lb = tc.AddRegion(num_partitions); + for (int ib = 0; ib < mun_partiotions; ++ib){ + auto &base = pmesh->mesh_data.GetOrAdd("base", ib); + auto &sc0 = pmesh->mesh_data.GetOrAdd(stage_name[stage-1], ib); + auto &sc1 = pmesh->mesh_data.GetOrAdd(stage_name[stage], ib); + auto &tl = sync_region_lb[ib]; auto finish_gain_reducer = none; if (do_lightbulb) { auto calc_tau = tl.AddTask(none, radiation::LightBulbCalcTau, sc0.get()); @@ -717,9 +719,9 @@ TaskListStatus PhoebusDriver::RadiationPostStep() { tl.AddTask(start_gain_reducer, &parthenon::AllReduce::CheckReduce, pdo_gain_reducer); int reg_dep_id = 0; - async_region.AddRegionalDependencies(reg_dep_id++, ib, finish_gain_reducer); - } - + + } + auto calculate_four_force = tl.AddTask(finish_gain_reducer, radiation::CoolingFunctionCalculateFourForce, sc0.get(), dt);