Why doesn't this do what I think it should:
benjamin@benjamin-VirtualBox:~$ julia -p 3
julia> @everywhere(function foom(bar::Vector{Any}, k::Integer) println(repeat(bar[2],bar[1])); return bar; end)
julia> foo={{1,"a"},{2,"b"},{3,"c"}}
julia> pmap(foom, foo, 5)
From worker 2: a
1-element Array{Any,1}:
{1,"a"}
and that is all it outputs. I was expecting pmap to iterate through each tuple in foo and call foom on it.
EDIT:
It works correctly when I don't pass other arguments in:
julia> @everywhere(function foom(bar::Vector{Any}) println(repeat(bar[2],bar[1])); return bar; end)
julia> pmap(foom, foo)
From worker 3: bb
From worker 2: a
From worker 4: ccc
3-element Array{Any,1}:
{1,"a"}
{2,"b"}
{3,"c"}
How can I pass in more arguments to pmap?
The function pmap does take any number of arguments each one a collection
The function f will be sent an argument for each collection
Example Multi-argument Function
pmap use 1
pmap use 2
Alternately, arguments can be sent as collection of arguments from one outer collection which can be spatted into multiple arguments for the target function