SlideShare a Scribd company logo
1 of 101
Open MPI KYOSS presentation 12 Jan, 2011 Jeff Squyres
What is the Message Passing Interface (MPI)? The Book of MPI A standards document www.mpi-forum.org
Using MPI Hardware and software implement the interface in the MPI standard (book)
MPI implementations There are many implementations of the MPI standard Some are closed source Others are open source
Open MPI Open MPI is a free, open source implementation of the MPI standard www.open-mpi.org
So what is MPI for? Let’s break it down… Message Passing Interface
1. Message passing Process A Process B Message
1. Message passing Process A Process B Pass it
1. Message passing Process A Process B Message has been passed
1. Message passing Process Thread A Thread B …as opposed to data that is shared
2. Interface Fortran too! C programming function calls MPI_Wait(req, status) MPI_Init(argv, argc) MPI_Recv(buf, count, type, src, tag, comm, status) MPI_Send(buf, count, type, dest, tag, comm) MPI_Comm_dup(in, out) MPI_Test(req, flag, status) MPI_Finalize(void) MPI_Type_size(dtype, size)
Fortran?  Really? What most modern developers associate with “Fortran”
Yes, really Some of today’s most advanced simulation codes are written in Fortran
Yes, really Yes, that Intel Optimized for Nehalem, Westmere, and beyond!
Fortran is great for what it is A simple language for mathematical expressions and computations Targeted at scientists and engineers …not computer scientists or web developers or database developers or …
Back to defining “MPI”…
Putting it back together Message Passing Interface “An interface for passing messages” “C functions for passing messages” Fortran too!
C/Fortran functions for message passing Process A Process B MPI_Send(…)
C/Fortran functions for message passing Process A Process B MPI_Recv(…)
Really?  Is that all MPI is? “Can’t I just do that with sockets?” Yes! (…and no)
Comparison (TCP) Sockets Connections based on IP addresses and ports Point-to-point communication Stream-oriented Raw data (bytes / octets) Network-independent “Slow” MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast
Comparison MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast Whoa! What are these?
Peer integer “rank” MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
Peer integer “rank” MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: broadcast MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: broadcast MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: scatter MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: scatter MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: gather MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: gather MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: reduce MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 4 6 5 3 4 5 5 6 3 6 7 8 3 2 4 9 10 11 2 4 4
“Collective”: reduce MPI 42 Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
“Collective”: …and others MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
Messages, not bytes MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast Entire message is sent and received Not a stream of individual bytes
Messages, not bytes MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast Contents: 17 integers 23 doubles 98 structs …or whatever Not a bunch of bytes!
Network independent MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast MPI_Send(…) MPI_Recv(…) Underlying network Ethernet Myrinet InfiniBand Shared memory TCP iWARP RoCE
Network independent MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast MPI_Send(…) MPI_Recv(…) Underlying network Ethernet Myrinet Regardless of underlying network or transport protocol, the application code stays the same InfiniBand Shared memory TCP iWARP RoCE
Blazing fast MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast One microsecond (!) …more on performance later
What is MPI? MPI is probably somewhere around here
What is MPI? MPI is hides all the layers underneath
What is MPI? A high-level network  programming abstraction IP addresses byte streams raw bytes
What is MPI? A high-level network  programming abstraction Nothing to see here Please move along IP addresses byte streams raw bytes
So what? What’s all this message passing stuff got to do with supercomputers?
So what? Let’s define “supercomputers”
Supercomputers
Supercomputers “Nebulae” National Supercomputing Centre, Shenzen, China
Supercomputers “Mare Nostrum” (Our Sea) Barcelona Supercomputer Center, Spain Used to be a church
Supercomputers Notice anything?
Supercomputers They’re just racks of servers!
Generally speaking… Supercomputer = Lots of processors Lots of RAM Lots of disk + +
Generally speaking… Supercomputer = (Many) Racks of (commodity) high-end servers (this is one definition; there are others)
So if that’s a supercomputer… Rack of 36 1U servers
How is it different from my web farm? Rack of 36 1U servers
Just a bunch of servers? The difference between supercomputers and web farms and database farms (and …) All the servers act together to solve a single computational problem
Acting together Take your computational problem… Input Output Computational problem
Acting together …and split it up! Input Output Computational problem
Acting together Distribute the input data across a bunch of servers Input Output Computational problem
Acting together Use the network between servers to communicate / coordinate Input Output
Acting together Use the network between servers to communicate / coordinate Input Output
Acting together MPI is used for this communication Input Output
Why go to so much trouble? One processor hour Computational problem 1 processor = …a long time…
Why go to so much trouble? One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour Computational problem One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour 21 processors = ~1 hour (!) Disclaimer: scaling is rarely perfect
High Performance Computing HPC = Using supercomputers to solve real world problems that are  TOO BIG for laptops, desktops,  or individuals servers
Why does HPC      MPI?  Network abstraction Are these cores?
Why does HPC      MPI?  Network abstraction …or servers?
Why does HPC      MPI?  Message semantics Array of 10,000 integers
Why does HPC      MPI?  Message semantics Array of 10,000 integers
Why does HPC      MPI?  Ultra-low network latency (depending on your network type!) 1 micro second
1 microsecond = 0.000001 second From here To here
1 microsecond = 0.000001 second From here To here
Holy smokes! That’s fast
Let’s get into some details…
MPI Basics “6 function MPI” MPI_Init(): startup MPI_Comm_size(): how many peers? MPI_Comm_rank(): my unique (ordered) ID MPI_Send(): send a message MPI_Recv(): receive a message MPI_Finalize(): shutdown Can implement a huge number of parallel applications with just these 6 functions
Let’s see “Hello, World” in MPI
MPI Hello, World #include <stdio.h> #include <mpi.h> intmain(intargc, char **argv) { int rank, size; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); printf("Hello, world!  I am %d of %d", rank, size); MPI_Finalize();     return 0; } Initialize MPI Who am I? Num. peers? Shut down MPI
Compile it with Open MPI shell$ mpicchello.c -o hello shell$ Open MPI comes standard in many Linux and BSD distributions (and OS X) Hey – what’s that?  Where’s gcc?
“Wrapper” compiler mpicc simply fills in a bunch of  compiler command line options for you shell$ mpicchello.c -o hello –showme gcchello.c -o hello -I/opt/openmpi/include -pthread -L/open/openmpi/lib -lmpi -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl shell$
Now let’s run it shell$ mpirun –np 4 hello Hey – what’s that?  Why don’t I just run “./hello”?
mpirun launcher mpirun launches N copies of your program and “wires them up” shell$ mpirun –np 4 hello “-np” = “number of processes” This command launches  a 4 process parallel job
mpirun launcher shell$ mpirun –np 4 hello hello hello Four copies of “hello” are launched Then they are “wired up” on the network hello hello
Now let’s run it shell$ mpirun –np 4 hello Hello, world!  I am 0 of 4 Hello, world!  I am 1 of 4 Hello, world!  I am 2 of 4 Hello, world!  I am 3 of 4 shell$  By default, all copies run on the local host
Run on multiple servers! shell$ cat my_hostfile host1.example.com host2.example.com host3.example.com host4.example.com shell$
Run on multiple servers! shell$ cat my_hostfile host1.example.com host2.example.com host3.example.com host4.example.com shell$ mpirun–hostfilemy_hostfile–np 4 hello Hello, world!  I am 0 of 4 Hello, world!  I am 1 of 4 Hello, world!  I am 2 of 4 Hello, world!  I am 3 of 4 shell$   Ran on host1  Ran on host2  Ran on host3  Ran on host4
Run it again shell$ mpirun –hostfilemy_hostfile –np 4 hello Hello, world!  I am 2 of 4 Hello, world!  I am 3 of 4 Hello, world!  I am 0 of 4 Hello, world!  I am 1 of 4 shell$  2 3 0 1 Hey – why are the numbers out of order?
Standard output re-routing shell$ mpirun–hostfilemy_hostfile –np 4 hello Hello, world! I am 0 of 4 Hello, world! I am 1 of 4 hello 0 hello 1 mpirun Each “hello” program’s standard output is intercepted and sent across the network to mpirun hello 3 hello 2 Hello, world! I am 2 of 4 Hello, world! I am 3 of 4
Standard output re-routing shell$ mpirun–hostfilemy_hostfile –np 4 hello hello 0 hello 1 mpirun But the exact ordering of received printf’s is non-deterministic hello 3 hello 2 Hello, world! I am 2 of 4 Hello, world! I am 3 of 4 Hello, world! I am 0 of 4 Hello, world! I am 1 of 4
Printf debugging = Bad If you can’t rely on output ordering, printf debugging is pretty lousy (!)
Parallel debuggers Fortunately, there are parallel debuggers and other tools Parallel debugger Attaches to all processes in the MPI job hello 0 hello 1 mpirun hello 3 hello 2
Now let’s send a simple MPI message
Send a simple message int rank; double buffer[SIZE]; MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (0 == rank) {     /* …initialize buffer[]… */ MPI_Send(buffer, SIZE, MPI_DOUBLE, 1, 123,                  MPI_COMM_WORLD); } else if (1 == rank) { MPI_Recv(buffer, SIZE, MPI_DOUBLE, 0, 123,                  MPI_COMM_WORLD, MPI_STATUS_IGNORE); } If I’m number 0, send the  buffer[] array to number 1 If I’m number 1, receive the buffer[] array from number 0
That’s enough MPI for now…
Open MPI PACX-MPI LAM/MPI Project founded in 2003 after intense discussions between multiple  open source MPI implementations  LA-MPI FT-MPI Sun CT 6
Open_MPI_Init() shell$ svn log –r 1 https://svn.open-mpi.org/svn/ompi ------------------------------------------------------------------------ r1 | jsquyres | 2003-11-22 11:36:58 -0500 (Sat, 22 Nov 2003) | 2 lines Firstcommit ------------------------------------------------------------------------ shell$
Open_MPI_Current_status() shell$ svn log –r HEAD https://svn.open-mpi.org/svn/ompi ------------------------------------------------------------------------ r24226 | rhc | 2011-01-11 20:57:47 -0500 (Tue, 11 Jan 2011) | 25 lines Fixes #2683: Move ORTE DPM compiler warning squash to v1.4 ------------------------------------------------------------------------ shell$
Open MPI 2011 Membership 15 members, 11 contributors, 2 partners
Fun stats ohloh.net says: 517,400 lines of code 30 developers (over time) “Well-commented source code” I rank in top-25 ohloh stats for: C Automake Shell script Fortran (ouch!)
Open MPI has grown It’s amazing (to me) that the Open MPI project works so well New features, new releases,  new members Long live Open MPI!
Recap Defined Message Passing Interface (MPI) Defined “supercomputers” Defined High Performance Computing (HPC) Showed what MPI is Showed some trivial MPI codes Discussed Open MPI
Additional Resources MPI Forum web site The only site for the official MPI standards http://www.mpi-forum.org/ NCSA MPI basic and intermediate tutorials Requires a free account http://ci-tutor.ncsa.uiuc.edu/login.php “MPI Mechanic” magazine columns http://cw.squyres.com/
Additional Resources Research, Computing, and Engineering (RCE) podcast http://www.rce-cast.com/ My blog: MPI_BCAST http://blogs.cisco.com/category/performance/
Questions?

