title: Python multiprocessing: network as dictionary of dictionaries in shared memory
body: <p>I have a network (formed using networkx) on which I would like to repeatedly perform a variant of percolation.  Since "percolating" will not alter the network in any way, I would like to use shared memory for this problem.  I tried transforming the network to a dictionary of dictionaries and using multiprocessing.Manager().dict(), but when I do so, the code is extremely slow.  My CPU usage hovers around 12%.  (I'm running this on Windows).  I am new to multiprocessing and not sure whether I've made some mistakes in the code below or whether this is an incorrect approach entirely.</p>
  
  <pre><code>import multiprocessing as mp
  import make_graph
  import networkx as nx
  
  def percolation(graph_as_dict, list_of_nodes):
      # do stuff with dictionary of dictionaries and list
  
  if __name__ == '__main__':
      graph = make_graph()
      list_of_nodes = [n for n,d in graph.nodes(data=True) if d['property'] == 0]
      graph_as_dict = nx.to_dict_of_dicts(graph)
      manager = mp.Manager()
      shared_graph = manager.dict(graph_as_dict)
      shared_list = manager.list(list_of_nodes)
      pool = mp.Pool(8)
      results = [pool.apply(percolation, args=(shared_graph,shared_list)) for i in range(100)]
  </code></pre>