From: Very Bad Mother... on 7 Feb 2010 06:15 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
From: Vince Virgilio on 8 Feb 2010 03:33 On Feb 7, 6:15 am, Very Bad Mother... <shinytinkerb...(a)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
From: David Reiss on 8 Feb 2010 03:35 In all likelihood this is because none of the parallel kernels know about the arrays that you are attempting to plot with them. You will beed to use DistributeDefinitions to inform them about them. --David http://scientificarts.com/worklife On Feb 7, 6:15 am, Very Bad Mother... <shinytinkerb...(a)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
From: Norbert P. on 8 Feb 2010 03:36 Hi tinkerbell, I was trying the exact same thing a week ago. So I assume that symbols Psit### store the solution data. The problem with your code is that the parallel kernels don't have those symbols automatically. You have to use DistributeDefinitions. First I'd recommend storing the solution data in the form Psit[t] instead of Psit###, it is much easier to work with. Then you can just call DistributeDefinitions[Psit] before your ParallelTable and it should work. One thing to look out for, if the data is massive, you might not want to send all of it to 8 parallel kernels. ParallelMap or ParallelSubmit might help. Also, the actual rendering probably takes a lot of time too, at least in my case. But based on my experience, the rendering and exporting can be done only on the main kernel, that's the one who's doing all the work when you use ParallelSubmit[Export[file,plot]]. Best, Norbert On Feb 7, 3:15 am, Very Bad Mother... <shinytinkerb...(a)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
From: Very Bad Mother... on 8 Feb 2010 07:57
Hi, thank you to all of you. Your suggestions were very helpful and I solved my problem. Kind regards, -- tinkerbell |