- Fix qbar error for OSX.

This commit is contained in:
w.pomp
2020-09-11 17:37:47 +02:00
parent 6c4f2d5132
commit 2ddf73ed0f
3 changed files with 8 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ Take any normal serial but parallelizable for-loop and execute it in parallel us
Don't worry about the technical details of using the multiprocessing module, race conditions, queues,
parfor handles all that.
Tested on linux on python 2.7 and 3.8
Tested on linux on python 2.7 and 3.8 and on Windows and OSX on python 3.8.
## Why is parfor better than just using multiprocessing?
- Easy to use
@@ -28,6 +28,8 @@ is because the individual processes cannot terminate. Importing javabridge (used
java virtual machine can cause it to hang since the processes only terminate after the java vm has quit. In this case,
pass terminator=javabridge.kill_vm to parfor.
On OSX the buffer bar does not work due to limitations of the OS.
## Arguments
### Required:
fun: function taking arguments: iteration from iterable, other arguments defined in args & kwargs

View File

@@ -348,7 +348,10 @@ class parpool(object):
def _qbar_update(self):
if not self.qbar is None:
try:
self.qbar.n = self.Qi.qsize()
except:
pass
def __setitem__(self, handle, n):
""" Add new iteration. """

View File

@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="parfor",
version="2020.09.3",
version="2020.09.4",
author="Wim Pomp",
author_email="wimpomp@gmail.com",
description="A package to mimic the use of parfor as done in Matlab.",