IPython's power is not limited to its advanced shell. Its parallel
package includes a framework to setup and run calculations on single and multi-core machines, as well as on multiple nodes connected to a network. IPython is great because it gives an interactive twist to parallel computing and provides a common interface to different communication protocols.
To use IPython.parallel
, you have to start a set of workers—
Engines—that are managed by a
Controller (an entity that mediates the communication between the client and the engines). The approach is totally different from multiprocessing; you start the worker processes separately, and they will wait indefinitely, listening for commands from the client.
To start the controller and a set of engines (by default, one engine per processing unit) you can use the ipcluster
shell command, as follows:
$ ipcluster start
With ipcluster
you can also set up multiple nodes to distribute your calculations over a network by writing a...