Hi all,
I am wrangling with the following problem.
I have a function, call it f, that I want to apply on each element of a vector, and that takes many References(DataFrame, matrices, scalars).
In order to do it without parallelization, map() did not work because it just applies the function to the first element of the vector. Instead, broadcast manages to apply it to all elements of the vector markets.
profit_test = map(retailer_var_profit_loop, markets, Ref(dt2), Ref(nu_alpha), Ref(nu_p), Ref(nu_xj), Ref(nu_xm), Ref(nu_xr),Ref(marketsize),Ref(xi_no_draws))
profit_test = broadcast(retailer_var_profit_loop, markets, Ref(dt2), Ref(nu_alpha), Ref(nu_p), Ref(nu_xj), Ref(nu_xm), Ref(nu_xr),Ref(marketsize),Ref(xi_no_draws))
Then, I wanted to use pmap in order to speed up this calculation. However, since I cannot get map to run, is there an equivalent way to do this with broadcast?
I am trying to use pmap as I have read that it is faster than using @distributed for loops whenever the operation on a single element is time-consuming, which it is in my case.
Thanks!