More Related Content

What's hot

Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systemsReza Gh
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interfaceMohit Raghuvanshi
 
Introduction to MPI
Introduction to MPI Introduction to MPI
Introduction to MPI Hanif Durad
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationMohd Tousif
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
program flow mechanisms, advanced computer architecture
program flow mechanisms, advanced computer architectureprogram flow mechanisms, advanced computer architecture
program flow mechanisms, advanced computer architecturePankaj Kumar Jain
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Dr. SELVAGANESAN S
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structuresMukesh Chinta
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43myrajendra
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)Computer_ at_home
 

What's hot (20)

Distributed web based systems
Distributed web based systemsDistributed web based systems
Distributed web based systems
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interface
 
Introduction to MPI
Introduction to MPI Introduction to MPI
Introduction to MPI
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
program flow mechanisms, advanced computer architecture
program flow mechanisms, advanced computer architectureprogram flow mechanisms, advanced computer architecture
program flow mechanisms, advanced computer architecture
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer
 
Memory management
Memory managementMemory management
Memory management
 
Parallel Processing Concepts
Parallel Processing Concepts Parallel Processing Concepts
Parallel Processing Concepts
 
Operating systems system structures
Operating systems   system structuresOperating systems   system structures
Operating systems system structures
 
Parallel programming model
Parallel programming modelParallel programming model
Parallel programming model
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
Course outline of parallel and distributed computing
Course outline of parallel and distributed computingCourse outline of parallel and distributed computing
Course outline of parallel and distributed computing
 
