Skip to content

Commit 30c3ea5

Browse files
committed
Addressed race condition.
1 parent 642f58c commit 30c3ea5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/atlas/grid/detail/partitioner/MatchingMeshPartitionerCubedSphere.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ void MatchingMeshPartitionerCubedSphere::partition(const Grid& grid, int partiti
3333
// Loop over grid and set partioning[].
3434
auto lonlatIt = grid.lonlat().begin();
3535
atlas_omp_parallel_for(gidx_t i = 0; i < grid.size(); ++i) {
36+
const auto& lonLat = *(lonlatIt + i);
3637
// This is probably more expensive than it needs to be, as it performs
3738
// a dry run of the cubedsphere interpolation method.
38-
const auto& lonlat = *lonlatIt;
39-
partitioning[i] = finder.getCell(lonlat, listSize, edgeEpsilon, epsilon).isect ? mpi_rank : -1;
40-
++lonlatIt;
39+
partitioning[i] = finder.getCell(lonLat, listSize, edgeEpsilon, epsilon).isect ? mpi_rank : -1;
4140
}
4241

4342
// AllReduce to get full partitioning array.

0 commit comments

Comments
 (0)