Skip to content

Commit

Permalink
Use a worker size of 8 chunks.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlman committed Aug 24, 2020
1 parent 4a64e52 commit f61321f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion flyapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def map_points(dataset, scale, locs):
Output: [n,5] numpy array representing n (new_x, new_y, new_z, new_dx, new_dy)
"""
n5 = get_datasource(dataset, scale)
blocksize = np.asarray(n5.shape[:3]) * 2
voxel_offset = n5.attrs['voxel_offset']

query_points = np.empty_like(locs)
Expand All @@ -193,7 +194,8 @@ def map_points(dataset, scale, locs):
field = np.full((query_points.shape[0], 2), np.NaN)
else:
field = process.get_multiple_ids(query_points, n5,
max_workers=config.MaxWorkers)
max_workers=config.MaxWorkers,
blocksize=blocksize)

results = np.zeros(locs.shape[0], dtype=[('x', '<f4'), ('y', '<f4'), ('z', '<f4'), ('dx', '<f4'), ('dy', '<f4')])

Expand Down
5 changes: 1 addition & 4 deletions process.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _get_ids(vol, bl, co):
return co_id


def get_multiple_ids(x, vol, max_workers=mp.cpu_count() - 5):
def get_multiple_ids(x, vol, max_workers=mp.cpu_count() - 5, blocksize=np.array([512, 512, 32])):
"""Return multiple segment IDs using cloudvolume.
Parameters
Expand All @@ -62,9 +62,6 @@ def get_multiple_ids(x, vol, max_workers=mp.cpu_count() - 5):
if not max_workers:
max_workers = 1

# Hard coded block size
blocksize = np.array([512, 512, 32])

# Make bins to fit with blocksize
xbins = np.arange(0, np.nanmax(x) + blocksize[0] + 1, blocksize[0]).astype(int)
ybins = np.arange(0, np.nanmax(x) + blocksize[1] + 1, blocksize[1]).astype(int)
Expand Down

0 comments on commit f61321f

Please sign in to comment.