Skip to content

Commit

Permalink
Merge pull request #164 from ska-sa/fix-dirty-clear
Browse files Browse the repository at this point in the history
Call the clear method on the dirty dictionary
  • Loading branch information
sjperkins authored Aug 16, 2016
2 parents 487a077 + 1c772bf commit a32ee9c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions montblanc/impl/rime/v5/CompositeRimeSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def _enqueue_array_slice(self, r, subslvr,
# we can ignore it
cache_idx = dirty.get(r.name, None)

if cache_idx and cache_idx == cpu_idx:
if cache_idx is not None and cache_idx == cpu_idx:
#montblanc.log.debug("Cache hit on {n} index {i} "
# .format(n=r.name, i=cpu_idx))

Expand Down Expand Up @@ -865,7 +865,7 @@ def _thread_start_solving(self):

# Clear the dirty dictionary to force each array to be
# transferred at least once. e.g. the beam cube
[d.clear for d in self.thread_local.dirty]
[d.clear() for d in self.thread_local.dirty]

def _thread_enqueue_solve_batch(self, cpu_slice_map, gpu_slice_map, **kwargs):
"""
Expand Down Expand Up @@ -1088,10 +1088,8 @@ def _sync_wait(future):

# Perform any initialisation required by each
# thread prior to solving
futures = [ex.submit(self._thread_start_solving)
for ex in self.enqueue_executors]

for f in cf.as_completed(futures):
for f in cf.as_completed([ex.submit(self._thread_start_solving)
for ex in self.enqueue_executors]):
f.result()

# Create an iterator that cycles through each device's
Expand Down

0 comments on commit a32ee9c

Please sign in to comment.