[yt-users] Particle Callback Error in Parallel Projections

Matthew Turk matthewturk at gmail.com
Tue Apr 7 10:27:27 PDT 2009


Hi Devin,

I spoke briefly with Britton Smith off-list, so I will summarize here
what he brought up, as he has done some thinking about this.

He pointed out that the particle callback uses the base data source
for the projections -- so what's going on here is that the domain
decomposition for parallel gives each processor's projection a
different set of source grids.  Now, the ultimate reduced image plane
for each processor is identical; however, the base grids from which
that image plane is constructed are different.  However, as it
currently stands, the particle callback actually takes *all* the
particles from the source grids and then concatenates them.

So there are a couple steps here that probably need to be handled.
The first is that the particle callback needs to be rewritten in two
stages.  The first stage is to rewrite it such that it constructs a
rectangular prism of the specified width centered at the center of the
image, and then displays the particles within that rectangular prism.
This could be accomplished by generating an AMRPeriodicRegion and then
plotting all of the particles found within it.  This would probably
end up being a bit faster.  I believe this would fix the issue you're
seeing.

The second stage of rewriting the ParticleCallback would be to
construct the extracted region via an InlineExtractedRegion; this
would run all the particles through any number of field cuts.  This
would enable us to project (not in parallel) extracted regions and
only get the particles within our thickness from the extracted region.
 (This use case is not as uncommon as I originally thought.)

I will talk with Britton and see if we can whip up stage one this
afternoon or evening, as it should be largely/completely non-invasive.
 Stage two will have to wait until yt-1.5 is released (we're aiming
for May 15 on that.)  If you wouldn't mind, could you fill out a bug
on this problem on the tracker?

http://yt.enzotools.org/newticket/

Thanks!

-Matt

On Tue, Apr 7, 2009 at 9:28 AM, Devin Silvia <devin.silvia at gmail.com> wrote:
> Hi,
>
> I am currently running into an issue when I try to carry out parallel
> projections with particle overlay.  Also long as I don't use too many
> processors things run just fine but the projections only have some of
> the particles.
>
> Here is an example of the commands in my script:
>
> plotx = pc.add_projection("Density", 0, weight_field="Dust")
> plotx.add_callback(ParticleCallback(0, 1.0, p_size=1.0, col='k'))
> ploty = pc.add_projection("Density", 1, weight_field="Dust")
> ploty.add_callback(ParticleCallback(1, 1.0, p_size=1.0, col='k'))
> plotz = pc.add_projection("Density", 2, weight_field="Dust")
> plotz.add_callback(ParticleCallback(2, 1.0, p_size=1.0, col='k'))
>
> In addition, if I use too many processors and the one of the
> processors doesn't have any particles, I get the following error:
>
> Particle bounding box: 0.0 1.0 0.0 1.0 1.5 2.5
> Traceback (most recent call last):
> Particle px extrema
>  File "longbox.py", line 13, in <module>
>    pc.save("DD%4.4d/DD%4.4d" % (i,i))
>  File "/home/solo/student/brittons/local/x86_64/lib/python2.5/site-packages/yt/raven/PlotCollection.py",
> line 80, in save
>    override=override))
>  File "/home/solo/student/brittons/local/x86_64/lib/python2.5/site-packages/yt/raven/PlotTypes.py",
> line 110, in save_image
>    self._redraw_image()
>  File "/home/solo/student/brittons/local/x86_64/lib/python2.5/site-packages/yt/raven/PlotTypes.py",
> line 312, in _redraw_image
>    self._run_callbacks()
>  File "/home/solo/student/brittons/local/x86_64/lib/python2.5/site-packages/yt/raven/PlotTypes.py",
> line 183, in _run_callbacks
>    cb(self)
>  File "/home/solo/student/brittons/local/x86_64/lib/python2.5/site-packages/yt/raven/Callbacks.py",
> line 177, in __call__
>    print "Particle px extrema", particles_x.min(), particles_x.max(), \
> ValueError: zero-size array to ufunc.reduce without identity
>
> Any help with this would be appreciated.
>
> Thanks,
> Devin
>
> --
> Devin W. Silvia
> Graduate Student/Research Assistant
> Center for Astrophysics and Space Astronomy
> University of Colorado at Boulder
> http://mdbworks.net/devin
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list