Skip to content

Commit

Permalink
fix sign error introduced by merge. Add proper if statements in driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Jun 28, 2023
1 parent 806b940 commit a99c557
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
28 changes: 16 additions & 12 deletions src/phoebus_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,18 +732,22 @@ TaskListStatus PhoebusDriver::RadiationPostStep() {
auto pmb = blocks[ib].get();
auto &tl = async_region[ib];
auto &sc0 = pmb->meshblock_data.Get(stage_name[integrator->nstages]);
auto calc_tau = tl.AddTask(none, radiation::LightBulbCalcTau, sc0.get());
auto check_do_gain_local = tl.AddTask(calc_tau, radiation::CheckDoGain, sc0.get(),
&(pdo_gain_reducer->val));
auto start_gain_reducer =
(ib == 0
? tl.AddTask(check_do_gain_local, &parthenon::AllReduce<bool>::StartReduce,
pdo_gain_reducer, MPI_LOR)
: none);
auto finish_gain_reducer = 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 finish_gain_reducer = none;
if (do_lightbulb) {
auto calc_tau = tl.AddTask(none, radiation::LightBulbCalcTau, sc0.get());
auto check_do_gain_local = tl.AddTask(calc_tau, radiation::CheckDoGain, sc0.get(),
&(pdo_gain_reducer->val));
auto start_gain_reducer =
(ib == 0 ? tl.AddTask(check_do_gain_local,
&parthenon::AllReduce<bool>::StartReduce,
pdo_gain_reducer, MPI_LOR)
: none);
finish_gain_reducer =
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,
Expand Down
2 changes: 1 addition & 1 deletion src/radiation/cooling_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ TaskStatus CoolingFunctionCalculateFourForce(MeshBlockData<Real> *rc, const doub
for (int mu = Gcov_lo; mu <= Gcov_lo + 3; mu++) {
Kokkos::atomic_add(&(v(mu, k, j, i)), -detG * Gcov_coord[mu - Gcov_lo]);
}
Kokkos::atomic_add(&(v(Gye, k, j, i)), LeptonSign(s) * detG * Jye);
Kokkos::atomic_add(&(v(Gye, k, j, i)), -LeptonSign(s) * detG * Jye);
});
}
}
Expand Down

0 comments on commit a99c557

Please sign in to comment.