Skip to content

Commit

Permalink
Merge pull request #757 from mattrjackson/master
Browse files Browse the repository at this point in the history
Avoid excess allocations in buildUpdateMap
  • Loading branch information
mkstoyanov authored Mar 20, 2024
2 parents 73cfbbb + 8d19d5b commit ef62603
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SparseGrids/tsgGridLocalPolynomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1266,14 +1266,14 @@ Data2D<int> GridLocalPolynomial::buildUpdateMap(double tolerance, TypeRefinement
int max_1D_parents = rule->getMaxNumParents();

HierarchyManipulations::SplitDirections split(points);

#pragma omp parallel for
std::vector<int> global_to_pnts(num_points);
#pragma omp parallel for firstprivate(global_to_pnts)
for(int j=0; j<split.getNumJobs(); j++){ // split.getNumJobs() gives the number of 1D interpolants to construct
int d = split.getJobDirection(j);
int nump = split.getJobNumPoints(j);
const int *pnts = split.getJobPoints(j);

std::vector<int> global_to_pnts(num_points);

std::vector<int> levels(nump);

int max_level = 0;
Expand Down

0 comments on commit ef62603

Please sign in to comment.