{"id":3016,"date":"2024-03-27T15:46:40","date_gmt":"2024-03-27T10:46:40","guid":{"rendered":"https:\/\/afzalbadshah.com\/?p=3016"},"modified":"2024-05-13T16:01:46","modified_gmt":"2024-05-13T11:01:46","slug":"blocking-and-non-blocking-communication-in-mpi","status":"publish","type":"post","link":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/","title":{"rendered":"Blocking and Non-blocking Communication in MPI"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. <a href=\"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/\" target=\"_blank\" rel=\"noopener\" title=\"\">You can visit the detailed tutorial on MPI with Python here. <\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Blocking Communication<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Blocking communication involves processes halting their execution until the communication operation is complete. In MPI, blocking communication functions like <code>comm.send()<\/code> and <code>comm.recv()<\/code> ensure that the sender waits until the receiver receives the message, and vice versa. Blocking communication is often used when processes need to synchronize their execution or when the sender and receiver must coordinate closely. While blocking communication simplifies program logic and synchronization, it can lead to potential performance bottlenecks if processes spend significant time waiting for communication to complete. Let&#8217;s see the below code;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from mpi4py import MPI\ncomm = MPI.COMM_WORLD\nrank = comm.Get_rank()\nif rank == 0:\n    data = {'a': 7, 'b': 3.14}\n    comm.send(data, dest=1, tag=11)\nelif rank == 1:\n    data = comm.recv(source=0, tag=11)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Explanation<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Import MPI:<\/strong> The code begins by importing the MPI module from mpi4py library, which provides MPI functionalities for Python programs.<\/li>\n\n\n\n<li><strong>Initialize MPI Communicator:<\/strong> The code initializes the MPI communicator <code>comm<\/code> representing all processes participating in the computation.<\/li>\n\n\n\n<li><strong>Get Rank:<\/strong> Each process in the communicator obtains its rank using <code>comm.Get_rank()<\/code> to determine its identity in the communicator.<\/li>\n\n\n\n<li><strong>Conditional Execution:<\/strong> Depending on the rank of the process:\n<ul class=\"wp-block-list\">\n<li>If the rank is 0:\n<ul class=\"wp-block-list\">\n<li>Create a Python dictionary <code>data<\/code> containing some sample data.<\/li>\n\n\n\n<li>Use <code>comm.send()<\/code> to send the data to process 1 (<code>dest=1<\/code>) with a specified tag (<code>tag=11<\/code>).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>If the rank is 1:\n<ul class=\"wp-block-list\">\n<li>Use <code>comm.recv()<\/code> to receive data from process 0 (<code>source=0<\/code>) with the specified tag (<code>tag=11<\/code>). The received data is stored in the <code>data<\/code> variable.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Blocking Communication:<\/strong> Both <code>comm.send()<\/code> and <code>comm.recv()<\/code> are blocking operations. This means that the sender (<code>comm.send()<\/code>) will be blocked until the receiver (<code>comm.recv()<\/code>) receives the message, and vice versa.<\/li>\n\n\n\n<li><strong>Data Transfer:<\/strong> In this program, the dictionary <code>data<\/code> is sent from process 0 to process 1 using blocking communication. Process 1 waits to receive the data sent by process 0 before continuing its execution.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Non-blocking Communication<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Non-blocking communication, on the other hand, allows processes to continue their execution immediately after initiating communication operations, without waiting for the operations to complete. In MPI, non-blocking communication functions like <code>comm.isend()<\/code> and <code>comm.irecv()<\/code> return a request object immediately, enabling processes to overlap computation with communication. Non-blocking communication is particularly useful in scenarios where processes can perform useful work while waiting for communication to progress. By overlapping computation with communication, non-blocking communication can improve overall performance and scalability in parallel applications. Let&#8217;s see the below code;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from mpi4py import MPI\ncomm = MPI.COMM_WORLD\nrank = comm.Get_rank()\nif rank == 0:\n    data = {'a': 7, 'b': 3.14}\n    req = comm.isend(data, dest=1, tag=11)\n    req.wait()\nelif rank == 1:\n    req = comm.irecv(source=0, tag=11)\n    data = req.wait()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Explanation<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Import MPI:<\/strong> Similar to the blocking communication program, this code starts by importing the MPI module from mpi4py library.<\/li>\n\n\n\n<li><strong>Initialize MPI Communicator and Get Rank:<\/strong> The MPI communicator <code>comm<\/code> is initialized, and the rank of the process is obtained using <code>comm.Get_rank()<\/code>.<\/li>\n\n\n\n<li><strong>Conditional Execution:<\/strong> Depending on the rank of the process:\n<ul class=\"wp-block-list\">\n<li>If the rank is 0:\n<ul class=\"wp-block-list\">\n<li>Create a Python dictionary <code>data<\/code> containing some sample data.<\/li>\n\n\n\n<li>Use <code>comm.isend()<\/code> to initiate the non-blocking sending of the data to process 1 (<code>dest=1<\/code>) with a specified tag (<code>tag=11<\/code>). The request object <code>req<\/code> is returned.<\/li>\n\n\n\n<li>Wait for the completion of the send operation using <code>req.wait()<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>If the rank is 1:\n<ul class=\"wp-block-list\">\n<li>Use <code>comm.irecv()<\/code> to initiate the non-blocking receiving of data from process 0 (<code>source=0<\/code>) with the specified tag (<code>tag=11<\/code>). The request object <code>req<\/code> is returned.<\/li>\n\n\n\n<li>Wait for the completion of the receive operation using <code>req.wait()<\/code>. The received data is stored in the <code>data<\/code> variable.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Non-blocking Communication:<\/strong> In contrast to blocking communication, non-blocking communication operations (<code>comm.isend()<\/code> and <code>comm.irecv()<\/code>) do not block the execution of the process. Instead, they return a request object immediately, allowing the process to perform other tasks while the communication operation progresses asynchronously.<\/li>\n\n\n\n<li><strong>Data Transfer:<\/strong> Similarly, the dictionary <code>data<\/code> is sent from process 0 to process 1, but this time using non-blocking communication. Process 1 initiates the receive operation and waits for the data to be received asynchronously.<\/li>\n<\/ul>\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>In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation is complete. In MPI, blocking communication functions like comm.send() and comm.recv() ensure that the sender waits until the receiver receives the message, and vice versa&#8230;.<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3025,"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":[550,49,540,551,474],"class_list":["post-3016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mpi-with-python","tag-blocking","tag-communication","tag-mpi","tag-non-bloking","tag-parallel-computing"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation\" \/>\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=\"blocking,communication,mpi,non-bloking,parallel computing,mpi with python\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/\" \/>\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=\"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD\" \/>\n\t\t<meta property=\"og:description\" content=\"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python-1.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python-1.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-27T10:46:40+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-05-13T11:01:46+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=\"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation\" \/>\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-1.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=\"4 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\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#blogposting\",\"name\":\"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD\",\"headline\":\"Blocking and Non-blocking Communication in MPI\",\"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-1.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720},\"datePublished\":\"2024-03-27T15:46:40+05:00\",\"dateModified\":\"2024-05-13T16:01:46+05:00\",\"inLanguage\":\"en-GB\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#webpage\"},\"articleSection\":\"MPI with Python, Blocking, Communication, MPI, Non-bloking, parallel computing\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#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\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#listItem\",\"name\":\"Blocking and Non-blocking Communication in MPI\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/category\\\/courses\\\/#listItem\",\"name\":\"Courses\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#listItem\",\"position\":4,\"name\":\"Blocking and Non-blocking Communication in MPI\",\"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\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#personImage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/wp-content\\\/litespeed\\\/avatar\\\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1787150587\",\"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\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#authorImage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/wp-content\\\/litespeed\\\/avatar\\\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1787150587\",\"width\":96,\"height\":96,\"caption\":\"Afzal Badshah, PhD\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#webpage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/\",\"name\":\"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD\",\"description\":\"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#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-1.png?fit=1280%2C720&ssl=1\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#mainImage\",\"width\":1280,\"height\":720},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/03\\\/27\\\/blocking-and-non-blocking-communication-in-mpi\\\/#mainImage\"},\"datePublished\":\"2024-03-27T15:46:40+05:00\",\"dateModified\":\"2024-05-13T16:01:46+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":"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD","description":"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation","canonical_url":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/","robots":"max-image-preview:large","keywords":"blocking,communication,mpi,non-bloking,parallel computing,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\/27\/blocking-and-non-blocking-communication-in-mpi\/#blogposting","name":"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD","headline":"Blocking and Non-blocking Communication in MPI","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-1.png?fit=1280%2C720&ssl=1","width":1280,"height":720},"datePublished":"2024-03-27T15:46:40+05:00","dateModified":"2024-05-13T16:01:46+05:00","inLanguage":"en-GB","mainEntityOfPage":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#webpage"},"isPartOf":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#webpage"},"articleSection":"MPI with Python, Blocking, Communication, MPI, Non-bloking, parallel computing"},{"@type":"BreadcrumbList","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#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\/27\/blocking-and-non-blocking-communication-in-mpi\/#listItem","name":"Blocking and Non-blocking Communication in MPI"},"previousItem":{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/#listItem","name":"Courses"}},{"@type":"ListItem","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#listItem","position":4,"name":"Blocking and Non-blocking Communication in MPI","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\/27\/blocking-and-non-blocking-communication-in-mpi\/#personImage","url":"https:\/\/afzalbadshah.com\/wp-content\/litespeed\/avatar\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1787150587","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\/27\/blocking-and-non-blocking-communication-in-mpi\/#authorImage","url":"https:\/\/afzalbadshah.com\/wp-content\/litespeed\/avatar\/27d3d5e33aa81b3152e368c66871f22f.jpg?ver=1787150587","width":96,"height":96,"caption":"Afzal Badshah, PhD"}},{"@type":"WebPage","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#webpage","url":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/","name":"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD","description":"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation","inLanguage":"en-GB","isPartOf":{"@id":"https:\/\/afzalbadshah.com\/#website"},"breadcrumb":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#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-1.png?fit=1280%2C720&ssl=1","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#mainImage","width":1280,"height":720},"primaryImageOfPage":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/#mainImage"},"datePublished":"2024-03-27T15:46:40+05:00","dateModified":"2024-05-13T16:01:46+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":"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD","og:description":"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation","og:url":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/","og:image":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python-1.png","og:image:secure_url":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python-1.png","og:image:width":1280,"og:image:height":720,"article:published_time":"2024-03-27T10:46:40+00:00","article:modified_time":"2024-05-13T11:01:46+00:00","article:publisher":"https:\/\/web.facebook.com\/abmanduri\/","twitter:card":"summary_large_image","twitter:site":"@DrAFZALBADSHAH","twitter:title":"Blocking and Non-blocking Communication in MPI - Afzal Badshah, PhD","twitter:description":"In parallel computing with MPI (Message Passing Interface), communication between processes plays a crucial role in achieving efficient parallelization of algorithms. Two common approaches to communication are blocking and non-blocking communication. You can visit the detailed tutorial on MPI with Python here. Blocking Communication Blocking communication involves processes halting their execution until the communication operation","twitter:creator":"@DrAFZALBADSHAH","twitter:image":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python-1.png","twitter:label1":"Written by","twitter:data1":"Afzal Badshah, PhD","twitter:label2":"Est. reading time","twitter:data2":"4 minutes"},"aioseo_meta_data":{"post_id":"3016","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-27 07:51:42","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\tBlocking and Non-blocking Communication in MPI\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":"Blocking and Non-blocking Communication in MPI","link":"https:\/\/afzalbadshah.com\/index.php\/2024\/03\/27\/blocking-and-non-blocking-communication-in-mpi\/"}],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2024\/03\/MPI-Python-1.png?fit=1280%2C720&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pf3emP-ME","jetpack-related-posts":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/3016","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=3016"}],"version-history":[{"count":5,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/3016\/revisions"}],"predecessor-version":[{"id":3423,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/3016\/revisions\/3423"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media\/3025"}],"wp:attachment":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media?parent=3016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/categories?post=3016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/tags?post=3016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}