{"id":2955,"date":"2024-06-24T12:58:50","date_gmt":"2024-06-24T07:58:50","guid":{"rendered":"https:\/\/afzalbadshah.com\/?p=2955"},"modified":"2024-06-24T12:58:56","modified_gmt":"2024-06-24T07:58:56","slug":"introduction-to-scatter-operation-in-mpi","status":"publish","type":"post","link":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/","title":{"rendered":"Introduction to Scatter Operation in MPI"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process receives one chunk of the data, allowing for parallel processing on different subsets of the data.<\/p>\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=\"MPI (MPI4PY) on Jupyter Tutorial\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/videoseries?list=PLGiqyN7d0mypGRrq2Bv9mXLGoeZPXTcZA\" 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><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from mpi4py import MPI  # Import MPI module from mpi4py library\n\ncomm = MPI.COMM_WORLD  # Initialize MPI communicator\nsize = comm.Get_size()  # Get the size of the communicator (total number of processes)\nrank = comm.Get_rank()  # Get the rank of the current process\n\nprint(\"Total number of processes:\", size)  # Print the total number of processes\nprint(\"Rank of current process:\", rank)  # Print the rank of the current process\n\nif rank == 0:  # Check if the current process is the root process (rank 0)\n    data = &#91;(i+1)**2 for i in range(size)]  # Generate data to be scattered by root process\n    print(\"Data generated by root process:\", data)  # Print the generated data by root process\nelse:  # For non-root processes\n    data = None  # Set data to None\n\ndata = comm.scatter(data, root=0)  # Scatter data from root process to all other processes\nprint(\"Process\", rank, \"received data:\", data)  # Print the data received by the current process\n\nassert data == (rank+1)**2  # Verify correctness of received data\nprint(\"Data verification successful for process\", rank)  # Print success message if data verification passes<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from mpi4py import MPI  # Import MPI module from mpi4py library<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Import the MPI module from the mpi4py library, which provides MPI functionality for Python programs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>comm = MPI.COMM_WORLD  # Initialize MPI communicator<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Initialize the MPI communicator <code>comm<\/code> using <code>MPI.COMM_WORLD<\/code>, representing the group of processes involved in communication.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>size = comm.Get_size()  # Get the size of the communicator (total number of processes)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Retrieve the total number of processes in the communicator and store it in the variable <code>size<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rank = comm.Get_rank()  # Get the rank of the current process<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Retrieve the rank of the current process within the communicator and store it in the variable <code>rank<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"Total number of processes:\", size)  # Print the total number of processes\nprint(\"Rank of current process:\", rank)  # Print the rank of the current process<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Print the total number of processes and the rank of the current process.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if rank == 0:  # Check if the current process is the root process (rank 0)\n    data = &#91;(i+1)**2 for i in range(size)]  # Generate data to be scattered by root process\n    print(\"Data generated by root process:\", data)  # Print the generated data by root process\nelse:  # For non-root processes\n    data = None  # Set data to None<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the current process is the root process (rank 0), generate data to be scattered. Otherwise, set data to None.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data = comm.scatter(data, root=0)  # Scatter data from root process to all other processes<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Scatter the data from the root process (rank 0) to all other processes in the communicator. Each process receives one chunk of the data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(\"Process\", rank, \"received data:\", data)  # Print the data received by the current process<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Print the data received by the current process after the scatter operation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>assert data == (rank+1)**2  # Verify correctness of received data\nprint(\"Data verification successful for process\", rank)  # Print success message if data verification passes<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Verify the correctness of the received data by checking if each element of the received data is equal to the square of the rank of the respective process. If the assertion passes, print a success message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/afzalbadshah.com\/index.php\/category\/courses\/mpi-with-python\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Visit the detailed tutorial here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process receives one chunk of the data, allowing for parallel processing on different subsets of the data. Code: Explanation: Import the MPI module from the mpi4py&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3597,"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":[],"class_list":["post-2955","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mpi-with-python"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process\" \/>\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 with python\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-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=\"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD\" \/>\n\t\t<meta property=\"og:description\" content=\"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.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-06-24T07:58:50+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-06-24T07:58:56+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=\"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@DrAFZALBADSHAH\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.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\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#blogposting\",\"name\":\"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD\",\"headline\":\"Introduction to Scatter Operation 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\\\/06\\\/MPI-Python-2.png?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720},\"datePublished\":\"2024-06-24T12:58:50+05:00\",\"dateModified\":\"2024-06-24T12:58:56+05:00\",\"inLanguage\":\"en-GB\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#webpage\"},\"articleSection\":\"MPI with Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-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\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#listItem\",\"name\":\"Introduction to Scatter Operation 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\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#listItem\",\"position\":4,\"name\":\"Introduction to Scatter Operation 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\\\/06\\\/24\\\/introduction-to-scatter-operation-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\\\/06\\\/24\\\/introduction-to-scatter-operation-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\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#webpage\",\"url\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/\",\"name\":\"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD\",\"description\":\"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-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\\\/06\\\/MPI-Python-2.png?fit=1280%2C720&ssl=1\",\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#mainImage\",\"width\":1280,\"height\":720},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/afzalbadshah.com\\\/index.php\\\/2024\\\/06\\\/24\\\/introduction-to-scatter-operation-in-mpi\\\/#mainImage\"},\"datePublished\":\"2024-06-24T12:58:50+05:00\",\"dateModified\":\"2024-06-24T12:58:56+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":"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD","description":"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process","canonical_url":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/","robots":"max-image-preview:large","keywords":"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\/06\/24\/introduction-to-scatter-operation-in-mpi\/#blogposting","name":"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD","headline":"Introduction to Scatter Operation 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\/06\/MPI-Python-2.png?fit=1280%2C720&ssl=1","width":1280,"height":720},"datePublished":"2024-06-24T12:58:50+05:00","dateModified":"2024-06-24T12:58:56+05:00","inLanguage":"en-GB","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/#webpage"},"isPartOf":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/#webpage"},"articleSection":"MPI with Python"},{"@type":"BreadcrumbList","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-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\/06\/24\/introduction-to-scatter-operation-in-mpi\/#listItem","name":"Introduction to Scatter Operation 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\/06\/24\/introduction-to-scatter-operation-in-mpi\/#listItem","position":4,"name":"Introduction to Scatter Operation 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\/06\/24\/introduction-to-scatter-operation-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\/06\/24\/introduction-to-scatter-operation-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\/06\/24\/introduction-to-scatter-operation-in-mpi\/#webpage","url":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/","name":"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD","description":"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process","inLanguage":"en-GB","isPartOf":{"@id":"https:\/\/afzalbadshah.com\/#website"},"breadcrumb":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-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\/06\/MPI-Python-2.png?fit=1280%2C720&ssl=1","@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/#mainImage","width":1280,"height":720},"primaryImageOfPage":{"@id":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/#mainImage"},"datePublished":"2024-06-24T12:58:50+05:00","dateModified":"2024-06-24T12:58:56+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":"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD","og:description":"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process","og:url":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/","og:image":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.png","og:image:secure_url":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.png","og:image:width":1280,"og:image:height":720,"article:published_time":"2024-06-24T07:58:50+00:00","article:modified_time":"2024-06-24T07:58:56+00:00","article:publisher":"https:\/\/web.facebook.com\/abmanduri\/","twitter:card":"summary_large_image","twitter:site":"@DrAFZALBADSHAH","twitter:title":"Introduction to Scatter Operation in MPI - Afzal Badshah, PhD","twitter:description":"In MPI (Message Passing Interface) programming, the scatter operation is a collective communication pattern used to distribute data from one process to multiple processes. It takes an array or list of data on the root process and divides it into smaller chunks, then scatters these chunks to all other processes in the communicator. Each process","twitter:creator":"@DrAFZALBADSHAH","twitter:image":"https:\/\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.png","twitter:label1":"Written by","twitter:data1":"Afzal Badshah, PhD","twitter:label2":"Est. reading time","twitter:data2":"3 minutes"},"aioseo_meta_data":{"post_id":"2955","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"MPI","score":82,"analysis":{"keyphraseInTitle":{"score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"score":9,"maxScore":9,"error":0},"keyphraseLength":{"score":9,"maxScore":9,"error":0,"length":1},"keyphraseInURL":{"score":5,"maxScore":5,"error":0},"keyphraseInIntroduction":{"score":9,"maxScore":9,"error":0},"keyphraseInSubHeadings":[],"keyphraseInImageAlt":[],"keywordDensity":{"type":"high","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 06:21:56","updated":"2025-06-10 22:10:03","focus_keyword":"MPI","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\tIntroduction to Scatter Operation 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":"Introduction to Scatter Operation in MPI","link":"https:\/\/afzalbadshah.com\/index.php\/2024\/06\/24\/introduction-to-scatter-operation-in-mpi\/"}],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/afzalbadshah.com\/wp-content\/uploads\/2024\/06\/MPI-Python-2.png?fit=1280%2C720&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pf3emP-LF","jetpack-related-posts":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/2955","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=2955"}],"version-history":[{"count":3,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/2955\/revisions"}],"predecessor-version":[{"id":3598,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/posts\/2955\/revisions\/3598"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media\/3597"}],"wp:attachment":[{"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/media?parent=2955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/categories?post=2955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afzalbadshah.com\/index.php\/wp-json\/wp\/v2\/tags?post=2955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}