[yt-users] Using AMR with inline Python

Matthew Turk matthewturk at gmail.com
Tue Jul 5 15:08:12 PDT 2016


Hi Azton,

This code isn't guaranteed to work the way you expect on all
processors.  For starters, the return value of grid_data.keys() will
be unsorted -- so it may not start with the zeroth order.
Additionally, if you're running in parallel, you'll only have access
to a subset of the grids on each processor, so you'll get different
answers on each processor for this command.  You can try looking for
the most refined grid on each processor running the script by either
looping through the grid keys and checking each for the level, or you
can write using an operation like .find_max() or a derived quantity as
those are parallel-aware.

-Matt

On Tue, Jul 5, 2016 at 5:04 PM, Azton Wells <azton.wells at gmail.com> wrote:
> Hi all,
>
> I am trying to use inline python during an AMR cosmology simulation. During
> the simulation, I access the grid using:
>
>
> rho = na.asarray(enzo.grid_data[enzo.grid_data.keys()[0]]["Density"])
>
>
> Which is what I used during a static hierarchy simulation without problems.
> Will the above code access the top grid during AMR, or will it be accessing
> the most-refined grid level?
>
>
> Thanks very much,
>
> Azton
>
>
>
> _______________________________________________
> 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