MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: In V7, is it possible to parallelize DensityPlot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94346] Re: In V7, is it possible to parallelize DensityPlot?
  • From: Phil I <p.ingrey at gmail.com>
  • Date: Wed, 10 Dec 2008 05:12:08 -0500 (EST)
  • References: <gglsti$8gk$1@smc.vnet.net> <ggog30$s7s$1@smc.vnet.net>

On Nov 28, 10:10 am, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
wrote:
> Hi,

sincs version 6. Mathematica uses an adaptive mesh for the density plot
and there are *no* in the plot. Only triangles as to see from:

DensityPlot[Sin[x*y], {x, -Pi, Pi}, {y, -Pi, Pi}, Mesh -> All]

and since the mesh subdivision seems to be a global operation it
would be very hard to parallelize it.
> sincs version 6. Mathematica uses an adaptive mesh for the density plot
> and there are *no* in the plot. Only triangles as to see from:
>
> DensityPlot[Sin[x*y], {x, -Pi, Pi}, {y, -Pi, Pi}, Mesh -> All]
>
> and since the mesh subdivision seems to be a global operation it
> would be very hard toparallelizeit.
>
> The final rendering is done by the graphics card and since it is a IO
> operation it can't be parallel outside of the graphics card.
>
> Regards
>    Jens
>
> Stoney Ballard wrote:
> > It seems that DensityPlot is a natural candiate for parallelization,
> > but my experiments in Mathematica V7 all result in the warning "...
> > cannot be parallelized; proceeding with sequential evaluation". Is
> > this capability just not yet implemented, or is there a trick to get
> > multiple pixels to be evaluated in parallel?

Stoney,

Jens is right about the adaptive mesh. The only way around this is to
evaluate a list of values before hand (basically define your own mesh)
and this can be "parallelized" and then the result can be put in a
ListDensityPlot:
dplist = Parallelize[
   Table[{x, y, Sin[x] Cos[2 y]}, {x, 0, 2 \[Pi], \[Pi]/16}, {y, 0,
     2 \[Pi], \[Pi]/16}]];
ListDensityPlot[Flatten[dplist, 1]]

Hope this helps,
Phil


  • Prev by Date: Re: Plot vs NMaximize
  • Next by Date: Re: Small question about Filling between two functions in a
  • Previous by thread: Re: GraphicsGrid spacing
  • Next by thread: Re: In V7, is it possible to parallelize DensityPlot?