[yt-users] inline yt in parallel

Sam Skillman samskillman at gmail.com
Tue Apr 2 20:02:06 PDT 2013


Hi Christine,

The only thing I notice is that there don't seem to be P??? processor
number prefixes to your yt output.  Mine looks like (using yt and enzo-dev
tips on RotatingCylinder) :
P001 yt : [DEBUG    ] 2013-04-02 20:57:27,208 Received buffer of min 0.0
and max 3.34041847571e-21 (data: 1.66943640208e-23 3.34041847571e-21)
P000 yt : [DEBUG    ] 2013-04-02 20:57:27,209 Received buffer of min 0.0
and max 3.34041847571e-21 (data: 1.66943640208e-23 3.34041847571e-21)
P001 yt : [INFO     ] 2013-04-02 20:57:27,306 Added slice of Density at y =
0.5546875 with 'center' = [0.4296875, 0.5546875, 0.4296875]
P000 yt : [INFO     ] 2013-04-02 20:57:27,310 Added slice of Density at y =
0.5546875 with 'center' = [0.4296875, 0.5546875, 0.4296875]
P001 yt : [DEBUG    ] 2013-04-02 20:57:27,325 Received buffer of min 0.0
and max 3.34041847571e-21 (data: 1.66943640208e-23 3.34041847571e-21)
P000 yt : [DEBUG    ] 2013-04-02 20:57:27,331 Received buffer of min 0.0
and max 3.34041847571e-21 (data: 1.66943640208e-23 3.34041847571e-21)
P001 yt : [INFO     ] 2013-04-02 20:57:27,401 Saved
cycle00000001_Slice_y_Density.png

I think what this means is that it isn't picking up the parallel part of
yt, as you expected.  Does running a similar script on a datadump like:

mpirun -np 2 python your_script.py --parallel

yield different information in the logs?  If you get the same thing
(without the P??? prefix), then I'd say try doing pip install mpi4py or
re-installing mpi4py some other way and make sure that it picks up the same
mpirun that you are running enzo with.

Hope that helps,
Sam



On Tue, Apr 2, 2013 at 5:26 PM, Christine Simpson <
csimpson at astro.columbia.edu> wrote:

