<div dir="ltr"><div><div>Hi, all--<br><br></div>I have an odd error trying to get some averaged quantities in parallel.  I'm trying to do <br><br>pf.h.all_data().quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')<br>


<br></div>on two processors, and I get the following error:<br><div><br>File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 396, in __call__<br>dd *= self._convert_function(data)<br>


TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'<br><br></div><div>It works fine in serial, and it works fine if I use "VelocityMagnitude" instead of "MagneticEnergy"<br>

<br></div><div>Does anyone have an idea about what I'm doing wrong?<br></div><div><br>I run it as <br>> mpirun -np 2 python p23_go.py --parallel<br><br></div><div>and the full trace back is:<br></div><div><br>Traceback (most recent call last):<br>

  File "ptmp.py", line 5, in <module><br>
    bavg = ad.quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 87, in __call__<br>


Traceback (most recent call last):<br>  File "ptmp.py", line 5, in <module><br>    bavg = ad.quantities['WeightedAverageQuantity']('MagneticEnergy','CellVolume')<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 87, in __call__<br>


    self.func(e, *args, **kwargs)<br>    self.func(e, *args, **kwargs)<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 203, in _WeightedAverageQuantity<br>


  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/derived_quantities.py", line 203, in _WeightedAverageQuantity<br>    num = (data[field] * data[weight]).sum()<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br>


    num = (data[field] * data[weight]).sum()<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br>    vv = FI[item](self)<br>    vv = FI[item](self)<br>


  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 395, in __call__<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 395, in __call__<br>


    dd = self._function(self, data)<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/universal_fields.py", line 1016, in _MagneticEnergy<br>    dd = self._function(self, data)<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/universal_fields.py", line 1016, in _MagneticEnergy<br>


    return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/(8*np.pi)<br>    return (data["Bx"]**2 + data["By"]**2 + data["Bz"]**2)/(8*np.pi)<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br>


  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 257, in __missing__<br>    vv = FI[item](self)<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 396, in __call__<br>


    vv = FI[item](self)<br>  File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/field_info_container.py", line 396, in __call__<br>    dd *= self._convert_function(data)<br>TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'<br>


    dd *= self._convert_function(data)<br>TypeError: unsupported operand type(s) for *=: 'NoneType' and 'int'<br><br></div><div>Thanks a ton!<br></div><div><br clear="all"><div><div><br>-- <br><div dir="ltr">

-- Sent from a computer.<br></div>

</div></div></div></div>