New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
do not enable Parallel if multiprocessing.synchronize is N/A #39
Conversation
…herwise problem is currently present with python on bsd systems
Thanks a lot!
Another option would be to provide only limited parallel functionality. Would that solve the problem on kfreebsd? Gael |
Sorry Gael -- I am confused... for a moment I thought that there is some other implementation in Parallel allowing to avoid multiprocessing.Pool but that seems to be not the case, so what did you mean by "limited parallel functionality" if joblib.cpu_count just returns 1 -- that would indeed be in effect for no explicit n_jobs setting and would fail for both n_jobs=-1 and 2 |
On Fri, Jul 13, 2012 at 11:21:08AM -0700, Yaroslav Halchenko wrote:
Indeed, it is not the case. Are you saying that multiprocessing.Pool is G |
to say the truth -- I do not know for sure (I am not a freebsd user/developer, yet ;) ) -- but that is what error msg/bug report suggests |
I guess there should be no harm if I push this patch into Debian package (need to fix FTBFS for statsmodels with it), right? ;-) |
Sorry Yarik for the delay. I am merging this in. Do you need me to release quickly a bug fix release, or can I wait a bit. I'd like to merge in a pull request by Olivier Grisel before the next release, but it's not quite ready. |
and I was slow myself only yesterday to discover that this is not effective with python2.6 (works fine with 2.7) -- I will look into it shortly... |
OK, just do a new pull request, and I'll try to be quicker to merge it. |
Not sure what would be the clean way now... I see two possibilities
what do you think? should I proceed with 2? |
On Mon, Jul 23, 2012 at 10:31:29AM -0700, Yaroslav Halchenko wrote:
I think that 2 garanties to always have a workable system and not prevent Also, if we go down that route, we need to make really sure that that Thanks a lot for your efforts! |
good idea -- so 1. + 2. then ;) (i.e. test 2. only on bsd systems)
there indeed might be a better check -- I just have failed to find it since it
do you mean _.close() for that pool? (if it succeeded to create if of Yaroslav O. Halchenko |
On Mon, Jul 23, 2012 at 10:42:42AM -0700, Yaroslav Halchenko wrote:
How about trying to instanciate a multiprocessing.Semaphore? It is part
Yes, join and close. |
On Mon, 23 Jul 2012, Gael Varoquaux wrote:
Good call -- it does fail the same way:
with semaphore it should be easier... would be ok if I just del it? i.e. In [17]: sem = multiprocessing.Semaphore() to leave no trace? Yaroslav O. Halchenko |
On Mon, Jul 23, 2012 at 10:53:51AM -0700, Yaroslav Halchenko wrote:
I do believe that this is the root of our problem. Looks like we have a On my box, it take 30us to create a Semaphore: In [1]: import multiprocessing In [2]: %timeit multiprocessing.Semaphore() 10000 loops, best of 3: 28.9 us per loop thus, I think that we can put this check on every os, which avoids ugly |
BTW -- while unittesting for the new "fix" on the kfreebsd box (will send a PR
and that is because print "DISK USED: %r target_size: %r" % (disk_used(cachedir), target_size) gives DISK USED: 1042 target_size: 1024 Yaroslav O. Halchenko |
btw -- is python3 fully supported ? I am just getting some failures and e.g. stalls for me:
Yaroslav O. Halchenko |
Having finally tracked down not working multiprocessing.cpu_count on kfreebsd debian systems I ended up with
https://buildd.debian.org/status/fetch.php?pkg=statsmodels&arch=kfreebsd-i386&ver=0.4.2-1&stamp=1342080335
(look in the bottom)
So I wondered, shouldn't I just patch joblib also to require 'import multiprocessing.synchronize' to complete correctly for the check of multiprocessing existence