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

RigidCPD does not work in multiprocessing.Process #90

Closed
jwindhager opened this issue May 3, 2022 · 2 comments
Closed

RigidCPD does not work in multiprocessing.Process #90

jwindhager opened this issue May 3, 2022 · 2 comments

Comments

@jwindhager
Copy link

When running RigidCPD in a multiprocessing.Process (Linux, start_method="fork") without CUDA/cupy available, the process hangs in the following line:

return _math.squared_kernel(x, y).sum() / (x.shape[0] * x.shape[1] * y.shape[0])

Debugging & inspecting the stack trace, this gets called here:

sigma2 = self._squared_kernel_sum(self._source, target)

Presumably, the C code does not work with Python's multiprocessing module?

@neka-nat
Copy link
Owner

neka-nat commented May 4, 2022

Hi,
The problem is that the c wrapper object cannot be pickle when using multiprocessing.
I don't know if it will work, but the following articles and tools may help.

https://stackoverflow.com/questions/19984152/what-can-multiprocessing-and-dill-do-together
https://pathos.readthedocs.io/en/latest/pathos.html
https://joblib.readthedocs.io/en/latest/auto_examples/serialization_and_wrappers.html

@neka-nat neka-nat closed this as completed May 7, 2022
@jwindhager
Copy link
Author

Thanks a lot for the insight! I worked around the problem by spawning the worker processes instead of forking them.

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