Parallelism
ParallelismParallelism
Parallelism
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 

Viewers also liked (20)

Message passing interface
Message passing interfaceMessage passing interface
Message passing interface
 
MPI Introduction
MPI IntroductionMPI Introduction
MPI Introduction
 
MPI Presentation
MPI PresentationMPI Presentation
MPI Presentation
 
MPI Tutorial
MPI TutorialMPI Tutorial
MPI Tutorial
 
Server Side Technologies in Mobile Development
Server Side Technologies in Mobile DevelopmentServer Side Technologies in Mobile Development
Server Side Technologies in Mobile Development
 
message passing interface
message passing interfacemessage passing interface
message passing interface
 
Mpi
Mpi Mpi
Mpi
 
What is [Open] MPI?
What is [Open] MPI?What is [Open] MPI?
What is [Open] MPI?
 
Intro to MPI
Intro to MPIIntro to MPI
Intro to MPI
 
MPI History
MPI HistoryMPI History
MPI History
 
Open MPI
Open MPIOpen MPI
Open MPI
 
It 4-yr-1-sem-digital image processing
It 4-yr-1-sem-digital image processingIt 4-yr-1-sem-digital image processing
It 4-yr-1-sem-digital image processing
 
Digital image processing unit 1
Digital image processing unit 1Digital image processing unit 1
Digital image processing unit 1
 
