<div dir="ltr"><div class="gmail_extra">mpi_bcast was what I was looking for! Thank you</div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">-Claire</div></div>
<br><br><div class="gmail_quote">On Tue, May 6, 2014 at 2:05 PM,  <span dir="ltr"><<a href="mailto:yt-users-request@lists.spacepope.org" target="_blank">yt-users-request@lists.spacepope.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Send yt-users mailing list submissions to<br>
        <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:yt-users-request@lists.spacepope.org">yt-users-request@lists.spacepope.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:yt-users-owner@lists.spacepope.org">yt-users-owner@lists.spacepope.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of yt-users digest..."<br>
<br>Today's Topics:<br>
<br>
   1. Parallel Broadcasting in yt (Claire Kopenhafer)<br>
   2. Re: Parallel Broadcasting in yt (Britton Smith)<br>
   3. fractional keyword in profile plot (Chang-Goo Kim)<br>
   4. total mass (Chang-Goo Kim)<br>
   5. Re: total mass (Matthew Turk)<br>
<br><br>---------- Forwarded message ----------<br>From: Claire Kopenhafer <<a href="mailto:clairekope@gmail.com">clairekope@gmail.com</a>><br>To: <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
Cc: <br>Date: Mon, 5 May 2014 15:56:29 -0400<br>Subject: [yt-users] Parallel Broadcasting in yt<br><div dir="ltr"><div><div>Hello all,<br><br>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!</div>

<div><br></div><div dir="ltr">-Claire</div></div>
</div>
<br><br>---------- Forwarded message ----------<br>From: Britton Smith <<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>><br>To: Discussion of the yt analysis package <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Cc: <br>Date: Mon, 5 May 2014 16:50:06 -0400<br>Subject: Re: [yt-users] Parallel Broadcasting in yt<br><div dir="ltr">Hi Claire,<div><br></div><div>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.</div>

<div><br></div><div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 3:56 PM, Claire Kopenhafer <span dir="ltr"><<a href="mailto:clairekope@gmail.com" target="_blank">clairekope@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hello all,<br><br>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!</div>

<span><font color="#888888">
<div><br></div><div dir="ltr">-Claire</div></font></span></div>
</div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>
<br><br>---------- Forwarded message ----------<br>From: Chang-Goo Kim <<a href="mailto:cgkim@astro.princeton.edu">cgkim@astro.princeton.edu</a>><br>To: Discussion of the yt analysis package <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Cc: <br>Date: Tue, 6 May 2014 13:43:39 -0400<br>Subject: [yt-users] fractional keyword in profile plot<br><div dir="ltr"><div>Hi all,<br><br>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.<br>

<br></div>Thanks,<br><br>Chang-Goo<br><div><div><div><div><pre><span>---------------------------------------------------------------------------</span>
<span>YTUnitConversionError</span>                     Traceback (most recent call last)
<span><ipython-input-137-18016774c3d0></span> in <span><module><span>()</span>
<span>----> 1<span> </span>pdf</span><span>=</span></span>ProfilePlot<span>(</span>dd<span>,</span><span>"temp"</span><span>,</span><span>[</span><span>'cell_mass'</span><span>,</span><span>'cell_volume'</span><span>]</span><span>,</span>weight_field<span>=</span>None<span>,</span>fractional<span>=</span>True<span>)</span><span></span>
<span>      2</span> pdf<span>.</span>show<span>(</span><span>)</span><span></span>

<span>/u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/visualization/profile_plotter.pyc</span> in <span>__init__<span>(self, data_source, x_field, y_fields, weight_field, n_bins, accumulation, fractional, label, plot_spec, profiles)</span>
<span>    216</span>             </span>self<span>.</span>plot_spec <span>=</span> <span>[</span>self<span>.</span>plot_spec<span>.</span>copy<span>(</span><span>)</span> <span>for</span> p <span>in</span> self<span>.</span>profiles<span>]</span><span></span>
<span>    217</span> <span></span>
<span>--> 218<span>         </span>self</span><span>.</span>_setup_plots<span>(</span><span>)</span><span></span>
<span>    219</span> <span></span>
<span>    220</span>     <span>def</span> save<span>(</span>self<span>,</span> name<span>=</span>None<span>)</span><span>:</span><span></span>

