title: Numba jitclass with multiprocessing
body: <p>I'm trying to use multiprocessing to speed up the performance of my code as well as using numba jitclass. There's jitclass instance contained in the jitted function, and this function is the target of the multiprocessing pool.
  When I run the code, I got this error messages:</p>
  
  <pre><code>cPickle.PicklingError: Can't pickle &lt;class 'numba.jitclass.boxing.MyClass'&gt;: attribute lookup numba.jitclass.boxing.MyClass failed
  </code></pre>
  
  <p>I tried to run the code in python3, which also had the same issue:</p>
  
  <pre><code>_pickle.PicklingError: Can't pickle &lt;class 'numba.jitclass.boxing.MyClass'&gt;: attribute lookup numba.jitclass.boxing.MyClass failed
  </code></pre>
  
  <p>I even tried "pathos.multiprocessing" or "multiprocessing_on_dill" modules instead of the original "multiprocessing" module, neither of them worked.
  How can I handle this problem? Thanks in advance.</p>
  
  <p>Following is my test code.</p>
  
  <pre><code>import numba as nb
  from scipy.integrate import odeint
  import multiprocessing as mp
  
  @nb.jit(nopython=True)
  def odeSystem(x, t, a):
      v = a.func(x, t)
      return 1-x+v
  
  @nb.jitclass([])
  class B(object):
      def __init__(self):
          pass
  
  spec = [("b", B.class_type.instance_type),("c", nb.f8)]
  @nb.jitclass(spec)
  class A(object):
      def __init__(self, b, c):
          self.b = b
          self.c = c
  
      def func(self, x, t):
          return 0
  
  def odeSolve(x, t, a):
      sol = odeint(odeSystem, x, t, args=(a,))
      return sol
  
  if __name__ == "__main__":
      a = A(B(), 3)
  
      from functools import partial
      initialx = range(10)
      ode = partial(odeSolve, t=range(0, 10), a=a)
      nProcess = 1
      pool = mp.Pool(nProcess)
      sol = pool.map(ode, initialx)
      print sol
  </code></pre>
  
  <p>If I run this, I got an error msg:</p>
  
  <pre><code>cPickle.PicklingError: Can't pickle &lt;class 'numba.jitclass.boxing.A'&gt;: attribute lookup numba.jitclass.boxing.A failed
  </code></pre>