Dip Unit Test-I
Dip Unit Test-IDip Unit Test-I
Dip Unit Test-I
 
Mpi.net tutorial
Mpi.net tutorialMpi.net tutorial
Mpi.net tutorial
 
OGSA
OGSAOGSA
OGSA
 
Globus ppt
Globus pptGlobus ppt
Globus ppt
 
MPI
MPIMPI
MPI
 
Beowulf cluster
Beowulf clusterBeowulf cluster
Beowulf cluster
 
Tutorial on Parallel Computing and Message Passing Model - C3
Tutorial on Parallel Computing and Message Passing Model - C3Tutorial on Parallel Computing and Message Passing Model - C3
Tutorial on Parallel Computing and Message Passing Model - C3
 

Similar to The Message Passing Interface (MPI) in Layman's Terms

High Performance Computing using MPI
High Performance Computing using MPIHigh Performance Computing using MPI
High Performance Computing using MPIAnkit Mahato
 
Funambol C++ API
Funambol C++ APIFunambol C++ API
Funambol C++ APIFunambol
 
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Pulsar summit asia 2021   apache pulsar with mqtt for edge computingPulsar summit asia 2021   apache pulsar with mqtt for edge computing
Pulsar summit asia 2021 apache pulsar with mqtt for edge computingTimothy Spann
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPIAjit Nayak
 
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Big mountain data and dev conference   apache pulsar with mqtt for edge compu...Big mountain data and dev conference   apache pulsar with mqtt for edge compu...
Big mountain data and dev conference apache pulsar with mqtt for edge compu...Timothy Spann
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsTim Burks
 
UCX-Python - A Flexible Communication Library for Python Applications
UCX-Python - A Flexible Communication Library for Python ApplicationsUCX-Python - A Flexible Communication Library for Python Applications
UCX-Python - A Flexible Communication Library for Python ApplicationsMatthew Rocklin
 
cs556-2nd-tutorial.pdf
cs556-2nd-tutorial.pdfcs556-2nd-tutorial.pdf
cs556-2nd-tutorial.pdfssuserada6a9
 
Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?Davide Carboni
 
Network Flow Analysis
Network Flow AnalysisNetwork Flow Analysis
Network Flow Analysisguest23ccda3
 
Network Flow Analysis
Network Flow AnalysisNetwork Flow Analysis
Network Flow Analysisguest23ccda3
 
Networking
NetworkingNetworking
NetworkingSNancy
 
Codeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flinkCodeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flinkTimothy Spann
 
Data minutes #2 Apache Pulsar with MQTT for Edge Computing Lightning - 2022
Data minutes #2   Apache Pulsar with MQTT for Edge Computing Lightning - 2022Data minutes #2   Apache Pulsar with MQTT for Edge Computing Lightning - 2022
Data minutes #2 Apache Pulsar with MQTT for Edge Computing Lightning - 2022Timothy Spann
 

Similar to The Message Passing Interface (MPI) in Layman's Terms (20)

My ppt hpc u4
My ppt hpc u4My ppt hpc u4
My ppt hpc u4
 
High Performance Computing using MPI
High Performance Computing using MPIHigh Performance Computing using MPI
High Performance Computing using MPI
 
More mpi4py
More mpi4pyMore mpi4py
More mpi4py
 
25-MPI-OpenMP.pptx
25-MPI-OpenMP.pptx25-MPI-OpenMP.pptx
25-MPI-OpenMP.pptx
 
Funambol C++ API
Funambol C++ APIFunambol C++ API
Funambol C++ API
 
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Pulsar summit asia 2021   apache pulsar with mqtt for edge computingPulsar summit asia 2021   apache pulsar with mqtt for edge computing
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
 
Parallel programming using MPI
Parallel programming using MPIParallel programming using MPI
Parallel programming using MPI
 
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
Big mountain data and dev conference   apache pulsar with mqtt for edge compu...Big mountain data and dev conference   apache pulsar with mqtt for edge compu...
Big mountain data and dev conference apache pulsar with mqtt for edge compu...
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
 
UCX-Python - A Flexible Communication Library for Python Applications
UCX-Python - A Flexible Communication Library for Python ApplicationsUCX-Python - A Flexible Communication Library for Python Applications
UCX-Python - A Flexible Communication Library for Python Applications
 
cs556-2nd-tutorial.pdf
cs556-2nd-tutorial.pdfcs556-2nd-tutorial.pdf
cs556-2nd-tutorial.pdf
 
Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?Pysense: wireless sensor computing in Python?
Pysense: wireless sensor computing in Python?
 
mpi4py.pdf
mpi4py.pdfmpi4py.pdf
mpi4py.pdf
 
Multicore
MulticoreMulticore
Multicore
 
Network Flow Analysis
Network Flow AnalysisNetwork Flow Analysis
Network Flow Analysis
 
