Broadcasting with bcast tutorial - Supercomputing and Parallel Programming in Python and MPI 8
Key Takeaways
Explains the broadcasting functionality using MPI4PY in Supercomputing and Parallel Programming in Python and MPI 8
Full Transcript
hello everybody and welcome to another MP4 Pi programming tutorial video for parallel programming high performance Computing and supercomputing in this video what we're going to be discussing is broadcast so the idea of broadcast is so you just have to enter it one time and the object variable whatever is broadcast to all of the nodes so here's a quick example of how that works as usual from NPI 4 Pi we're going to import NPI com equals NPI doc oops np. comore World we're going to be using rank as well so rank equals com. rank now pretty simple if rank equals zero so if this is a master node we're going to say data equals and we're going to use the alphabet here we're going to say a and that corresponds to the first letter B corresponds to second second letter and C corresponds to the third letter so that's our data it's just a dictionary of ABC and what number they re or they rank in the alphabet now what we're going to say so if if we're the master node we specify hey this is the data else data equals none for now so if you wanted to have some of the nodes maybe change their mind on what data is you could but for now we're going to say data equals none on all of the other nodes and then what we're going to say is data equals uh com. bcast so bcast for broadcast and it's going to be data root equals z so where are we getting this from it's going to be zero and now what we want to say is print Rank and then just hit out the rank and then we're just going to after rank we'll spit out that data so uh let's go ahead and save that and I'm going to move it over to the pies now and head over here up arrow and8 and number of processor is five in the last video it only spit out two things just because we only specified things for two things um but just know like at least for us we have five so if you don't have five there your results might look different uh than mine but anyways hit enter sat8 uh let's see what we get sure enough we get the output rank 0 4 1 32 and they all have the exact same uh data here thank you to broadcast so you don't have to type it in all like over and over and over and over again it just adds one more layer of Dynamics plus broadcast is really useful for things like um probably the most real world example that most people have heard of would be something like Bitcoin where the you know current Stat or status of the entire network is broadcast if uh if a node um solves a block let's say it's going to broadcast it to all the other nodes and all of that so um you can do a lot of neat things um with broadcast uh but obviously this was just a pretty basic example of what you can do with broadcast so anyways hopefully you guys enjoyed if you have any questions or comments feel free to leave them below as always thanks for watching
Original Description
Supercomputer Playlist: http://www.youtube.com/watch?v=13x90STvKnQ&list=PLQVvvaa0QuDf9IW-fe6No8SCw-aVnCfRi&feature=share
Welcome to another mpi4py tutorial video, in this video broadcasting is discussed and shown how to do it. The idea of broadcast is to send a bit of data to every node at once.
http://seaofbtc.com
http://sentdex.com
http://hkinsley.com
https://twitter.com/sentdex
Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from sentdex · sentdex · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
Python Encryption Tutorial with PyCrypto
sentdex
Python's Logging Function
sentdex
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
wxPython Programming Tutorial 4: Panels
sentdex
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
wxPython Programming Tutorial 8: Custom Button Images
sentdex
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
Basic PHP Tutorial 12: Associative Array
sentdex
Basic PHP Tutorial 14: Foreach loop
sentdex
Basic PHP Tutorial 16: Include and Require
sentdex
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
Basic PHP Tutorial 4: Variables and Comments
sentdex
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
Basic PHP Tutorial 1: Intro to PHP
sentdex
Basic PHP Tutorial 3: HTML with PHP
sentdex
Basic PHP Tutorial 9: While Loop
sentdex
Basic PHP Tutorial 10: Switch Statement
sentdex
Basic PHP Tutorial 2: Print and Echo
sentdex
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
Basic PHP Tutorial 19: Finding words in strings
sentdex
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
Basic PHP Programming Tutorial 24: String similarity
sentdex
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
Sikuli Tutorial 1: Visually programming in python!
sentdex
Sikuli Tutorial 2: Program visually in python!
sentdex
Sikuli Tutorial 3: Program visually in python!
sentdex
3D Bar Charts in Python and Matplotlib
sentdex
3D Plane wire frame Graph Chart in Python
sentdex
Raspberry Pi Part 1 Introduction
sentdex
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
Raspberry Pi Part 11: Remote Desktop
sentdex
Twitter Analysis: How to rank a user's influence
sentdex
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex
Related AI Lessons
⚡
⚡
⚡
⚡
How to Create a Second Version of Yourself Inside Obsidian Using AI (Step-by-Step Guide)
Medium · ChatGPT
How to prepare for Spain civil service TIC exam using AI in 2026
Dev.to · David García
How to prepare TIC teacher exams in Spain with AI (oposiciones 2026)
Dev.to AI
Why I built a simple AI provider wrapper (and you might too)
Dev.to · zhongqiyue
🎓
Tutor Explanation
DeepCamp AI