Hi all,
I'm using Julia 0.4.2 and I was playing around with pmap and the
DataStructures package when I found something weird: the same function call
when done through remotecall or pmap gives different results.
Here's a code example:
@everywhere using DataStructures
@everywhere global const thresholds = collect(0:25)
push!(thresholds, typemax(eltype(thresholds))) #last element is
9223372036854775807
@everywhere global const sortedThresholds = SortedSet(thresholds)
global const warmup = round(Int64, rand(100) .* 26)
@everywhere function findAndReturn2(x::Int64)
return deref((sortedThresholds, searchsortedfirst(sortedThresholds, x)))
end
ref = remotecall(findAndReturn2, 1, 26)
fetch(ref) #returns 9223372036854775807
pmap(findAndReturn2, [26]) #returns
[RemoteException(2,CapturedException(BoundsError(#undef,#undef),Any[(:findAndReturn2,:none,2,symbol(""),-1,1),(:anonymous,symbol("multi.jl"),907,symbol(""),-1,1),(:run_work_thunk,symbol("multi.jl"),645,symbol(""),-1,1),(:anonymous,symbol("multi.jl"),907,symbol("task.jl"),63,1)]))]
I would expect both calls to return the same thing (albeit wrapped in an
Array in the case of pmap and not in the case of remotecall)
Cheers,
Louis