Network Flow Analysis
Network Flow AnalysisNetwork Flow Analysis
Network Flow Analysis
 
Networking
NetworkingNetworking
Networking
 
MPI - 1
MPI - 1MPI - 1
MPI - 1
 
Codeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flinkCodeless pipelines with pulsar and flink
Codeless pipelines with pulsar and flink
 
Data minutes #2 Apache Pulsar with MQTT for Edge Computing Lightning - 2022
Data minutes #2   Apache Pulsar with MQTT for Edge Computing Lightning - 2022Data minutes #2   Apache Pulsar with MQTT for Edge Computing Lightning - 2022
Data minutes #2 Apache Pulsar with MQTT for Edge Computing Lightning - 2022
 

More from Jeff Squyres

Open MPI State of the Union X SC'16 BOF
Open MPI State of the Union X SC'16 BOFOpen MPI State of the Union X SC'16 BOF
Open MPI State of the Union X SC'16 BOFJeff Squyres
 
MPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumMPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumJeff Squyres
 
MPI Fourm SC'15 BOF
MPI Fourm SC'15 BOFMPI Fourm SC'15 BOF
MPI Fourm SC'15 BOFJeff Squyres
 
Open MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOFOpen MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOFJeff Squyres
 
Cisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricCisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricJeff Squyres
 
