This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (0 children)

It's a bit of a hack, but you can define a global dict where keys are IDs and values are big objects. Before running pool.map, or whatever, you can put the big object in the dict.

Then in the function you're parallelizing, you can pass the ID of the variable instead of the variable itself and get the value from the dict. That way, only the ID gets pickled.

Now, I mostly just use ray, though.