Skip to content
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

multiprocessing error in albo example #79

Open
vvoelz opened this issue Dec 11, 2020 · 2 comments
Open

multiprocessing error in albo example #79

vvoelz opened this issue Dec 11, 2020 · 2 comments
Assignees
Labels

Comments

@vvoelz
Copy link
Owner

vvoelz commented Dec 11, 2020

In trying to run the example code for albocycline, I run into an error with the multiprocessing commands. My guess is that something must have changed with the classes used in multiprocessing in newer python versions. I'm using Python 3.8.3

Number of CPU's: 8
Number of processes: 3
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-4e9d2c5a37fe> in <module>
      4 jobs = []
      5 for lam in lambda_values:
----> 6     process = p.Process(target=mp_lambdas, args=(lam,))
      7     jobs.append(process)
      8     jobs[-1].start() # Start the processes

TypeError: Process() missing 1 required positional argument: 'ctx'
@robraddi
Copy link
Collaborator

robraddi commented Dec 11, 2020

Python 3.8 multiprocessing get_context() function
Application for ctx = mp.get_context()
I will make sure this is fixed for the "big merge" of most recent src code for biceps 2.0 manuscript. For now, we will have to assume version Python 3-3.7 for multiprocessing to work.

@robraddi robraddi added the bug label Jan 5, 2021
@robraddi
Copy link
Collaborator

robraddi commented Jan 5, 2021

EDIT:
Fixed bug for Python 3.8 by satisfying positional argument: 'ctx'

Here's what I tried:

if version < 3.8: process = p.Process(target=function, args=(iter,))
## FIXME: Python >= 3.8: For some reason this isn't working anymore?!?!
if version >= 3.8: process = p.Process(target=function, args=(iter,), ctx=mp.get_context(method='fork'))

Still searching here for an alternate solution.

As a side note, there may be complications using multiprocessing between platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants