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

nscsim: why can't I can open another pathos pool in the notebook? #31

Open
jmborr opened this issue May 17, 2019 · 2 comments
Open

nscsim: why can't I can open another pathos pool in the notebook? #31

jmborr opened this issue May 17, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jmborr
Copy link
Owner

jmborr commented May 17, 2019

after calculating the coherent scattering with, say, 4 cores. I try the calculation of another coherent scattering with 8 cores. too. Then I get the error that the pool is not open.

sf = coh.intermediate_spherical(tr, q_mod, b_c, n_cores=4)
....
sf = coh.intermediate_spherical(tr_other, q_mod_other, b_c, n_cores=4)

~/.virtualenvs/nscsim3.6/lib/python3.6/site-packages/multiprocess/pool.py in _map_async(self, func, iterable, mapper, chunksize, callback, error_callback)
    372         '''
    373         if self._state != RUN:
--> 374             raise ValueError("Pool not running")
    375         if not hasattr(iterable, '__len__'):
    376             iterable = list(iterable)

ValueError: Pool not running
@jmborr jmborr added the bug Something isn't working label May 17, 2019
@jmborr jmborr self-assigned this May 17, 2019
@ConnorPigg
Copy link
Collaborator

Try putting pool.restart(force=True) before using the pool or after defining the pool variable. This should allow you to close the pool but reset the recycled pathos pool object between uses.

@jmborr
Copy link
Owner Author

jmborr commented Aug 8, 2019

yes, I noticed you had that line in incoheren2.py 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants