[yt-users] parallel quantities

Nathan Goldbaum nathan12343 at gmail.com
Tue Jul 23 11:25:41 PDT 2013


Hey Dave,

I'm unable to reproduce the error using the following script:

from yt.mods import *
pf = load('IsolatedGalaxy/galaxy0030/galaxy0030')
q =
pf.h.all_data().quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')
print q

I executed it with the following command:

mpirun -np 2 python test.py --parallel

this was run on 683e4ea8530e.

IsolatedGalaxy is probably very different from your dataset.  Does my
script fail with the trivial modification to load your file instead of
IsolatedGalaxy?  If not, can you modify the script to reproduce the error
you're seeing?

-Nathan


On Tue, Jul 23, 2013 at 10:58 AM, David Collins <dcollins4096 at gmail.com>wrote:

> Hi, all--
>
> I have an odd error trying to get some averaged quantities in parallel.
> I'm trying to do
>
>
> pf.h.all_data().quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')
>
> on two processors, and I get the following error:
>
> File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 396, in __call__
> dd *= self._convert_function(data)
> TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'
>
> It works fine in serial, and it works fine if I use "VelocityMagnitude"
> instead of "MagneticEnergy"
>
> Does anyone have an idea about what I'm doing wrong?
>
> I run it as
> > mpirun -np 2 python p23_go.py --parallel
>
> and the full trace back is:
>
> Traceback (most recent call last):
>   File "ptmp.py", line 5, in <module>
>     bavg =
> ad.quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 87, in __call__
> Traceback (most recent call last):
>   File "ptmp.py", line 5, in <module>
>     bavg =
> ad.quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 87, in __call__
>     self.func(e, *args, **kwargs)
>     self.func(e, *args, **kwargs)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 203, in _WeightedAverageQuantity
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py",
> line 203, in _WeightedAverageQuantity
>     num = (data[field] * data[weight]).sum()
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 257, in __missing__
>     num = (data[field] * data[weight]).sum()
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 257, in __missing__
>     vv = FI[item](self)
>     vv = FI[item](self)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 395, in __call__
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 395, in __call__
>     dd = self._function(self, data)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/universal_fields.py",
> line 1016, in _MagneticEnergy
>     dd = self._function(self, data)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/universal_fields.py",
> line 1016, in _MagneticEnergy
>     return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/(8*np.pi)
>     return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/(8*np.pi)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 257, in __missing__
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 257, in __missing__
>     vv = FI[item](self)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 396, in __call__
>     vv = FI[item](self)
>   File
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py",
> line 396, in __call__
>     dd *= self._convert_function(data)
> TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'
>     dd *= self._convert_function(data)
> TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'
>
> Thanks a ton!
>
>
> --
> -- Sent from a computer.
>
> _______________________________________________
> 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/20130723/ef6bc4b1/attachment.html>


More information about the yt-users mailing list