{"id":2936,"date":"2024-03-20T11:03:34","date_gmt":"2024-03-20T06:03:34","guid":{"rendered":"https:\/\/afzalbadshah.com\/?p=2936"},"modified":"2024-05-08T22:21:07","modified_gmt":"2024-05-08T17:21:07","slug":"running-mpi4py-on-jupyter-notebook-step-by-step-guide","status":"publish","type":"post","link":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/","title":{"rendered":"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you&#8217;re operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing the necessary components to executing MPI programs with multiple processors, each step is meticulously outlined to facilitate seamless integration and efficient utilization of MPI4py within Jupyter Notebook. <a href=\"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Access the detailed tutorial here. <\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Installing MPI on Windows<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Run Parallel Python Programs on Windows! MPI4py with Jupyter Notebook Tutorial\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/6ywG1ELIydo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Video tutorial to run mpi4py on windows<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Installing Microsoft MPI<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Download MPI Installer<\/strong>: Visit the Microsoft MPI website and download the MPI installer appropriate for your system architecture (<a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=57467\" target=\"_blank\" rel=\"noopener\" title=\"\">https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=57467<\/a>).<\/li>\n\n\n\n<li><strong>Install MPI<\/strong>: Run the downloaded installer and follow the on-screen instructions to install Microsoft MPI.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Installing Jupyter<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install Python<\/strong>: If you haven&#8217;t already, install Python on your system. You can download Python from the official website (<a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener\" title=\"\">https:\/\/www.python.org\/downloads\/<\/a>) and follow the installation instructions.<\/li>\n\n\n\n<li><strong>Install Jupyter<\/strong>: Once Python is installed, open a command prompt and run the following command to install Jupyter:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  pip install jupyter<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Configuring MPI with Jupyter<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Set MPI Environment Variables<\/strong>: After installing MPI, ensure that the MPI installation directory is added to the system PATH environment variable.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Installing MPI4py<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install MPI4py<\/strong>: Open a command prompt and run the following command to install the MPI4py package:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  pip install mpi4py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. Importing MPI4py<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Import MPI4py<\/strong>: In your Jupyter notebook, you can import MPI4py as follows:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  from mpi4py import MPI<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. Running MPI Program in Jupyter Notebook<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run MPI Program<\/strong>: Create a new Jupyter notebook or open an existing one. Then, you can write and execute MPI Python code directly in the notebook cells.<\/li>\n\n\n\n<li><strong>Example MPI Program<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  \n from mpi4py import MPI\n\n  comm = MPI.COMM_WORLD\n  rank = comm.Get_rank()\n\n  if rank == 0:\n      data = {'a': 7, 'b': 3.14}\n      comm.send(data, dest=1)\n  elif rank == 1:\n      data = comm.recv(source=0)\n      print(\"Received data on rank 1:\", data)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>7. Running MPI Program from Command Line<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Open a Command Prompt<\/strong>: Navigate to the directory where your MPI Python program is located.<\/li>\n\n\n\n<li><strong>Run MPI Program with 2 Processors<\/strong>: Use the following command to run your MPI Python program with 2 processors:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  mpiexec -n 2 python your_mpi_program.py\nOr\nmpirun -n 2 python_complete_path your_mpi_program.py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>your_mpi_program.py<\/code> with the name of your MPI Python program file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Installing MPI on Windows<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Installing MPI Implementation<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>OpenMPI Installation<\/strong>: Ubuntu typically comes with OpenMPI available in the default repositories. You can install it using the following command:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  sudo apt-get update\n  sudo apt-get install openmpi-bin libopenmpi-dev<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Installing Jupyter<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install Python and Jupyter<\/strong>: If Python is not already installed, you can install it using the following command:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  sudo apt-get install python3 python3-pip<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, install Jupyter using pip:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  sudo pip3 install jupyter<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Installing MPI4py<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Install MPI4py<\/strong>: Use pip to install the MPI4py package:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  sudo pip3 install mpi4py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>4. Importing MPI4py<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Import MPI4py<\/strong>: In your Jupyter notebook, import MPI4py as follows:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  from mpi4py import MPI<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>5. Running MPI Program in Jupyter Notebook<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run MPI Program<\/strong>: Create a new Jupyter notebook or open an existing one. Write your MPI Python code directly in the notebook cells.<\/li>\n\n\n\n<li><strong>Example MPI Program<\/strong>:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  %%px\n  from mpi4py import MPI\n\n  comm = MPI.COMM_WORLD\n  rank = comm.Get_rank()\n\n  if rank == 0:\n      data = {'a': 7, 'b': 3.14}\n      comm.send(data, dest=1)\n  elif rank == 1:\n      data = comm.recv(source=0)\n      print(\"Received data on rank 1:\", data)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>6. Running MPI Program from Command Line<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Open a Terminal<\/strong>: Navigate to the directory where your MPI Python program is located.<\/li>\n\n\n\n<li><strong>Run MPI Program with 2 Processors<\/strong>: Use the following command to run your MPI Python program with 2 processors:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  mpiexec -n 2 python3 your_mpi_program.py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>your_mpi_program.py<\/code> with the name of your MPI Python program file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Material<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/drive.google.com\/drive\/folders\/1vKaZIsBGLhzew2DKmmYfMCSrPAo4jXe-?usp=sharing\" target=\"_blank\" rel=\"noopener\" title=\"\">Download the programs (code), covering the MPI4Py.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you&#8217;re operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing the necessary components to executing MPI programs with multiple processors, each step is meticulously outlined to facilitate seamless integration and efficient utilization of MPI4py within&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3022,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[506],"tags":[540,539,474,542],"class_list":["post-2936","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mpi-with-python","tag-mpi","tag-mpi-installation","tag-parallel-computing","tag-parallel-prgramming"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you&#039;re operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Afzal Badshah, PhD\"\/>\n\t<meta name=\"google-site-verification\" content=\"B8FNGv4w1toMpU3HUnD_SN9H9YMtp1ObsLuEDuirArI\" \/>\n\t<meta name=\"p:domain_verify\" content=\"87b5ca26c36438b20581a102dc290a47\" \/>\n\t<meta name=\"yandex-verification\" content=\"0eb3e2a9157fd34d\" \/>\n\t<meta name=\"keywords\" content=\"mpi,mpi installation,parallel computing,parallel prgramming,mpi with python\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_GB\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Afzal Badshah, PhD - Unlocking Mastery in Parenting, Teaching, Learning, Academic, and Life Skills: Your Guide to Excellence\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD\" \/>\n\t\t<meta property=\"og:description\" content=\"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you&#039;re operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-03-20T06:03:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-05-08T17:21:07+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/abmanduri\/\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@DrAFZALBADSHAH\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you&#039;re operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@DrAFZALBADSHAH\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Afzal Badshah, PhD\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#blogposting\",\"name\":\"Running MPI4py on Jupyter Notebook \\u2013 Step-by-Step Guide - Afzal Badshah, PhD\",\"headline\":\"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide\",\"author\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/author\\\/afzalbadshah-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/afzalbadshah.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/MPI-Python.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720},\"datePublished\":\"2024-03-20T11:03:34+05:00\",\"dateModified\":\"2024-05-08T22:21:07+05:00\",\"inLanguage\":\"en-GB\",\"commentCount\":14,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#webpage\"},\"articleSection\":\"MPI with Python, MPI, MPI installation, parallel computing, parallel prgramming\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/afzalbadshah.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/#listItem\",\"name\":\"Courses\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/#listItem\",\"position\":2,\"name\":\"Courses\",\"item\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/mpi-with-python\\\/#listItem\",\"name\":\"MPI with Python\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/mpi-with-python\\\/#listItem\",\"position\":3,\"name\":\"MPI with Python\",\"item\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/mpi-with-python\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#listItem\",\"name\":\"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/#listItem\",\"name\":\"Courses\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#listItem\",\"position\":4,\"name\":\"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/mpi-with-python\\\/#listItem\",\"name\":\"MPI with Python\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#person\",\"name\":\"Afzal Badshah, PhD\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#personImage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/wp-content\\\/litespeed\\\/avatar\\\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1786545756\",\"width\":96,\"height\":96,\"caption\":\"Afzal Badshah, PhD\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/author\\\/afzalbadshah-com\\\/#author\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/author\\\/afzalbadshah-com\\\/\",\"name\":\"Afzal Badshah, PhD\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#authorImage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/wp-content\\\/litespeed\\\/avatar\\\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1786545756\",\"width\":96,\"height\":96,\"caption\":\"Afzal Badshah, PhD\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#webpage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/\",\"name\":\"Running MPI4py on Jupyter Notebook \\u2013 Step-by-Step Guide - Afzal Badshah, PhD\",\"description\":\"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you're operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/author\\\/afzalbadshah-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/author\\\/afzalbadshah-com\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/afzalbadshah.com\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/MPI-Python.png?fit=1280%2C720&ssl=1\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#mainImage\",\"width\":1280,\"height\":720},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/20\\\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\\\/#mainImage\"},\"datePublished\":\"2024-03-20T11:03:34+05:00\",\"dateModified\":\"2024-05-08T22:21:07+05:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#website\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/\",\"name\":\"Afzal Badshah, PhD\",\"alternateName\":\"Afzal Badshah\",\"description\":\"Unlocking Mastery in Parenting, Teaching, Learning, Academic, and Life Skills: Your Guide to Excellence\",\"inLanguage\":\"en-GB\",\"publisher\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD","description":"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you're operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing","canonical_url":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/","robots":"max-image-preview:large","keywords":"mpi,mpi installation,parallel computing,parallel prgramming,mpi with python","webmasterTools":{"google-site-verification":"B8FNGv4w1toMpU3HUnD_SN9H9YMtp1ObsLuEDuirArI","p:domain_verify":"87b5ca26c36438b20581a102dc290a47","yandex-verification":"0eb3e2a9157fd34d","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#blogposting","name":"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD","headline":"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide","author":{"@id":"https:\/\/afzalbadshah.com\/index.php\/author\/afzalbadshah-com\/#author"},"publisher":{"@id":"https:\/\/afzalbadshah.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png?fit=1280%2C720&ssl=1","width":1280,"height":720},"datePublished":"2024-03-20T11:03:34+05:00","dateModified":"2024-05-08T22:21:07+05:00","inLanguage":"en-GB","commentCount":14,"mainEntityOfPage":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#webpage"},"isPartOf":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#webpage"},"articleSection":"MPI with Python, MPI, MPI installation, parallel computing, parallel prgramming"},{"@type":"BreadcrumbList","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com#listItem","position":1,"name":"Home","item":"https:\/\/afzalbadshah.com","nextItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/#listItem","name":"Courses"}},{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/#listItem","position":2,"name":"Courses","item":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/","nextItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/#listItem","name":"MPI with Python"},"previousItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/#listItem","position":3,"name":"MPI with Python","item":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/","nextItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#listItem","name":"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide"},"previousItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/#listItem","name":"Courses"}},{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#listItem","position":4,"name":"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide","previousItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/#listItem","name":"MPI with Python"}}]},{"@type":"Person","@id":"https:\/\/afzalbadshah.com\/#person","name":"Afzal Badshah, PhD","image":{"@type":"ImageObject","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#personImage","url":"https:\/\/afzalbadshah.com\/wp-content\/litespeed\/avatar\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1786545756","width":96,"height":96,"caption":"Afzal Badshah, PhD"}},{"@type":"Person","@id":"https:\/\/afzalbadshah.com\/index.php\/author\/afzalbadshah-com\/#author","url":"https:\/\/afzalbadshah.com\/index.php\/author\/afzalbadshah-com\/","name":"Afzal Badshah, PhD","image":{"@type":"ImageObject","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#authorImage","url":"https:\/\/afzalbadshah.com\/wp-content\/litespeed\/avatar\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1786545756","width":96,"height":96,"caption":"Afzal Badshah, PhD"}},{"@type":"WebPage","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#webpage","url":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/","name":"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD","description":"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you're operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing","inLanguage":"en-GB","isPartOf":{"@id":"https:\/\/afzalbadshah.com\/#website"},"breadcrumb":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#breadcrumblist"},"author":{"@id":"https:\/\/afzalbadshah.com\/index.php\/author\/afzalbadshah-com\/#author"},"creator":{"@id":"https:\/\/afzalbadshah.com\/index.php\/author\/afzalbadshah-com\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png?fit=1280%2C720&ssl=1","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#mainImage","width":1280,"height":720},"primaryImageOfPage":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/#mainImage"},"datePublished":"2024-03-20T11:03:34+05:00","dateModified":"2024-05-08T22:21:07+05:00"},{"@type":"WebSite","@id":"https:\/\/afzalbadshah.com\/#website","url":"https:\/\/afzalbadshah.com\/","name":"Afzal Badshah, PhD","alternateName":"Afzal Badshah","description":"Unlocking Mastery in Parenting, Teaching, Learning, Academic, and Life Skills: Your Guide to Excellence","inLanguage":"en-GB","publisher":{"@id":"https:\/\/afzalbadshah.com\/#person"}}]},"og:locale":"en_GB","og:site_name":"Afzal Badshah, PhD - Unlocking Mastery in Parenting, Teaching, Learning, Academic, and Life Skills: Your Guide to Excellence","og:type":"article","og:title":"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD","og:description":"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you're operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing","og:url":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/","og:image":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png","og:image:secure_url":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png","og:image:width":1280,"og:image:height":720,"article:published_time":"2024-03-20T06:03:34+00:00","article:modified_time":"2024-05-08T17:21:07+00:00","article:publisher":"https:\/\/web.facebook.com\/abmanduri\/","twitter:card":"summary_large_image","twitter:site":"@DrAFZALBADSHAH","twitter:title":"Running MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide - Afzal Badshah, PhD","twitter:description":"Running MPI4py on Jupyter Notebook enables parallel computing within an interactive and user-friendly environment. This guide provides a step-by-step approach to setting up and executing MPI (Message Passing Interface) Python programs using MPI4py library in a Jupyter Notebook. Whether you're operating on Windows or Ubuntu, this tutorial caters to users on both platforms. From installing","twitter:creator":"@DrAFZALBADSHAH","twitter:image":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png","twitter:label1":"Written by","twitter:data1":"Afzal Badshah, PhD","twitter:label2":"Est. reading time","twitter:data2":"3 minutes"},"aioseo_meta_data":{"post_id":"2936","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-03-20 03:22:07","updated":"2025-06-10 22:07:26","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/afzalbadshah.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/\" title=\"Courses\">Courses<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/\" title=\"MPI with Python\">MPI with Python<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRunning MPI4py on Jupyter Notebook \u2013 Step-by-Step Guide\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/afzalbadshah.com"},{"label":"Courses","link":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/"},{"label":"MPI with Python","link":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/"},{"label":"Running MPI4py on Jupyter Notebook &#8211; Step-by-Step Guide","link":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/20\/running-mpi4py-on-jupyter-notebook-step-by-step-guide\/"}],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python.png?fit=1280%2C720&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pf3emP-Lm","jetpack-related-posts":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/2936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/comments?post=2936"}],"version-history":[{"count":6,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/2936\/revisions"}],"predecessor-version":[{"id":3208,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/2936\/revisions\/3208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media\/3022"}],"wp:attachment":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media?parent=2936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/categories?post=2936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/tags?post=2936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}