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

'group argument must be None for now' in parallel mode for python 3.8 #9

Open
Yeqzids opened this issue Jan 26, 2022 · 1 comment
Open

Comments

@Yeqzids
Copy link

Yeqzids commented Jan 26, 2022

I am getting the following error when trying to run the example. I am on python=3.8 and zogyp=1.6.3.

Parallell version, using 18 cores
Traceback (most recent call last):
  File "[..]/anaconda3/bin/ZOGY", line 33, in <module>
    sys.exit(load_entry_point('zogyp==1.6.3', 'console_scripts', 'ZOGY')())
  File "[..]/anaconda3/lib/python3.8/site-packages/zogyp-1.6.3-py3.8.egg/zogyp/ZOGY.py", line 153, in main
    run_ZOGY(sci_T, ref_T, clean_ref=cleanref, clean_sci=cleansci,
  File "[..]/anaconda3/lib/python3.8/site-packages/zogyp-1.6.3-py3.8.egg/zogyp/zip.py", line 715, in run_ZOGY
    p = NoDaemonProcessPool(processes = ncores)
  File "[..]/anaconda3/lib/python3.8/multiprocessing/pool.py", line 212, in __init__
    self._repopulate_pool()
  File "[..]/anaconda3/lib/python3.8/multiprocessing/pool.py", line 303, in _repopulate_pool
    return self._repopulate_pool_static(self._ctx, self.Process,
  File "[..]/anaconda3/lib/python3.8/multiprocessing/pool.py", line 319, in _repopulate_pool_static
    w = Process(ctx, target=worker,
  File "[..]/anaconda3/lib/python3.8/multiprocessing/process.py", line 82, in __init__
    assert group is None, 'group argument must be None for now'

After some research, I think this relates to https://stackoverflow.com/questions/52948447/error-group-argument-must-be-none-for-now-in-multiprocessing-pool. I can't quite follow the fix mentioned in that thread (nipy/nipype#2754), but downgrading to python=3.5 resolves the problem.

@EA4096
Copy link

EA4096 commented Aug 14, 2023

Resolved this problem in Python 3.5 rewriting NoDaemonProcess and NoDaemonProcessPool classes as follows:

class NoDaemonProcess(multiprocessing.Process):
    # make 'daemon' attribute always return False
    @property
    def daemon(self):
        return False

    @daemon.setter
    def daemon(self, val):
        pass
class NoDaemonProcessPool(multiprocessing.pool.Pool):

    def Process(self, *args, **kwds):
        proc = super(NoDaemonProcessPool, self).Process(*args, **kwds)
        proc.__class__ = NoDaemonProcess

        return proc

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

No branches or pull requests

2 participants