code: def __det_hsml_old(self, pos, nb):
          
          manager = Manager()
          out_hsml  = manager.Queue()
          size  = multiprocessing.cpu_count()	
  
          if self.__verbose:
              print('Building a KDTree...')
          tree = self.__make_kdtree(pos)
  
          index  = np.arange(np.shape(pos)[1])
  		#I split the job among the number of available processors
          pos   = np.array_split(pos, size, axis=1)	
          
          procs = []
  
          #We distribute the tasks among different processes
          if self.__verbose:
                  print('Searching the ', nb,
                        'closer neighbors to each particle...')
          for rank in range(size):
              task = multiprocessing.Process(target=self.__nbsearch, 
                                             args=(pos[rank], nb, tree, 
                                                   out_hsml,rank))
              procs.append(task) 
              task.start()
              
              #Wait until all processes finish
          for p in procs:
              p.join()
  
              index = []
              hsml  = []
          for i in range(size):
              a, b = out_hsml.get()
              index.append(a)
              hsml.append(b)
      #	    if a == 0: print(b[0])
  
              #I have to order the data before return it
          k = np.argsort(index)
          hsml1 = np.array([])
          for i in k:
              hsml1 = np.append(hsml1,hsml[i])
          if self.__verbose:
              print('Done...')
          return hsml1
docs: Use this function to find the smoothing lengths of the particles.
          hsml = det_hsml(pos, nb)