Skip to content

pyFAI azimuthal integration hangs up in multiprocessing mode #2181

Answered by kif
aleonau asked this question in Q&A
Discussion options

You must be logged in to vote

I found an issue with your code: apparently, the serialization of the function check_center_all_in(X, Y) does not play nicely with jupyter notebook.
The default serializer, pickle, is known to be safe but picky about user supplied functions. dill is an alternative, much more powerful but be careful: with power comes responsibilities.
I also replaced the Pool from multiprocessing with an alternative from mpire. Other exist like joblib, dask, ... I let you explore the one that best fits your needs. The WorkerPool allows to tune the start_method among threading, fork, forkserver and spawn. Threading works with pickle, all other require dill. fork crashes after a while but this a known side e…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by aleonau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
doc Related to documentation
2 participants
Converted from issue

This discussion was converted from issue #2120 on May 28, 2024 15:42.