shunwang / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

Broadcasting does not work for parallel code correctly #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After some refactoring, it seems that broadcasting does not work correctly in 
parallel mode.  I've no time to see what exactly happens, but the problem can 
be seen on Win64, where the next test always fail:

C:\Users\Francesc\Desktop\Numexpr\trunk>python numexpr\tests\test_numexpr.py 
test_evaluate.test_broadcasting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Numexpr version:   1.4
NumPy version:     1.4.1
Python version:    2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit
(AMD64)]
AMD/Intel CPU?     True
VML available?     False
Detected cores:    6
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
F
======================================================================
FAIL: test_broadcasting (__main__.test_evaluate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "numexpr\tests\test_numexpr.py", line 188, in test_broadcasting
    assert_array_equal(evaluate("a+c"), a+c)
  File "C:\Python26_64\lib\site-packages\numpy\testing\utils.py", line 677, in a
ssert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "C:\Python26_64\lib\site-packages\numpy\testing\utils.py", line 609, in a
ssert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 32.0%)
 x: array([[32, 34, 36, 38, 40, 42, 44, 46, 48, 50],
       [52, 54, 56, 58, 60, 62, 32, 34, 36, 38],
       [40, 42, 44, 46, 48, 50, 52, 54, 56, 58],...
 y: array([[ 0,  2,  4,  6,  8, 10, 12, 14, 16, 18],
       [20, 22, 24, 26, 28, 30, 32, 34, 36, 38],
       [40, 42, 44, 46, 48, 50, 52, 54, 56, 58],...

----------------------------------------------------------------------
Ran 1 test in 0.005s

I'll probably implement a workaround to switch to serial code whenever 
broadcasting is detected, and will let this open until a proper solution would 
be devised.

Original issue reported on code.google.com by fal...@gmail.com on 31 Jul 2010 at 8:12

GoogleCodeExporter commented 9 years ago
Implemented a workaround that uses serial code when broadcasting in r223.

This ticket should remain open until a proper solution would be find.

Original comment by fal...@gmail.com on 31 Jul 2010 at 8:18

GoogleCodeExporter commented 9 years ago
This was fixed when merging the nditer branch.

Original comment by mwwi...@gmail.com on 30 Oct 2011 at 11:51