1. You (or someone) needs to write those methods. Since the Spline1D function
is defined in the Dierckx package, that's where the SharedArray version should
go, too (if you don't just maintain it on your own).
2. After
convert(SharedArray, xgrid)
xgrid will still be an ordinary array. You've not captured the output of the
convert function.
--Tim
On Friday, January 09, 2015 08:33:20 AM Nils Gudat wrote:
> Sorry for asking the umptiest question on parallelization, but I can't seem
> to get even the most basic calculations to run, so here's hoping someone
> can enlighten me.
> I'd like to make an interpolant created with Dierckx available on all my
> processors. I figured this would be possible using SharedArrays in the
> following way:
>
> addprocs(3)
>
> @everywhere using Dierckx
>
> xgrid = linspace(0.1, 100.0, 200)
>
> f_val = [xgrid[i]^(-0.25) for i in length(xgrid)]
>
> convert(SharedArray, xgrid)
> convert(SharedArray, f_val)
>
> @everywhere interpolant = Spline1D(xgrid, f_val)
>
>
> However, this attempt fails with two errors (or six, two for each core):
>
> Spline1D has not method matching Spline1D(::SharedArray{Float64, 1},
>
> ::SharedArray{Float64, 1})
>
> and
>
> xgrid_irr not defined
>
> I have a question on each:
> 1. How can I use SharedArrays in functions that don't have a method for
> them?
> 2. Why would xgrid not be defined on the other cores? My understanding from
> reading the SharedArray part
> <http://julia.readthedocs.org/en/latest/manual/parallel-computing/#shared-ar
> rays-experimental> of the documentation was that their whole purpose is to
> make an array available to all cores?
>
> Any hints or tips would be greatly appreciated!