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

Multiprocessing fails due to Convenience class pickling error #17

Open
skyghdus opened this issue Sep 26, 2024 · 1 comment
Open

Multiprocessing fails due to Convenience class pickling error #17

skyghdus opened this issue Sep 26, 2024 · 1 comment

Comments

@skyghdus
Copy link

Hello,

I'm trying to use skimpy for parallel processing (via Python's multiprocessing module) to speed up simulations. However, I am encountering a PicklingError related to the Convenience class when I attempt to parallelize my simulations.

The error I get is:
_pickle.PicklingError: Can't pickle <skimpy.mechanisms.convenience.make_convenience..Convenience object>

It seems that because the Convenience class is dynamically generated within the make_convenience function, Python's multiprocessing module is unable to serialize it for passing between processes. This prevents me from utilizing multiprocessing to parallelize my computations.

I understand that the dynamic class generation provides flexibility for different reaction mechanisms, but it causes issues with multiprocessing due to the pickling requirement.

Do you have any suggestions or workarounds for how to use skimpy in a parallel processing context?

@weilandtd
Copy link
Contributor

Hi,

I see that is an interesting problem, and I like to fix that. Can you tell me a bit more how you are sending the object to python multiprocessing. Like are you just sending the object? Or you trying to load it? I would need a bit more context to help you.

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