title: The program run three times when I using multiprocessing module
body: <pre><code>px = 1 + x ** 2
  cx = x ** 0
  fx = (-5 / 16) * (1 / x ** (3 / 4)) - (29 / 16) * x ** (5 / 4)
  newmann_g0 = "none"
  newmann_gl = 2.5
  dirichlet_u0 = 0
  dirichlet_ul = "none"
  
  # Deciding if it is uniform or geometric and finding the Nod Point &amp; Mesh
  length = 0.1
  num_element = int(1 / length)
  num_nod_point = num_element + 1
  degree = [3 for i in range(num_element)]
  nod_point = [0]
  for i in range(1, num_element + 1):
      nod_point += [i * length]
  h = [length for _ in range(1, num_nod_point)]
  max_degree = max(degree)
  
  # Finding the Legendre Polynomial by iteration
  legendre_poly = [1, x]
  for n in range(1, max_degree):
      legendre_poly.append(x * legendre_poly[n] * (2 * n + 1) / (n + 1) - legendre_poly[n - 1] * n / (n + 1))
  
  # Calculating the Shape Function by iteration
  shape_function = [-0.5 * x + 0.5, 0.5 * x + 0.5] + [(legendre_poly[n - 1] - legendre_poly[n - 3]) * ((1 / (2 * (2 * n - 3))) ** 0.5) for n in range(3, max_degree + 2)]
  
  # Calculating the Derivative of Shape Function
  shape_prime = [sympy.diff(y, x) for y in shape_function]
  
  # Defining Mapping Function
  mapping = []
  for i in range(0, num_nod_point - 1):
      mapping += [(1 - x) * nod_point[i] / 2 + (1 + x) * nod_point[i + 1] / 2]
  
  if __name__ == "__main__"
    q = multiprocessing.Queue()
    p1 = multiprocessing.Process(target=da_k, args=(num_element, degree, h, shape_prime, px, mapping))
    p2 = multiprocessing.Process(target=da_m, args=(num_element, degree, h, shape_function, cx, mapping))
    p3 = multiprocessing.Process(target=da_f, args=(num_element, degree, h, shape_function, fx, mapping))
    p1.start()
    p2.start()
    p3.start()
    p1.join()
    p2.join()
    p3.join()
    global_k, total_local_k = q.get()
    global_m, total_local_m = q.get()
    global_f, total_local_f = q.get()
  
    print(global_k,global_m,global_f)
  
  File "C:\Python\WinPython-64bit-3.5.1.1\python-3.5.1.amd64\lib\multiprocessing\spawn.py", line 137, in _check_not_importing_main
  is not going to be frozen to produce an executable.''')
  RuntimeError: 
      An attempt has been made to start a new process before the
      current process has finished its bootstrapping phase.
  
      This probably means that you are not using fork to start your
      child processes and you have forgotten to use the proper idiom
      in the main module:
  
          if __name__ == '__main__':
              freeze_support()
              ...
  
      The "freeze_support()" line can be omitted if the program
      is not going to be frozen to produce an executable.
  </code></pre>
  
  <p>I'm learning multiprocess module recently,and I added the multiprocess module in my code, but the program will run 3 times when I click "run", there must be something wrong of the multiprocess part,cuz the other parts works well before I adding multiprocess module. Does anyone could help me to use multi-process module correctly? Thanks very much!</p>
  
  <p>Update: I checked the multiprocess code, and it works fine, so the problem should be about the queue, thanks for your help.</p>