[yt-users] Parallel Broadcasting in yt

Claire Kopenhafer clairekope at gmail.com
Wed May 7 10:17:03 PDT 2014


mpi_bcast was what I was looking for! Thank you

-Claire


On Tue, May 6, 2014 at 2:05 PM, <yt-users-request at lists.spacepope.org>wrote:

> Send yt-users mailing list submissions to
>         yt-users at lists.spacepope.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> or, via email, send a message with subject or body 'help' to
>         yt-users-request at lists.spacepope.org
>
> You can reach the person managing the list at
>         yt-users-owner at lists.spacepope.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of yt-users digest..."
>
> Today's Topics:
>
>    1. Parallel Broadcasting in yt (Claire Kopenhafer)
>    2. Re: Parallel Broadcasting in yt (Britton Smith)
>    3. fractional keyword in profile plot (Chang-Goo Kim)
>    4. total mass (Chang-Goo Kim)
>    5. Re: total mass (Matthew Turk)
>
>
> ---------- Forwarded message ----------
> From: Claire Kopenhafer <clairekope at gmail.com>
> To: yt-users at lists.spacepope.org
> Cc:
> Date: Mon, 5 May 2014 15:56:29 -0400
> Subject: [yt-users] Parallel Broadcasting in yt
> Hello all,
>
> I've got a code that reads in a dictionary from file and then operates on
> it, and I'd like to run it in parallel. My best thought is to have the root
> process read in the dict and then broadcast it to all the rest, but I am
> not sure how best to do this within yt. Any suggestions? Thanks!
>
> -Claire
>
>
> ---------- Forwarded message ----------
> From: Britton Smith <brittonsmith at gmail.com>
> To: Discussion of the yt analysis package <yt-users at lists.spacepope.org>
> Cc:
> Date: Mon, 5 May 2014 16:50:06 -0400
> Subject: Re: [yt-users] Parallel Broadcasting in yt
> Hi Claire,
>
> You might want to have a look at the function called mpi_bcast
> in yt/utilities/parallel_tools/parallel_analysis_interface.py.  This should
> do a standard mpi broadcast from the root process to all of the
> subprocesses.  Alternatively, if the dictionary is something that can be
> loaded in in parts by each of the processors and then combined, you might
> also want to check par_combine_object in the same file.
>
> Britton
>
>
> On Mon, May 5, 2014 at 3:56 PM, Claire Kopenhafer <clairekope at gmail.com>wrote:
>
>> Hello all,
>>
>> I've got a code that reads in a dictionary from file and then operates on
>> it, and I'd like to run it in parallel. My best thought is to have the root
>> process read in the dict and then broadcast it to all the rest, but I am
>> not sure how best to do this within yt. Any suggestions? Thanks!
>>
>> -Claire
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
>
> ---------- Forwarded message ----------
> From: Chang-Goo Kim <cgkim at astro.princeton.edu>
> To: Discussion of the yt analysis package <yt-users at lists.spacepope.org>
> Cc:
> Date: Tue, 6 May 2014 13:43:39 -0400
> Subject: [yt-users] fractional keyword in profile plot
> Hi all,
>
> I tried to draw PDFs using ProfilePlot with "fractional" keyword. But, it
> returned unit incompatibility. I have looked at the code, and realized that
> the fractional keyword makes field_data dimensionless, while it tried to
> return data with units of original data. I think it must be easy to fix.
> Error message is attached below.
>
> Thanks,
>
> Chang-Goo
>
> ---------------------------------------------------------------------------YTUnitConversionError                     Traceback (most recent call last)<ipython-input-137-18016774c3d0> in <module>()----> 1 pdf=ProfilePlot(dd,"temp",['cell_mass','cell_volume'],weight_field=None,fractional=True)      2 pdf.show()
> /u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/visualization/profile_plotter.pyc in __init__(self, data_source, x_field, y_fields, weight_field, n_bins, accumulation, fractional, label, plot_spec, profiles)    216             self.plot_spec = [self.plot_spec.copy() for p in self.profiles]    217 --> 218         self._setup_plots()    219     220     def save(self, name=None):
> /u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/visualization/profile_plotter.pyc in _setup_plots(self)    309         self.axes = AxesContainer(self.figures)    310         for i, profile in enumerate(self.profiles):--> 311             for field, field_data in profile.items():    312                 self.axes[field].plot(np.array(profile.x),    313                                       np.array(field_data),
> /u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/data_objects/profiles.pyc in items(self)    854     855     def items(self):--> 856         return [(k,self[k]) for k in self.field_data.keys()]    857     858     def __iter__(self):
> /u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/data_objects/profiles.pyc in __getitem__(self, field)    851             raise KeyError(field)    852         else:--> 853             return self.field_data[fname].in_units(self.field_units[fname])    854     855     def items(self):
> /u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/units/yt_array.pyc in in_units(self, units)    358     359         """--> 360         new_units = self._unit_repr_check_same(units)    361         conversion_factor = self.units.get_conversion_factor(new_units)    362
> /u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/units/yt_array.pyc in _unit_repr_check_same(self, units)    315         if not self.units.same_dimensions_as(units):    316             raise YTUnitConversionError(--> 317                 self.units, self.units.dimensions, units, units.dimensions)    318     319         return units
> YTUnitConversionError: Unit dimensionalities do not match. Tried to convert between dimensionless (dim 1) and code_length**3 (dim (length)**3).
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Chang-Goo Kim <cgkim at astro.princeton.edu>
> To: Discussion of the yt analysis package <yt-users at lists.spacepope.org>
> Cc:
> Date: Tue, 6 May 2014 13:50:47 -0400
> Subject: [yt-users] total mass
> Hi all again,
>
> I tried to find mass fraction of each temperature component, but I got
> inconsistent results as below:
>
> ==
>
> dd=pf.all_data()
>
>
>
> hot=dd.cut_region(["obj['temperature'] >= 1.e4"])
>
> wnm=dd.cut_region(["obj['temperature'] < 1.e4"])
>
>
>
> print dd.quantities.total_mass()
>
> print wnm.quantities.total_mass()+hot.quantities.total_mass()
>
>
>
> 2.88677799841e+38 g
> 2.91575727709e+38 g
>
> ==
>
> I can't understand why those two are different. Have any idea?
>
> Chang-Goo
>
>
>
> ---------- Forwarded message ----------
> From: Matthew Turk <matthewturk at gmail.com>
> To: Discussion of the yt analysis package <yt-users at lists.spacepope.org>
> Cc:
> Date: Tue, 6 May 2014 13:53:45 -0400
> Subject: Re: [yt-users] total mass
> Hi Chang-Goo,
>
> On Tue, May 6, 2014 at 1:50 PM, Chang-Goo Kim <cgkim at astro.princeton.edu>
> wrote:
> > Hi all again,
> >
> > I tried to find mass fraction of each temperature component, but I got
> > inconsistent results as below:
> >
> > ==
> >
> > dd=pf.all_data()
> >
> >
> >
> > hot=dd.cut_region(["obj['temperature'] >= 1.e4"])
> >
> > wnm=dd.cut_region(["obj['temperature'] < 1.e4"])
> >
> >
> >
> > print dd.quantities.total_mass()
> >
> > print wnm.quantities.total_mass()+hot.quantities.total_mass()
> >
>
> The total_mass includes particle fields, which will be incorrectly cut
> by the cut_region.  We're trying to figure out a way to make this
> clearer, but you should get identical results if you use the
> .total_quantity("cell_mass") function.  This was the subject of a
> recent bug report and discussion, as well:
>
>
> https://bitbucket.org/yt_analysis/yt/issue/812/derived-quantities-on-cut_regions-dont
>
> I thought we'd had a pull request discussion, too, but I can't find it
> right now.
>
> -Matt
>
> >
> >
> > 2.88677799841e+38 g
> > 2.91575727709e+38 g
> >
> > ==
> >
> > I can't understand why those two are different. Have any idea?
> >
> > Chang-Goo
> >
> >
> > _______________________________________________
> > yt-users mailing list
> > yt-users at lists.spacepope.org
> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >
>
>
> _______________________________________________
> 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/20140507/9198f646/attachment.html>


More information about the yt-users mailing list