Skip to content

Commit

Permalink
Update radfield.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 9, 2024
1 parent 471b214 commit 83605b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radfield.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ void reduce_estimators()

for (ptrdiff_t nonemptymgi = 0; nonemptymgi < nonempty_npts_model; nonemptymgi++) {
for (int binindex = 0; binindex < RADFIELDBINCOUNT; binindex++) {
const auto mgibinindex = nonemptymgi * RADFIELDBINCOUNT + binindex;
const auto mgibinindex = (nonemptymgi * RADFIELDBINCOUNT) + binindex;
MPI_Allreduce(MPI_IN_PLACE, &radfieldbins[mgibinindex].J_raw, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
MPI_Allreduce(MPI_IN_PLACE, &radfieldbins[mgibinindex].nuJ_raw, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
MPI_Allreduce(MPI_IN_PLACE, &radfieldbins[mgibinindex].contribcount, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
Expand Down Expand Up @@ -1194,7 +1194,7 @@ void do_MPI_Bcast(const int modelgridindex, const int root, const int root_node_

if constexpr (MULTIBIN_RADFIELD_MODEL_ON) {
for (int binindex = 0; binindex < RADFIELDBINCOUNT; binindex++) {
const auto mgibinindex = nonemptymgi * RADFIELDBINCOUNT + binindex;
const auto mgibinindex = (nonemptymgi * RADFIELDBINCOUNT) + binindex;
if (globals::rank_in_node == 0) {
MPI_Bcast(&radfieldbin_solutions[mgibinindex].W, 1, MPI_FLOAT, root_node_id, globals::mpi_comm_internode);
MPI_Bcast(&radfieldbin_solutions[mgibinindex].T_R, 1, MPI_FLOAT, root_node_id, globals::mpi_comm_internode);
Expand Down

0 comments on commit 83605b1

Please sign in to comment.