Skip to content

Commit

Permalink
creating new sync region for lightbulb functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mari2895 committed Jan 4, 2024
1 parent 882565a commit 8290819
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/phoebus_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,13 @@ TaskListStatus PhoebusDriver::RadiationPostStep() {
if (do_lightbulb) {
pdo_gain_reducer = rad->MutableParam<parthenon::AllReduce<bool>>("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());
Expand All @@ -717,9 +719,9 @@ TaskListStatus PhoebusDriver::RadiationPostStep() {
tl.AddTask(start_gain_reducer, &parthenon::AllReduce<bool>::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);
Expand Down

0 comments on commit 8290819

Please sign in to comment.