Commit 39440e74 authored by theos's avatar theos

Fixed searchsorted.

parent 7a8916e0
...@@ -1718,16 +1718,16 @@ class _slicing_distributor(distributor): ...@@ -1718,16 +1718,16 @@ class _slicing_distributor(distributor):
local_searched = np.searchsorted(a=a, v=v, side=side) local_searched = np.searchsorted(a=a, v=v, side=side)
global_searched = np.empty_like(local_searched) global_searched = np.empty_like(local_searched)
if side is 'left': # if side is 'left':
op = MPI.MAX # op = MPI.MAX
elif side is 'right': # elif side is 'right':
op = MPI.MIN # op = MPI.MIN
else: # else:
raise ValueError # raise ValueError
self.comm.Allreduce([local_searched, MPI.INT], self.comm.Allreduce([local_searched, MPI.INT],
[global_searched, MPI.INT], [global_searched, MPI.INT],
op=op) op=MPI.SUM)
if global_searched.shape == (): if global_searched.shape == ():
global_searched = global_searched[()] global_searched = global_searched[()]
return global_searched return global_searched
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment