IPython Parallel
IPython Parallel is the IPython API for parallel computing. We will set it up to use MPI for message passing. We may have to set environment variables as follows:
$ export LC_ALL=en_US.UTF-8 $ export LANG=en_US.UTF-8
Issue the following command at the command line:
$ ipython3 profile create --parallel --profile=mpi
The preceding command will create several files in the .ipython/profile_mpi
folder located in your home
directory.
Start a cluster that uses the MPI profile as follows:
$ ipcluster start --profile=mpi --engines=MPI --debug
The preceding command specifies that we are using the mpi
profile and MPI engine with debug-level logging. We can now interact with the cluster from an IPython notebook. Start a notebook with plotting enabled and with NumPy, SciPy, and matplotlib automatically imported, as follows:
$ jupyter-notebook --profile=mpi --log-level=DEBUG
The preceding command uses the mpi
profile with debug log level. The notebook for this example is stored in the IPythonParallel...