code: def chunker(ensemble_list, ncpu):
      
  
      # determine sublist lengths
      length = int(len(ensemble_list) / ncpu)
  
      # generator
      for i in range(0, len(ensemble_list), length):
          yield ensemble_list[i:i + length]
docs: Generate successive chunks of ensemble_list.