<span>/u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/visualization/profile_plotter.pyc</span> in <span>_setup_plots<span>(self)</span>
<span>    309</span>         </span>self<span>.</span>axes <span>=</span> AxesContainer<span>(</span>self<span>.</span>figures<span>)</span><span></span>
<span>    310</span>         <span>for</span> i<span>,</span> profile <span>in</span> enumerate<span>(</span>self<span>.</span>profiles<span>)</span><span>:</span><span></span>
<span>--> 311<span>             <span>for</span> </span>field</span><span>,</span> field_data <span>in</span> profile<span>.</span>items<span>(</span><span>)</span><span>:</span><span></span>
<span>    312</span>                 self.axes[field].plot(np.array(profile.x),
<span>    313</span>                                       np<span>.</span>array<span>(</span>field_data<span>)</span><span>,</span><span></span>

<span>/u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/data_objects/profiles.pyc</span> in <span>items<span>(self)</span>
<span>    854</span> <span></span></span>
<span>    855</span>     <span>def</span> items<span>(</span>self<span>)</span><span>:</span><span></span>
<span>--> 856<span>         <span>return</span> <span>[</span><span>(</span></span>k</span><span>,</span>self<span>[</span>k<span>]</span><span>)</span> <span>for</span> k <span>in</span> self<span>.</span>field_data<span>.</span>keys<span>(</span><span>)</span><span>]</span><span></span>
<span>    857</span> <span></span>
<span>    858</span>     <span>def</span> __iter__<span>(</span>self<span>)</span><span>:</span><span></span>

<span>/u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/data_objects/profiles.pyc</span> in <span>__getitem__<span>(self, field)</span>
<span>    851</span>             <span>raise</span> </span>KeyError<span>(</span>field<span>)</span><span></span>
<span>    852</span>         <span>else</span><span>:</span><span></span>
<span>--> 853<span>             <span>return</span> </span>self</span><span>.</span>field_data<span>[</span>fname<span>]</span><span>.</span>in_units<span>(</span>self<span>.</span>field_units<span>[</span>fname<span>]</span><span>)</span><span></span>
<span>    854</span> <span></span>
<span>    855</span>     <span>def</span> items<span>(</span>self<span>)</span><span>:</span><span></span>

<span>/u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/units/yt_array.pyc</span> in <span>in_units<span>(self, units)</span>
<span>    358</span> <span></span></span>
<span>    359</span>         """
<span>--> 360<span>         </span>new_units</span> <span>=</span> self<span>.</span>_unit_repr_check_same<span>(</span>units<span>)</span><span></span>
<span>    361</span>         conversion_factor <span>=</span> self<span>.</span>units<span>.</span>get_conversion_factor<span>(</span>new_units<span>)</span><span></span>
<span>    362</span> <span></span>

<span>/u/cgkim/Sources/yt-x86_64/src/yt-hg/yt/units/yt_array.pyc</span> in <span>_unit_repr_check_same<span>(self, units)</span>
<span>    315</span>         <span>if</span> <span>not</span> </span>self<span>.</span>units<span>.</span>same_dimensions_as<span>(</span>units<span>)</span><span>:</span><span></span>
<span>    316</span>             raise YTUnitConversionError(
<span>--> 317<span>                 self.units, self.units.dimensions, units, units.dimensions)
</span><span>    318</span> <span></span></span>
<span>    319</span>         <span>return</span> units<span></span>

<span>YTUnitConversionError</span>: Unit dimensionalities do not match. Tried to convert between dimensionless (dim 1) and code_length**3 (dim (length)**3).

</pre></div></div></div><br></div></div>
<br><br>---------- Forwarded message ----------<br>From: Chang-Goo Kim <<a href="mailto:cgkim@astro.princeton.edu">cgkim@astro.princeton.edu</a>><br>To: Discussion of the yt analysis package <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Cc: <br>Date: Tue, 6 May 2014 13:50:47 -0400<br>Subject: [yt-users] total mass<br><div dir="ltr"><div><div>Hi all again,<br><br></div>I tried to find mass fraction of each temperature component, but I got inconsistent results as below:<br>
<br>==<br><br><div><pre><span>dd</span>=<span>pf</span>.<span>all_data</span>()</pre>
<pre> </pre><pre><span>hot</span>=<span>dd</span>.<span>cut_region</span>([<span>"obj['temperature'] >= 1.e4"</span>])</pre><pre><span>wnm</span>=<span>dd</span>.<span>cut_region</span>([<span>"obj['temperature'] < 1.e4"</span>])</pre>

<pre> </pre><pre><span>print</span> <span>dd</span>.<span>quantities</span>.<span>total_mass</span><span>(</span><span>)</span></pre><pre><span>print</span> <span>wnm</span>.<span>quantities</span>.<span>total_mass</span>()<span>+</span><span>hot</span>.<span>quantities</span>.<span>total_mass</span>()</pre>

<pre> </pre></div><div><div><div><pre>2.88677799841e+38 g
2.91575727709e+38 g
</pre></div></div></div>==<br><br></div><div>I can't understand why those two are different. Have any idea?<br><br>Chang-Goo<br></div><br></div>
<br><br>---------- Forwarded message ----------<br>From: Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>><br>To: Discussion of the yt analysis package <<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Cc: <br>Date: Tue, 6 May 2014 13:53:45 -0400<br>Subject: Re: [yt-users] total mass<br>Hi Chang-Goo,<br>
<br>
On Tue, May 6, 2014 at 1:50 PM, Chang-Goo Kim <<a href="mailto:cgkim@astro.princeton.edu">cgkim@astro.princeton.edu</a>> wrote:<br>
> Hi all again,<br>
><br>
> I tried to find mass fraction of each temperature component, but I got<br>
> inconsistent results as below:<br>
><br>
> ==<br>
><br>
> dd=pf.all_data()<br>
><br>
><br>
><br>
> hot=dd.cut_region(["obj['temperature'] >= 1.e4"])<br>
><br>
> wnm=dd.cut_region(["obj['temperature'] < 1.e4"])<br>
><br>
><br>
><br>
> print dd.quantities.total_mass()<br>
><br>
> print wnm.quantities.total_mass()+hot.quantities.total_mass()<br>
><br>
<br>
The total_mass includes particle fields, which will be incorrectly cut<br>
by the cut_region.  We're trying to figure out a way to make this<br>
clearer, but you should get identical results if you use the<br>
.total_quantity("cell_mass") function.  This was the subject of a<br>
recent bug report and discussion, as well:<br>
<br>
<a href="https://bitbucket.org/yt_analysis/yt/issue/812/derived-quantities-on-cut_regions-dont" target="_blank">https://bitbucket.org/yt_analysis/yt/issue/812/derived-quantities-on-cut_regions-dont</a><br>
<br>
I thought we'd had a pull request discussion, too, but I can't find it<br>
right now.<br>
<br>
-Matt<br>
<br>
><br>
><br>
> 2.88677799841e+38 g<br>
> 2.91575727709e+38 g<br>
><br>
> ==<br>
><br>
> I can't understand why those two are different. Have any idea?<br>
><br>
> Chang-Goo<br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
<br>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div></div>