> Hi all,
>
> I'm not sure what list to send this to since it is about inline yt in
> enzo, but I will try it here.  I'm trying to do some simple inline tasks
> for a non-cosmology problem (one that is not currently in the enzo-dev
> repo).  I'm trying to do some slices; I eventually want to do some 1-d
> profiles and derived quantities.
>
> I have a script that works on one processor (with MPI on), but when I
> try to use more than one processor I get odd results.  The slices I get
> appear to contain only part of the simulation domain (so there is stuff
> in part of the image and the rest is blank) and I get key errors from
> some processors saying they can't find the Density field.  The error is
> pasted below.  I'm guessing something about parallel yt is not working
> correctly?  I should also mention that this run does not use AMR.  My yt
> script is also pasted below, along with the enzo parameter file (which
> is a little jumbled, sorry).
>
> The yt version I'm using is the current one (I checked out the install
> script today).  I did have to comment out the following line in
> yt-x86_64-shared/src/yt-hg/yt/frontends/enzo/data_structures.py:
>
> #self.periodicity =
> ensure_tuple(self.parameters["LeftFaceBoundaryCondition"] == 3)
>
> The enzo version I'm using is the tip of the enzo-dev-mom fork which
> diverged from enzo-dev after changeset e01ad22.  I glanced through the
> accepted pull requests, but nothing jumped out at me as being a
> solution.
>
> Any ideas would be appreciated.
>
> Thanks
> Christine
>
> Error:
>
> yt : [INFO     ] 2013-04-02 16:00:50,454 Parameters: current_time
> = 4.81533679704e-05
> yt : [INFO     ] 2013-04-02 16:00:50,454 Parameters: domain_dimensions
> = [98 98 98]
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: current_time
> = 4.81533679704e-05
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: domain_left_edge
> = [ 0.  0.  0.]
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: domain_dimensions
> = [98 98 98]
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: current_time
> = 4.81533679704e-05
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: domain_right_edge
> = [ 1.  1.  1.]
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: domain_left_edge
> = [ 0.  0.  0.]
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters:
> cosmological_simulation   = 0.0
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: domain_dimensions
> = [98 98 98]
> yt : [INFO     ] 2013-04-02 16:00:50,455 Parameters: domain_right_edge
> = [ 1.  1.  1.]
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters:
> cosmological_simulation   = 0.0
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters: domain_left_edge
> = [ 0.  0.  0.]
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters: domain_right_edge
> = [ 1.  1.  1.]
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters: current_time
> = 4.81533679704e-05
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters:
> cosmological_simulation   = 0.0
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters: domain_dimensions
> = [98 98 98]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: current_time
> = 4.81533679704e-05
> yt : [INFO     ] 2013-04-02 16:00:50,456 Parameters: domain_left_edge
> = [ 0.  0.  0.]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: domain_dimensions
> = [98 98 98]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: domain_right_edge
> = [ 1.  1.  1.]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters:
> cosmological_simulation   = 0.0
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: domain_left_edge
> = [ 0.  0.  0.]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: current_time
> = 4.81533679704e-05
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: domain_right_edge
> = [ 1.  1.  1.]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: domain_dimensions
> = [98 98 98]
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters:
> cosmological_simulation   = 0.0
> yt : [INFO     ] 2013-04-02 16:00:50,457 Parameters: domain_left_edge
> = [ 0.  0.  0.]
> yt : [INFO     ] 2013-04-02 16:00:50,458 Parameters: domain_right_edge
> = [ 1.  1.  1.]
> yt : [INFO     ] 2013-04-02 16:00:50,458 Parameters:
> cosmological_simulation   = 0.0
> yt : [INFO     ] 2013-04-02 16:00:50,459 Gathering a field list (this
> may take a moment.)
> yt : [INFO     ] 2013-04-02 16:00:50,459 Gathering a field list (this
> may take a moment.)
> yt : [INFO     ] 2013-04-02 16:00:50,460 Gathering a field list (this
> may take a moment.)
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "./user_script.py", line 19, in main
>   File "./user_script.py", line 19, in main
>     pc = PlotCollection(pf)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/visualization/plot_collection.py",
> line 120, in __init__
>     pc = PlotCollection(pf)
>     v,self.c = pf.h.find_max("Density") # @todo: ensure no caching
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/object_finding_mixin.py",
> line 61, in find_max
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/visualization/plot_collection.py",
> line 120, in __init__
>     mg, mc, mv, pos = self.find_max_cell_location(field, finest_levels)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/object_finding_mixin.py",
> line 74, in find_max_cell_location
>     v,self.c = pf.h.find_max("Density") # @todo: ensure no caching
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/object_finding_mixin.py",
> line 61, in find_max
>     source.quantities["MaxLocation"]( field, lazy_reader=True)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 92, in __call__
>     mg, mc, mv, pos = self.find_max_cell_location(field, finest_levels)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/object_finding_mixin.py",
> line 74, in find_max_cell_location
>     return self._call_func_lazy(args, kwargs)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 99, in _call_func_lazy
>     source.quantities["MaxLocation"]( field, lazy_reader=True)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 92, in __call__
>     rv = self.func(GridChildMaskWrapper(g, self._data_source), *args,
> **kwargs)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 669, in _MaxLocation
>     return self._call_func_lazy(args, kwargs)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 99, in _call_func_lazy
>     rv = self.func(GridChildMaskWrapper(g, self._data_source), *args,
> **kwargs)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 669, in _MaxLocation
>     if data[field].size > 0:
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 60, in __getitem__
>     if data[field].size > 0:
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 60, in __getitem__
>     data = self.data_source._get_data_from_grid(self.grid, item)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/data_containers.py",
> line 95, in save_state
>     data = self.data_source._get_data_from_grid(self.grid, item)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/data_containers.py",
> line 95, in save_state
>     tr = func(self, grid, field, *args, **kwargs)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/data_containers.py",
> line 2645, in _get_data_from_grid
>     tr = func(self, grid, field, *args, **kwargs)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/data_containers.py",
> line 2645, in _get_data_from_grid
>     tr = grid[field]
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/grid_patch.py",
> line 157, in __getitem__
>     tr = grid[field]
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/grid_patch.py",
> line 157, in __getitem__
>     self.get_data(key)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/grid_patch.py",
> line 200, in get_data
>     self.get_data(key)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/grid_patch.py",
> line 200, in get_data
>     self._generate_field(field)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/grid_patch.py",
> line 147, in _generate_field
>     self._generate_field(field)
>   File
> "/home/csimpson/yt-x86_64-shared/src/yt-hg/yt/data_objects/grid_patch.py",
> line 147, in _generate_field
>     raise exceptions.KeyError(field)
> KeyError:     raise exceptions.KeyError(field)
> 'Density'
> KeyError: 'Density'
> yt : [INFO     ] 2013-04-02 16:00:50,892 Max Value is 1.00000e-24 at
> 0.0051020408163265 0.0051020408163265 0.0051020408163265 in grid
> EnzoGrid_0001 at level 0 (0, 0, 0)
> yt : [INFO     ] 2013-04-02 16:00:50,892 Created plot collection with
> default plot-center = [0.0051020408163265302, 0.0051020408163265302,
> 0.0051020408163265302]
> yt : [INFO     ] 2013-04-02 16:00:51,222 Added slice of Density at y =
> 0.00510204081633 with 'center' = [0.0051020408163265302,
> 0.0051020408163265302, 0.0051020408163265302]
> yt : [INFO     ] 2013-04-02 16:00:52,250 Saved
> cycle00000001_Slice_y_Density.png
> ['z-velocity', 'Temperature', 'GasEnergy', 'Density', 'TotalEnergy',
> 'x-velocity', 'y-velocity']
>
>
> python script:
>
> from yt.mods import *
>
> def main():
>
>
>     pf = EnzoStaticOutputInMemory()
>
>     pc = PlotCollection(pf)
>     pc.add_slice("Density",1)
>     pc.save()
>
>     print pf.h.field_list
>
> enzo parameter file:
> #
> # AMR PROBLEM DEFINITION FILE: TestStarParticle
>
> #
> PythonTopGridSkip = 1
> CellFlaggingMethod  =  0
> PPMDiffusionParameter  =  0
> PPMSteepeningParameter  =  0
> DensityUnits  =  1.0e-24
> LengthUnits  =  3.01802501047e+20
> #RadiativeCooling  =  1
> StarParticleFeedback  =  2
> RefineBy  =  2
> CourantSafetyNumber  =  0.4
> OutputCoolingTime  =  1
> dtDataDump  =  0.1
> TopGridDimensions  =  98 98 98
> TestStarParticleEnergy  =  0.00104392468495
> MaximumRefinementLevel  =  0
> Initialdt  =  4.81533668755e-05
> TestStarParticleDensity  =  1.0
> ProblemType  =  90
> PPMFlatteningParameter  =  0
> StopTime  =  0.3
> TopGridRank  =  3
> StarFeedbackKineticFraction  =  1.0
> StaticHierarchy  =  1
> Gamma  =  1.66667
> StarMassEjectionFraction  =  0.25
> TimeUnits  =  3.15e13
> TestStarParticleStarMass  =  100.0
> StarEnergyToThermalFeedback  =  5.59e-6
> HydroMethod  =  0
> DualEnergyFormalism  =  1
> #CycleSkipDataDump  =  1
> OutputTemperature  =  1
>
>
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130402/d247279a/attachment.htm>


More information about the yt-users mailing list