title: Aggregating complex results from multiple processes?
body: <h2>Set Up</h2>
  <p>I have a complex set of data that I need to compare to various sets of constraints concurrently, but I'm running into multiple issues. The first issue is getting results out of my multiple processes, and the second issue is making anything beyond an extremely simple function to run concurrently</p>
  <p>Part two of this is a bit more complicated<br />
  Link to part Two: <a href="https://stackoverflow.com/questions/67084864/running-functions-with-multiple-arguments-concurrently-and-aggregating-complex-r">Click Here for Part Two</a> <br /></p>
  <h2>Example:</h2>
  <p>I have a simple function that completes an action but I can't access the results outside of the processes that are spawned in.</p>
  <h3>Functions</h3>
  <p>Because I'm using a Jupyter notebook on windows I have the functions saved in a separate file (<code>multi_process_functions.py</code>) and I'm importing that file as <code>mpf</code></p>
  <pre class="lang-py prettyprint-override"><code>def f2(name):
      return('hello ' + name)
  
  def f3(name):
      return('Bye ' + name)
  </code></pre>
  <h3>Jupyter Notebook</h3>
  <p>Then in my jupyter notebook I have the following code:</p>
  <pre class="lang-py prettyprint-override"><code>data_manager = mp.Manager()
  ns = data_manager.Namespace()
  ns.names = ['Bob', 'Joe', 'Brian']
  ns.results = []
  
  if __name__ == '__main__':
      with mp.Pool() as p:
          res = p.map(mpf.f2, ns.names)
          ns.results.append(res)
          print(res)
      with mp.Pool() as x:
          res = x.map(mpf.f3, ns.names)
          ns.results.append(res)
          print(res)
      
      print(ns.results)
  </code></pre>
  <p>The resulting output:</p>
  <blockquote>
  <p>['hello Bob', 'hello Joe', 'hello Brian'] <br />
  ['Bye Bob', 'Bye Joe', 'Bye Brian'] <br />
  [] <br /></p>
  </blockquote>
  <p>I was hoping to have the output look like this:</p>
  <blockquote>
  <p>['hello Bob', 'hello Joe', 'hello Brian'] <br />
  ['Bye Bob', 'Bye Joe', 'Bye Brian'] <br />
  [['hello Bob', 'hello Joe', 'hello Brian'], ['Bye Bob', 'Bye Joe', 'Bye Brian'] ]</p>
  </blockquote>
  <h2>Question:</h2>
  <p>How can I aggregate and access the results once all of my processes have finished?</p>