Tutorial

division_of_parameter_array.py

Code:

import numpy as np
import guan

cpus = 4
parameter_array_all = np.arange(0, 17, 1) 
for task_index in range(cpus):
    parameter_array = guan.preprocess_for_parallel_calculations(parameter_array_all, cpus, task_index)
    print(parameter_array)
    print()

Result:

[0 1 2 3 4]

[5 6 7 8 9]

[10 11 12 13 14]

[15 16]