<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 IPython.parallel
To start the cluster, you can use notebook GUI or command line $ipcluster start
Step1:  Check a number of cores
Step2:  Simple parallel summation
First the input array is initialized and distributed over the cluster
Step3:  Parallel sum
Engines computes sumation of each subset and send back to the controller
<ASSISTANT_TASK:>
Python Code:
from IPython import parallel
c=parallel.Client()
dview=c.direct_view()
dview.block=True
Explanation: IPython.parallel
To start the cluster, you can use notebook GUI or command line $ipcluster start
End of explanation
c.ids
Explanation: Check a number of cores
End of explanation
import numpy as np
x=np.arange(100)
dview.scatter('x',x)
print c[0]['x']
print c[1]['x']
print c[-1]['x']
Explanation: Simple parallel summation
First the input array is initialized and distributed over the cluster
End of explanation
dview.execute('import numpy as np; y=np.sum(x)')
ys=dview.gather('y')
total=np.sum(ys)
print total
Explanation: Parallel sum
Engines computes sumation of each subset and send back to the controller
End of explanation
<END_TASK>