Skip to content

Multiprocessing fails due to Convenience class pickling error #17

@skyghdus

Description

@skyghdus

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions