Hello all - 

I'd like to apply pmap to a function F I've written, which takes several 
arguments, only one of which will be varying across pmap.

For example:

function F(a, b, c)
    # a silly example
    a + b + c 
end

I'd like to pmap F over a1, a2, and a3, while keeping b and c the same for 
the three iterations.  

(I tried this stackexchange 
answer: http://stackoverflow.com/questions/24637064/julia-using-pmap-correctly 
  and did not have any luck - { } are deprecated as containers (I think) 
and the a_i's may be of different sizes so [a1 a2 a3] might not be a 
reasonable object to try to form.  I tried both ideas in that answer: 
writing the arguments as [a1 b c] [a2 b c]... etc or [a1 a2 a3] [b b b] ... 
etc.  Neither one worked.)

I have also tried defining

function Fprime(a; b0 = b, c0 = c)
   F(a, b0, c0) # treating b and c above as fixed
end 

And then doing pmap( Fprime, [a1 a2 a3]), but 

(i) this does not solve my problem when the a_i's are different sizes and 
can't be put into one array 

(ii) it gave me an error even when I tried it on the easy case [a1 a1], 
where I think pmap should just (eventually) call F(a1, b, c) on two 
workers.  The error I got was a CapturedException MethodError, even though 
Fprime( a1) works just fine.

If you can point me to what I am doing wrong, I would be very grateful.

Thanks!

ABB

Reply via email to