I have the following code:
a=[3.5,7.6,8.6,1.3]
y=[0,0,0,0]
x=12
for i in range (4):
y[i]=x**2*a[i]
print(y[0],a[0])
print(y[1],a[1])
print(y[2],a[2])
print(y[3],a[3])
I have a multi-core processor and I would like to distribute the calculations of the equation y[i]=x**2*a[i]
for each parameter a[i]
to a separate processor.
How to do parallel calculations for this example in Python?
I can easily do it in the Wolfram Mathematica using ParallTable, but I don't know how to do it in Python.