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-arrays-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!