brainpy.running.process_pool#

brainpy.running.process_pool(func, all_params, num_process)[source]#

Run multiple models in multi-processes.

Note

This multiprocessing function should be called within a if __main__ == ‘__main__’: syntax.

Parameters:
  • func (callable) – The function to run model.

  • all_params (list, tuple, dict) – The parameters of the function arguments. The parameters for each process can be a tuple, or a dictionary.

  • num_process (int) – The number of the processes.

Returns:

results – Process results.

Return type:

list