Skip to content

Commit

Permalink
Merge pull request #670 from OP2/fix-mixed-dat-object-versioning
Browse files Browse the repository at this point in the history
Fix Vec's state counter for MixedDat
  • Loading branch information
dham authored Jul 27, 2022
2 parents 784b217 + cb3ae29 commit 7036b5d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pyop2/types/dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,12 +1015,13 @@ def vec_context(self, access):
# values
if access is not Access.WRITE:
offset = 0
array = self._vec.array
for d in self:
with d.vec_ro as v:
size = v.local_size
array[offset:offset+size] = v.array_r[:]
offset += size
with self._vec as array:
for d in self:
with d.vec_ro as v:
size = v.local_size
array[offset:offset+size] = v.array_r[:]
offset += size

yield self._vec
if access is not Access.READ:
# Reverse scatter to get the values back to their original locations
Expand Down

0 comments on commit 7036b5d

Please sign in to comment.