creating Graphics using ParallelTable[]
- To: mathgroup at smc.vnet.net
- Subject: [mg99847] creating Graphics using ParallelTable[]
- From: Jan-Philip Gehrcke <jgehrcke at googlemail.com>
- Date: Sat, 16 May 2009 05:19:57 -0400 (EDT)
Hello all, I generate "video frames" from time-consuming 3DPlot[]s (to export them into a video file later on): frame[x_] := Plot3D[... something big using x ...]; movieframes = Table[frame[x], {x, start, end, (end-start)/steps}]; I have a double core CPU; so now I would like to create these frames in parallel with Mathematica 7, using ParallelTable[]. But I don't derive any advantage from doing this: My Windows taskmanager shows three "MathKernel.exe". When I use ParallelTable[] for the described problem, only one "MathKernel.exe" is working, causing 50% CPU load and using much RAM. The other two "MathKernel.exe"s don't cause any load and almost don't use any RAM. $ProcessorCount is 2, there is 1 "master" and 2 "local" in "Parallel Kernel Status". The "parallelizeabletest" ParallelTable[$KernelID, {10}] succeeds. I tried `DistributeDefinitions[frame];` before invoking ParallelTable [], but it did not change anything. One core needs about 20 seconds to create one single frame without displaying it: An extensive analytical function (among others there are nested Coth[]s) has to be calculated with Plotpoints->100 option. In my opinion - simply expressed - each core can take one `x` out of the queue and create the corresponding 3DPlot Graphics object, while the other core is doing the same. This should work, because the tasks are totally independent and my way to use the Table[] is the least complex one. I don't see the "data management overhead" that often reduces or even prevents advantages from parallelizing, because each core just needs to get the function definitions and a simple number: `x` - no more overhead. (At which point) do I think wrong or does Mathematica work weird (less likely..)? Is there a way for me to create these frames using all my CPU power? Sincereley, Jan-Philip Gehrcke