Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. After importing PySide multiprocessing pool hangs on numpy dot

After importing PySide multiprocessing pool hangs on numpy dot

Scheduled Pinned Locked Moved Language Bindings
2 Posts 2 Posters 2.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    otognan
    wrote on last edited by
    #1

    I've got this very peculiar hanging happening on my machine when using pytnon multiprocessing Pool with numpy and PySide imported. This is the most entangled bug I have seen in my life so far:) The following code:

    @import numpy as np
    import PySide

    def hang():
    import multiprocessing
    pool = multiprocessing.Pool(processes = 1)
    pool.map(f, [None])

    def f(ignore):
    print('before dot..')
    np.dot(np.zeros((128, 1)), np.zeros((1, 32)))
    print('after dot.')

    if name == "main":
    hang()
    print('success!')@

    hangs printing only 'before dot..'. But it is supposed to print
    @
    before dot..
    after dot.
    success!@

    so it hangs inside dot function.

    There are several magical modifications I can do to prevent hanging:

    • if you decrease shape of arrays going into 'dot' (e.g. from 128 to 127)
      
    • (!) if you increase shape of arrays going into 'dot' from 128 to 256

    • if you do not use multiprocessing and just run function 'f'

    • if you comment out PySide import which is not used anywhere in the code

    Any help is appreciated!

    Packages version:

    numpy=1.8.1. PySide=1.2.1 or 1.2.2

    Python version:

    Python 2.7.5 (default, Sep 12 2013, 21:33:34) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin

    or

    Python 2.7.6 (default, Apr 9 2014, 11:48:52) [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Albert Zeyer
      wrote on last edited by
      #2

      Is it really numpy.dot or could it also be numpy.zeros?

      I am allocating a huge 3d matrix via numpy.zeros and I seem to have a deadlock in some cases there too.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved