Skip to content

Commit

Permalink
Update update_grid.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Nov 20, 2024
1 parent a60ebc4 commit 8f56b40
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions update_grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <ranges>
#include <vector>

#include "artisoptions.h"
Expand Down Expand Up @@ -1119,10 +1119,8 @@ void update_grid(FILE *estimators_file, const int nts, const int nts_prev, const
heatingcoolingrates_thisrankcells.at(nonemptymgi - nstart_nonempty));
} // end parallel for loop over all modelgrid cells
#else
auto todo_nonemptymgi = std::vector<int>(ndo_nonempty);
std::iota(todo_nonemptymgi.begin(), todo_nonemptymgi.end(), nstart_nonempty);

std::for_each(todo_nonemptymgi.begin(), todo_nonemptymgi.end(), [&](const int nonemptymgi) {
auto todo_nonemptymgi = std::ranges::iota_view{nstart_nonempty, nstart_nonempty + ndo_nonempty};
std::for_each(EXEC_PAR todo_nonemptymgi.begin(), todo_nonemptymgi.end(), [&](const int nonemptymgi) {
update_grid_cell(nonemptymgi, nts, nts_prev, titer, tratmid, deltat,
heatingcoolingrates_thisrankcells.at(nonemptymgi - nstart_nonempty));
});
Expand Down

0 comments on commit 8f56b40

Please sign in to comment.