You're creating a collection from 0 to 25.

Then you're calling searchsortedfirst on it. Reading the docs explains what 
will happen:

  searchsortedfirst(a, x, [by=<transform>,] [lt=<comparison>,] [rev=false])


  Returns the index of the first value in a greater than or equal to x, 
according to the specified order. Returns length(a)+1 if x is greater than 
all values in a.

Well, there is nothing greater than or equal to 26 in there, so it gives 
you length + 1. Then, you're dereferencing that index which gives you a 
bounds error.

On Monday, 21 December 2015 13:56:48 UTC-4, [email protected] wrote:
>
> First of all thanks for the answer.
>
> And it did work when not adding any workers, so I guess I should updated 
> my code example.
>
> I had called 
> addprocs(1)
>
> before the whole thing.
>
> So I guess now I'm more confused, my *pmap* call works when *nprocs() == 
> 1* but not after adding workers...
> And it's also surprising that I only get that *BoundsError* when my array 
> contains something *>= 26 *(which means *findAndReturn2 *should 
> return the last value of my SortedSet)*.*
>
> eg:
> pmap(findAndReturn2, [1,1,1]) #returns [1,1,1]
> pmap(findAndReturn2, [1,1,26]) #returns [1,1,RemoteException]
>
> Any idea what I could be doing wrong?
>
> Cheers,
> Louis
>

Reply via email to