Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
nbouziani committed Jul 26, 2022
1 parent e09cd25 commit cb3ae29
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pyop2/types/dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1015,13 +1015,12 @@ 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
del array
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:
Expand Down

0 comments on commit cb3ae29

Please sign in to comment.