- Fix qbar error for OSX.
This commit is contained in:
@@ -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,
|
Don't worry about the technical details of using the multiprocessing module, race conditions, queues,
|
||||||
parfor handles all that.
|
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?
|
## Why is parfor better than just using multiprocessing?
|
||||||
- Easy to use
|
- 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,
|
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.
|
pass terminator=javabridge.kill_vm to parfor.
|
||||||
|
|
||||||
|
On OSX the buffer bar does not work due to limitations of the OS.
|
||||||
|
|
||||||
## Arguments
|
## Arguments
|
||||||
### Required:
|
### Required:
|
||||||
fun: function taking arguments: iteration from iterable, other arguments defined in args & kwargs
|
fun: function taking arguments: iteration from iterable, other arguments defined in args & kwargs
|
||||||
|
|||||||
@@ -348,7 +348,10 @@ class parpool(object):
|
|||||||
|
|
||||||
def _qbar_update(self):
|
def _qbar_update(self):
|
||||||
if not self.qbar is None:
|
if not self.qbar is None:
|
||||||
self.qbar.n = self.Qi.qsize()
|
try:
|
||||||
|
self.qbar.n = self.Qi.qsize()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def __setitem__(self, handle, n):
|
def __setitem__(self, handle, n):
|
||||||
""" Add new iteration. """
|
""" Add new iteration. """
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="parfor",
|
name="parfor",
|
||||||
version="2020.09.3",
|
version="2020.09.4",
|
||||||
author="Wim Pomp",
|
author="Wim Pomp",
|
||||||
author_email="wimpomp@gmail.com",
|
author_email="wimpomp@gmail.com",
|
||||||
description="A package to mimic the use of parfor as done in Matlab.",
|
description="A package to mimic the use of parfor as done in Matlab.",
|
||||||
|
|||||||
Reference in New Issue
Block a user