SlideShare ist ein Scribd-Unternehmen logo
1 von 20
MPI_MPROBE: It’s Good for You Jeff Squyres
Regular MPI_PROBE Checks to see if  a matching message has arrived Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
Regular MPI_PROBE Checks to see if  a matching message has arrived MPI_PROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
Regular MPI_PROBE Checks to see if  a matching message has arrived MPI_PROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Match Tag: 9 Source: 67 Comm. ID: 17
MPI_PROBE Succeeded Now issue a receive to actually get the message MPI_RECV(…, tag=9, src=94,comm=17, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Message is removed from incoming queue Tag: 9 Source: 67 Comm. ID: 17
Race Condition …but what if another MPI thread issues the receive first? Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 MPI_RECV(…, tag=9, src=ANY_SOURCE,comm=17) Tag: 9 Source: 67 Comm. ID: 17
Race Condition In this case, your receive will end up unexpectedly blocking (!) MPI_RECV(…, tag=9, src=94,comm=17, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Blocked waiting for a matching message Tag: 9 Source: 67 Comm. ID: 17
Race Condition If / when the receive finally completes, it’s not the message you probed MPI_RECV(…, tag=9, src=94,comm=17, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 67 Comm. ID: 17 Tag: 9 Source: 94 Comm. ID: 17
MPI_MPROBE MPROBE = Match + probe Fixes this race condition When a message is successfully probed, it is removed from the matching queue
MPI_MPROBE MPI_MPROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
MPI_MPROBE When the match occurs, message is removed from the incoming queue MPI_MPROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
MPI_MPROBE Other probes / receives will no longer match this message Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 MPI_RECV(…, tag=9, src=ANY_SOURCE,comm=17) Tag: 9 Source: 67 Comm. ID: 17
MPI_MRECV “Matched” receive is used to receive a message that was mprobed MPI_MRECV(…, match_handle, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Guarantees that you get exactly the message you mprobed
Another Useful Case Probe to find the size of an incoming message MPI_PROBE(…);
Another Useful Case But malloc takes some time to complete MPI_PROBE(…); buf = malloc(incoming_size); Malloc takes some time
Another Useful Case But malloc takes some time to complete MPI_PROBE(…); buf = malloc(incoming_size); Malloc takes some time Vulnerable race condition window
Another Useful Case But malloc takes some time to complete MPI_PROBE(…); buf = malloc(incoming_size); MPI_RECV(…) Malloc takes some time Vulnerable race condition window Message could be stolen!
Another Useful Case Delays between MPROBE and MPRECV do not matter MPI_MPROBE(…); buf = malloc(incoming_size); MPI_MRECV(…) Malloc takes some time
Another Useful Case Delays between MPROBE and MPRECV do not matter MPI_MPROBE(…); buf = malloc(incoming_size); MPI_MRECV(…) Malloc takes some time Message cannot be stolen
Summary MPI_MPROBE eliminates race condition between probe and corresponding receive Good for: Event-based applications Mutli-threaded MPI applications When message lengths are unknown Strings, serialized objects, etc. E.g., bindings for Perl, Python, Boost.mpi

Weitere ähnliche Inhalte

Andere mochten auch

Winter Storm of 2008 April 6th
Winter Storm of 2008 April 6thWinter Storm of 2008 April 6th
Winter Storm of 2008 April 6thagraning
 
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
 
Post Storm Survey Background
Post Storm Survey BackgroundPost Storm Survey Background
Post Storm Survey Backgroundagraning
 
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
 

Andere mochten auch (8)

Hiroshima 1945 2008
Hiroshima 1945   2008Hiroshima 1945   2008
Hiroshima 1945 2008
 
Gita slides
Gita slidesGita slides
Gita slides
 
Winter Storm of 2008 April 6th
Winter Storm of 2008 April 6thWinter Storm of 2008 April 6th
Winter Storm of 2008 April 6th
 
A Foto Que Chocou O Mundo
A Foto Que Chocou O MundoA Foto Que Chocou O Mundo
A Foto Que Chocou O Mundo
 
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
 
Post Storm Survey Background
Post Storm Survey BackgroundPost Storm Survey Background
Post Storm Survey Background
 
Ratheesh
RatheeshRatheesh
Ratheesh
 
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
 

Mehr von 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
 
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
 
MPI-3 Timer requests proposal
MPI-3 Timer requests proposalMPI-3 Timer requests proposal
MPI-3 Timer requests proposalJeff Squyres
 
The Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's TermsThe Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's TermsJeff Squyres
 
What is [Open] MPI?
What is [Open] MPI?What is [Open] MPI?
What is [Open] MPI?Jeff Squyres
 

Mehr von 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
 
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)
 
MPI History
MPI HistoryMPI History
MPI History
 
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
 
MPI-3 Timer requests proposal
MPI-3 Timer requests proposalMPI-3 Timer requests proposal
MPI-3 Timer requests proposal
 
The Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's TermsThe Message Passing Interface (MPI) in Layman's Terms
The Message Passing Interface (MPI) in Layman's Terms
 
What is [Open] MPI?
What is [Open] MPI?What is [Open] MPI?
What is [Open] MPI?
 

Kürzlich hochgeladen

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 

Kürzlich hochgeladen (20)

Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 

MPI_Mprobe is good for you

  • 1. MPI_MPROBE: It’s Good for You Jeff Squyres
  • 2. Regular MPI_PROBE Checks to see if a matching message has arrived Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
  • 3. Regular MPI_PROBE Checks to see if a matching message has arrived MPI_PROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
  • 4. Regular MPI_PROBE Checks to see if a matching message has arrived MPI_PROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Match Tag: 9 Source: 67 Comm. ID: 17
  • 5. MPI_PROBE Succeeded Now issue a receive to actually get the message MPI_RECV(…, tag=9, src=94,comm=17, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Message is removed from incoming queue Tag: 9 Source: 67 Comm. ID: 17
  • 6. Race Condition …but what if another MPI thread issues the receive first? Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 MPI_RECV(…, tag=9, src=ANY_SOURCE,comm=17) Tag: 9 Source: 67 Comm. ID: 17
  • 7. Race Condition In this case, your receive will end up unexpectedly blocking (!) MPI_RECV(…, tag=9, src=94,comm=17, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Blocked waiting for a matching message Tag: 9 Source: 67 Comm. ID: 17
  • 8. Race Condition If / when the receive finally completes, it’s not the message you probed MPI_RECV(…, tag=9, src=94,comm=17, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 67 Comm. ID: 17 Tag: 9 Source: 94 Comm. ID: 17
  • 9. MPI_MPROBE MPROBE = Match + probe Fixes this race condition When a message is successfully probed, it is removed from the matching queue
  • 10. MPI_MPROBE MPI_MPROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
  • 11. MPI_MPROBE When the match occurs, message is removed from the incoming queue MPI_MPROBE looking for: Tag 9, ANY_SOURCE, COMM ID 17 Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Tag: 9 Source: 67 Comm. ID: 17
  • 12. MPI_MPROBE Other probes / receives will no longer match this message Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 MPI_RECV(…, tag=9, src=ANY_SOURCE,comm=17) Tag: 9 Source: 67 Comm. ID: 17
  • 13. MPI_MRECV “Matched” receive is used to receive a message that was mprobed MPI_MRECV(…, match_handle, …) Tag: 3 Source: 14 Comm. ID: 32 Incoming message queue Time Tag: 9 Source: 94 Comm. ID: 17 Guarantees that you get exactly the message you mprobed
  • 14. Another Useful Case Probe to find the size of an incoming message MPI_PROBE(…);
  • 15. Another Useful Case But malloc takes some time to complete MPI_PROBE(…); buf = malloc(incoming_size); Malloc takes some time
  • 16. Another Useful Case But malloc takes some time to complete MPI_PROBE(…); buf = malloc(incoming_size); Malloc takes some time Vulnerable race condition window
  • 17. Another Useful Case But malloc takes some time to complete MPI_PROBE(…); buf = malloc(incoming_size); MPI_RECV(…) Malloc takes some time Vulnerable race condition window Message could be stolen!
  • 18. Another Useful Case Delays between MPROBE and MPRECV do not matter MPI_MPROBE(…); buf = malloc(incoming_size); MPI_MRECV(…) Malloc takes some time
  • 19. Another Useful Case Delays between MPROBE and MPRECV do not matter MPI_MPROBE(…); buf = malloc(incoming_size); MPI_MRECV(…) Malloc takes some time Message cannot be stolen
  • 20. Summary MPI_MPROBE eliminates race condition between probe and corresponding receive Good for: Event-based applications Mutli-threaded MPI applications When message lengths are unknown Strings, serialized objects, etc. E.g., bindings for Perl, Python, Boost.mpi