To use Bodo with Jupyter Notebook, install jupyter, ipyparallel, and 'mpi4py':
Create an MPI profile for ipython:
Edit the ~/.ipython/profile_mpi/ipython_config.py file and add the following line:
Start the Jupyter notebook and go to IPython Clusters tab. Select the number of engines (i.e., cores) you'd like to use and click Start next to the mpi profile. Alternatively, you can use ipcluster start -n 4 --profile=mpi in a terminal to start the engines (this can take several seconds).
Now start a new notebook and run this code in a cell to setup the environment:
You can now run Bodo functions on the execution engines using ipyparallel hooks such as %px magic and the work will be distributed across the engines. For example, run this code in a cell:
If you wish to run across multiple nodes, you can add the following to `ipcluster_config.py`:
machinefile (or hostfile) is a file with the hostnames of available nodes that MPI can use. More information about machinefiles can be found here.