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

Don't force global multiprocessing start method #4890

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

ahnitz
Copy link
Member

@ahnitz ahnitz commented Sep 24, 2024

Standard information about the request

This is a: bug fix

This change affects library useage of pycbc within a setting where the multiprocessing start context is already set. We currently force a setting of "fork" which doesn't work in some cases and may not be what someone wants for all uses.

Any executable and library code which relies on multiprocessing. In these cases, the correction recommended by @xkzl is used.

This change will ideally have no effect on current usage.

Links to any issues or associated PRs

Error reported in #4853

Testing performed

Additional notes

  • The author of this pull request confirms they will adhere to the code of conduct

@ahnitz ahnitz enabled auto-merge (squash) September 24, 2024 03:43
Copy link
Contributor

@GarethCabournDavies GarethCabournDavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; one minor question but it isn't a showstopper

@@ -20,7 +20,7 @@
import logging
import numpy

from multiprocessing import Pool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly stupid question - some places have multiprocessing.Pool, other have multiprocessing.pool.Pool. This is how it was before these changes as well, so it must be okay, but wanted to flag it

Copy link

@meiyasan meiyasan Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using 'multiprocessing.Pool' I believe this will use default context as defined by 'set_start_method'. In this case one can just use 'get_context("fork/spawn").Pool()'

@ahnitz ahnitz merged commit e0a9088 into gwastro:master Sep 24, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants