Re: parallel table
- To: mathgroup at smc.vnet.net
- Subject: [mg107283] Re: parallel table
- From: Vince Virgilio <blueschi at gmail.com>
- Date: Mon, 8 Feb 2010 03:33:43 -0500 (EST)
- References: <hkm7br$oqi$1@smc.vnet.net>
On Feb 7, 6:15 am, Very Bad Mother... <shinytinkerb... at googlemail.com>
wrote:
> Hello,
> I would like to create a "film" from the numerical data that I got.
> Hence, I've created a table of plots and then by exporting to gif I
> can observe the dynamics. The problem is that I'd like to have many
> plots inside this table (many frames of my film, so to say) and it
> takes a hell of a time. This is why I thought about making this
> parallel (got 8 cores). I've used ParallelTable but there are some
> errors occuring:
>
> DensityGraphicsTable =
> ParallelTable[
> ListDensityPlot[ToExpression["Psit" <> ToString[j - 1]],
> FrameLabel -> {"m", "z"},
> LabelStyle -> {FontFamily -> "Helvetica", FontSize -> 12},
> PlotRange -> All, PlotLabel -> "t=" <> ToString[dt*(j - 1)]], {=
j,
> 1, tmax, tstep}];
>
> ListDensityPlot::arrayerr: Psit0 must be a valid array.
> ListDensityPlot::arrayerr: Psit250000 must be a valid array.
> ListDensityPlot::arrayerr: Psit500000 must be a valid array.
> ListDensityPlot::arrayerr: Psit750000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1000000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1250000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1500000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1750000 must be a valid array.
> ListDensityPlot::arrayerr: Psit50000 must be a valid array.
> ListDensityPlot::arrayerr: Psit300000 must be a valid array.
> ListDensityPlot::arrayerr: Psit550000 must be a valid array.
> ListDensityPlot::arrayerr: Psit800000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1050000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1300000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1550000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1800000 must be a valid array.
> ListDensityPlot::arrayerr: Psit100000 must be a valid array.
> ListDensityPlot::arrayerr: Psit350000 must be a valid array.
> ListDensityPlot::arrayerr: Psit600000 must be a valid array.
> ListDensityPlot::arrayerr: Psit850000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1100000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1350000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1600000 must be a valid array.
> ListDensityPlot::arrayerr: Psit1850000 must be a valid array.
>
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
> General::stop: Further output of ListDensityPlot::arrayerr will be
> suppressed during this calculation.
>
> So I don't know what to do, especially that when I use regular Table
> instead of ParallelTable, everything works (but it takes damn long
> time).
> Any help would be appreciated,
> --
> regards,
> tinkerbell
Your subkernels probably don't have the definitions for Psit... .
There are at least a couple of ways to solve this: (1) give them with
DistributeDefinitions, or (2) put the Psit values in the ParallelTable
iterator.
(1) DistributeDefinitions[Psit...]. Or perhaps simpler: create a set
of DownValues on symbol Psit . . . Psit[0] instead of a set of symbols
with root Psit. Then DistributeDefinitions with single argument Psit.
(2) ParallelTable[ListDensityPlot[array, ...], {array,
ToExpression["Psit" <> ToString@#]& /@ Range[0, tmax - 1, tstep]}]
I did not test either option.
Vince Virgilio