(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE
(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE
(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZEJeff Squyres
 
Fun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byFun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byJeff Squyres
 
Open MPI new version number scheme and roadmap
Open MPI new version number scheme and roadmapOpen MPI new version number scheme and roadmap
Open MPI new version number scheme and roadmapJeff Squyres
 
The State of libfabric in Open MPI
The State of libfabric in Open MPIThe State of libfabric in Open MPI
The State of libfabric in Open MPIJeff Squyres
 
Cisco usNIC libfabric provider
Cisco usNIC libfabric providerCisco usNIC libfabric provider
Cisco usNIC libfabric providerJeff Squyres
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedbackJeff Squyres
 
(Open) MPI, Parallel Computing, Life, the Universe, and Everything
(Open) MPI, Parallel Computing, Life, the Universe, and Everything(Open) MPI, Parallel Computing, Life, the Universe, and Everything
(Open) MPI, Parallel Computing, Life, the Universe, and EverythingJeff Squyres
 
Cisco usNIC: how it works, how it is used in Open MPI
Cisco usNIC: how it works, how it is used in Open MPICisco usNIC: how it works, how it is used in Open MPI
Cisco usNIC: how it works, how it is used in Open MPIJeff Squyres
 
Cisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentationCisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentationJeff Squyres
 
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)Jeff Squyres
 
MOSSCon 2013, Cisco Open Source talk
MOSSCon 2013, Cisco Open Source talkMOSSCon 2013, Cisco Open Source talk
MOSSCon 2013, Cisco Open Source talkJeff Squyres
 
Ethernet and TCP optimizations
Ethernet and TCP optimizationsEthernet and TCP optimizations
Ethernet and TCP optimizationsJeff Squyres
 
Friends don't let friends leak MPI_Requests
Friends don't let friends leak MPI_RequestsFriends don't let friends leak MPI_Requests
Friends don't let friends leak MPI_RequestsJeff Squyres
 
MPI-3 Timer requests proposal
MPI-3 Timer requests proposalMPI-3 Timer requests proposal
MPI-3 Timer requests proposalJeff Squyres
 
MPI_Mprobe is good for you
MPI_Mprobe is good for youMPI_Mprobe is good for you
MPI_Mprobe is good for youJeff Squyres
 

More from Jeff Squyres (20)

Open MPI State of the Union X SC'16 BOF
Open MPI State of the Union X SC'16 BOFOpen MPI State of the Union X SC'16 BOF
Open MPI State of the Union X SC'16 BOF
 
MPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumMPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI Forum
 
MPI Fourm SC'15 BOF
MPI Fourm SC'15 BOFMPI Fourm SC'15 BOF
MPI Fourm SC'15 BOF
 
Open MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOFOpen MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOF
 
Cisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to LibfabricCisco's journey from Verbs to Libfabric
Cisco's journey from Verbs to Libfabric
 
(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE
(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE
(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE
 
Fun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-byFun with Github webhooks: verifying Signed-off-by
Fun with Github webhooks: verifying Signed-off-by
 
Open MPI new version number scheme and roadmap
Open MPI new version number scheme and roadmapOpen MPI new version number scheme and roadmap
Open MPI new version number scheme and roadmap
 
The State of libfabric in Open MPI
The State of libfabric in Open MPIThe State of libfabric in Open MPI
The State of libfabric in Open MPI
 
Cisco usNIC libfabric provider
Cisco usNIC libfabric providerCisco usNIC libfabric provider
Cisco usNIC libfabric provider
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback
 
(Open) MPI, Parallel Computing, Life, the Universe, and Everything
(Open) MPI, Parallel Computing, Life, the Universe, and Everything(Open) MPI, Parallel Computing, Life, the Universe, and Everything
(Open) MPI, Parallel Computing, Life, the Universe, and Everything
 
Cisco usNIC: how it works, how it is used in Open MPI
Cisco usNIC: how it works, how it is used in Open MPICisco usNIC: how it works, how it is used in Open MPI
Cisco usNIC: how it works, how it is used in Open MPI
 
Cisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentationCisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentation
 
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
Open MPI Explorations in Process Affinity (EuroMPI'13 presentation)
 
MOSSCon 2013, Cisco Open Source talk
MOSSCon 2013, Cisco Open Source talkMOSSCon 2013, Cisco Open Source talk
MOSSCon 2013, Cisco Open Source talk
 
Ethernet and TCP optimizations
Ethernet and TCP optimizationsEthernet and TCP optimizations
Ethernet and TCP optimizations
 
Friends don't let friends leak MPI_Requests
Friends don't let friends leak MPI_RequestsFriends don't let friends leak MPI_Requests
Friends don't let friends leak MPI_Requests
 
MPI-3 Timer requests proposal
MPI-3 Timer requests proposalMPI-3 Timer requests proposal
MPI-3 Timer requests proposal
 
MPI_Mprobe is good for you
MPI_Mprobe is good for youMPI_Mprobe is good for you
MPI_Mprobe is good for you
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

The Message Passing Interface (MPI) in Layman's Terms

  • 1. Open MPI KYOSS presentation 12 Jan, 2011 Jeff Squyres
  • 2. What is the Message Passing Interface (MPI)? The Book of MPI A standards document www.mpi-forum.org
  • 3. Using MPI Hardware and software implement the interface in the MPI standard (book)
  • 4. MPI implementations There are many implementations of the MPI standard Some are closed source Others are open source
  • 5. Open MPI Open MPI is a free, open source implementation of the MPI standard www.open-mpi.org
  • 6. So what is MPI for? Let’s break it down… Message Passing Interface
  • 7. 1. Message passing Process A Process B Message
  • 8. 1. Message passing Process A Process B Pass it
  • 9. 1. Message passing Process A Process B Message has been passed
  • 10. 1. Message passing Process Thread A Thread B …as opposed to data that is shared
  • 11. 2. Interface Fortran too! C programming function calls MPI_Wait(req, status) MPI_Init(argv, argc) MPI_Recv(buf, count, type, src, tag, comm, status) MPI_Send(buf, count, type, dest, tag, comm) MPI_Comm_dup(in, out) MPI_Test(req, flag, status) MPI_Finalize(void) MPI_Type_size(dtype, size)
  • 12. Fortran? Really? What most modern developers associate with “Fortran”
  • 13. Yes, really Some of today’s most advanced simulation codes are written in Fortran
  • 14. Yes, really Yes, that Intel Optimized for Nehalem, Westmere, and beyond!
  • 15. Fortran is great for what it is A simple language for mathematical expressions and computations Targeted at scientists and engineers …not computer scientists or web developers or database developers or …
  • 16. Back to defining “MPI”…
  • 17. Putting it back together Message Passing Interface “An interface for passing messages” “C functions for passing messages” Fortran too!
  • 18. C/Fortran functions for message passing Process A Process B MPI_Send(…)
  • 19. C/Fortran functions for message passing Process A Process B MPI_Recv(…)
  • 20. Really? Is that all MPI is? “Can’t I just do that with sockets?” Yes! (…and no)
  • 21. Comparison (TCP) Sockets Connections based on IP addresses and ports Point-to-point communication Stream-oriented Raw data (bytes / octets) Network-independent “Slow” MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast
  • 22. Comparison MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast Whoa! What are these?
  • 23. Peer integer “rank” MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 24. Peer integer “rank” MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 25. “Collective”: broadcast MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 26. “Collective”: broadcast MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 27. “Collective”: scatter MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 28. “Collective”: scatter MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 29. “Collective”: gather MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 30. “Collective”: gather MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 31. “Collective”: reduce MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 4 6 5 3 4 5 5 6 3 6 7 8 3 2 4 9 10 11 2 4 4
  • 32. “Collective”: reduce MPI 42 Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 33. “Collective”: …and others MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast 0 1 2 3 4 5 6 7 8 9 10 11
  • 34. Messages, not bytes MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast Entire message is sent and received Not a stream of individual bytes
  • 35. Messages, not bytes MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast Contents: 17 integers 23 doubles 98 structs …or whatever Not a bunch of bytes!
  • 36. Network independent MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast MPI_Send(…) MPI_Recv(…) Underlying network Ethernet Myrinet InfiniBand Shared memory TCP iWARP RoCE
  • 37. Network independent MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast MPI_Send(…) MPI_Recv(…) Underlying network Ethernet Myrinet Regardless of underlying network or transport protocol, the application code stays the same InfiniBand Shared memory TCP iWARP RoCE
  • 38. Blazing fast MPI Based on peer integer “rank” (e.g., 8) Point-to-point and collective and one-sided and … Message oriented Typed messages Network independent Blazing fast One microsecond (!) …more on performance later
  • 39. What is MPI? MPI is probably somewhere around here
  • 40. What is MPI? MPI is hides all the layers underneath
  • 41. What is MPI? A high-level network programming abstraction IP addresses byte streams raw bytes
  • 42. What is MPI? A high-level network programming abstraction Nothing to see here Please move along IP addresses byte streams raw bytes
  • 43. So what? What’s all this message passing stuff got to do with supercomputers?
  • 44. So what? Let’s define “supercomputers”
  • 46. Supercomputers “Nebulae” National Supercomputing Centre, Shenzen, China
  • 47. Supercomputers “Mare Nostrum” (Our Sea) Barcelona Supercomputer Center, Spain Used to be a church
  • 49. Supercomputers They’re just racks of servers!
  • 50. Generally speaking… Supercomputer = Lots of processors Lots of RAM Lots of disk + +
  • 51. Generally speaking… Supercomputer = (Many) Racks of (commodity) high-end servers (this is one definition; there are others)
  • 52. So if that’s a supercomputer… Rack of 36 1U servers
  • 53. How is it different from my web farm? Rack of 36 1U servers
  • 54. Just a bunch of servers? The difference between supercomputers and web farms and database farms (and …) All the servers act together to solve a single computational problem
  • 55. Acting together Take your computational problem… Input Output Computational problem
  • 56. Acting together …and split it up! Input Output Computational problem
  • 57. Acting together Distribute the input data across a bunch of servers Input Output Computational problem
  • 58. Acting together Use the network between servers to communicate / coordinate Input Output
  • 59. Acting together Use the network between servers to communicate / coordinate Input Output
  • 60. Acting together MPI is used for this communication Input Output
  • 61. Why go to so much trouble? One processor hour Computational problem 1 processor = …a long time…
  • 62. Why go to so much trouble? One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour Computational problem One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour One processor hour 21 processors = ~1 hour (!) Disclaimer: scaling is rarely perfect
  • 63. High Performance Computing HPC = Using supercomputers to solve real world problems that are TOO BIG for laptops, desktops, or individuals servers
  • 64. Why does HPC MPI? Network abstraction Are these cores?
  • 65. Why does HPC MPI? Network abstraction …or servers?
  • 66. Why does HPC MPI? Message semantics Array of 10,000 integers
  • 67. Why does HPC MPI? Message semantics Array of 10,000 integers
  • 68. Why does HPC MPI? Ultra-low network latency (depending on your network type!) 1 micro second
  • 69. 1 microsecond = 0.000001 second From here To here
  • 70. 1 microsecond = 0.000001 second From here To here
  • 72. Let’s get into some details…
  • 73. MPI Basics “6 function MPI” MPI_Init(): startup MPI_Comm_size(): how many peers? MPI_Comm_rank(): my unique (ordered) ID MPI_Send(): send a message MPI_Recv(): receive a message MPI_Finalize(): shutdown Can implement a huge number of parallel applications with just these 6 functions
  • 74. Let’s see “Hello, World” in MPI
  • 75. MPI Hello, World #include <stdio.h> #include <mpi.h> intmain(intargc, char **argv) { int rank, size; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); printf("Hello, world! I am %d of %d", rank, size); MPI_Finalize(); return 0; } Initialize MPI Who am I? Num. peers? Shut down MPI
  • 76. Compile it with Open MPI shell$ mpicchello.c -o hello shell$ Open MPI comes standard in many Linux and BSD distributions (and OS X) Hey – what’s that? Where’s gcc?
  • 77. “Wrapper” compiler mpicc simply fills in a bunch of compiler command line options for you shell$ mpicchello.c -o hello –showme gcchello.c -o hello -I/opt/openmpi/include -pthread -L/open/openmpi/lib -lmpi -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl shell$
  • 78. Now let’s run it shell$ mpirun –np 4 hello Hey – what’s that? Why don’t I just run “./hello”?
  • 79. mpirun launcher mpirun launches N copies of your program and “wires them up” shell$ mpirun –np 4 hello “-np” = “number of processes” This command launches a 4 process parallel job
  • 80. mpirun launcher shell$ mpirun –np 4 hello hello hello Four copies of “hello” are launched Then they are “wired up” on the network hello hello
  • 81. Now let’s run it shell$ mpirun –np 4 hello Hello, world! I am 0 of 4 Hello, world! I am 1 of 4 Hello, world! I am 2 of 4 Hello, world! I am 3 of 4 shell$ By default, all copies run on the local host
  • 82. Run on multiple servers! shell$ cat my_hostfile host1.example.com host2.example.com host3.example.com host4.example.com shell$
  • 83. Run on multiple servers! shell$ cat my_hostfile host1.example.com host2.example.com host3.example.com host4.example.com shell$ mpirun–hostfilemy_hostfile–np 4 hello Hello, world! I am 0 of 4 Hello, world! I am 1 of 4 Hello, world! I am 2 of 4 Hello, world! I am 3 of 4 shell$  Ran on host1  Ran on host2  Ran on host3  Ran on host4
  • 84. Run it again shell$ mpirun –hostfilemy_hostfile –np 4 hello Hello, world! I am 2 of 4 Hello, world! I am 3 of 4 Hello, world! I am 0 of 4 Hello, world! I am 1 of 4 shell$ 2 3 0 1 Hey – why are the numbers out of order?
  • 85. Standard output re-routing shell$ mpirun–hostfilemy_hostfile –np 4 hello Hello, world! I am 0 of 4 Hello, world! I am 1 of 4 hello 0 hello 1 mpirun Each “hello” program’s standard output is intercepted and sent across the network to mpirun hello 3 hello 2 Hello, world! I am 2 of 4 Hello, world! I am 3 of 4
  • 86. Standard output re-routing shell$ mpirun–hostfilemy_hostfile –np 4 hello hello 0 hello 1 mpirun But the exact ordering of received printf’s is non-deterministic hello 3 hello 2 Hello, world! I am 2 of 4 Hello, world! I am 3 of 4 Hello, world! I am 0 of 4 Hello, world! I am 1 of 4
  • 87. Printf debugging = Bad If you can’t rely on output ordering, printf debugging is pretty lousy (!)
  • 88. Parallel debuggers Fortunately, there are parallel debuggers and other tools Parallel debugger Attaches to all processes in the MPI job hello 0 hello 1 mpirun hello 3 hello 2
  • 89. Now let’s send a simple MPI message
  • 90. Send a simple message int rank; double buffer[SIZE]; MPI_Comm_rank(MPI_COMM_WORLD, &rank); if (0 == rank) { /* …initialize buffer[]… */ MPI_Send(buffer, SIZE, MPI_DOUBLE, 1, 123, MPI_COMM_WORLD); } else if (1 == rank) { MPI_Recv(buffer, SIZE, MPI_DOUBLE, 0, 123, MPI_COMM_WORLD, MPI_STATUS_IGNORE); } If I’m number 0, send the buffer[] array to number 1 If I’m number 1, receive the buffer[] array from number 0
  • 91. That’s enough MPI for now…
  • 92. Open MPI PACX-MPI LAM/MPI Project founded in 2003 after intense discussions between multiple open source MPI implementations LA-MPI FT-MPI Sun CT 6
  • 93. Open_MPI_Init() shell$ svn log –r 1 https://svn.open-mpi.org/svn/ompi ------------------------------------------------------------------------ r1 | jsquyres | 2003-11-22 11:36:58 -0500 (Sat, 22 Nov 2003) | 2 lines Firstcommit ------------------------------------------------------------------------ shell$
  • 94. Open_MPI_Current_status() shell$ svn log –r HEAD https://svn.open-mpi.org/svn/ompi ------------------------------------------------------------------------ r24226 | rhc | 2011-01-11 20:57:47 -0500 (Tue, 11 Jan 2011) | 25 lines Fixes #2683: Move ORTE DPM compiler warning squash to v1.4 ------------------------------------------------------------------------ shell$
  • 95. Open MPI 2011 Membership 15 members, 11 contributors, 2 partners
  • 96. Fun stats ohloh.net says: 517,400 lines of code 30 developers (over time) “Well-commented source code” I rank in top-25 ohloh stats for: C Automake Shell script Fortran (ouch!)
  • 97. Open MPI has grown It’s amazing (to me) that the Open MPI project works so well New features, new releases, new members Long live Open MPI!
  • 98. Recap Defined Message Passing Interface (MPI) Defined “supercomputers” Defined High Performance Computing (HPC) Showed what MPI is Showed some trivial MPI codes Discussed Open MPI
  • 99. Additional Resources MPI Forum web site The only site for the official MPI standards http://www.mpi-forum.org/ NCSA MPI basic and intermediate tutorials Requires a free account http://ci-tutor.ncsa.uiuc.edu/login.php “MPI Mechanic” magazine columns http://cw.squyres.com/
  • 100. Additional Resources Research, Computing, and Engineering (RCE) podcast http://www.rce-cast.com/ My blog: MPI_BCAST http://blogs.cisco.com/category/performance/