Skip to content

Conversation

@gertjanvanzwieten
Copy link
Contributor

parallelize Topology.trim

With `parallel.fork` data cannot be shared between processes using shared
memory, except for arrays. `multiprocessing.Manager` supports sharing data via
pipes or sockets using pickle as serialization. This patch adds a minimal subset of
`multiprocessing.Manager` to `parallel`, supporting shared lists and dicts. If
parallel mode is disabled, a fake manager is returned which creates regular
lists and dicts, eliminating overhead of serialization, transfering and
deserialization.
`Topology.trim` can be quite slow if the levelset is expensive and maxrefine is large.
Although the work is embarrassingly parallel, this was not exploited,
because we can't make a shared memory array of element.Reference objects. With
the newly added `parallel.Manager` we have an alternative way of sharing data
between processes: using pickle and pipes. This patch adds support for parallel
trimming using the `parallel.Manager.list`.
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

Successfully merging this pull request may close these issues.

3 participants