Your SlideShare is downloading. ×
0
MPI_MPROBE: It’s Good for You<br />Jeff Squyres<br />
Regular MPI_PROBE<br />Checks to see if <br />a matching message has arrived<br />Tag: 3<br />Source: 14<br />Comm. ID: 32...
Regular MPI_PROBE<br />Checks to see if <br />a matching message has arrived<br />MPI_PROBE looking for:<br />Tag 8, ANY_S...
Regular MPI_PROBE<br />Checks to see if <br />a matching message has arrived<br />MPI_PROBE looking for:<br />Tag 9, ANY_S...
MPI_PROBE Succeeded<br />Now issue a receive<br />to actually get the message<br />MPI_RECV(…, tag=9, src=94,comm=17, …)<b...
Race Condition<br />…but what if another MPI<br />thread issues the receive first?<br />Tag: 3<br />Source: 14<br />Comm. ...
Race Condition<br />In this case, your receive will<br />end up unexpectedly blocking (!)<br />MPI_RECV(…, tag=9, src=94,c...
Race Condition<br />If / when the receive finally completes,<br />it’s not the message you probed<br />MPI_RECV(…, tag=9, ...
MPI_MPROBE<br />MPROBE = Match + probe<br />Fixes this race condition<br />When a message is successfully probed,<br />it ...
MPI_MPROBE<br />MPI_MPROBE looking for:<br />Tag 8, ANY_SOURCE, COMM ID 17<br />Tag: 3<br />Source: 14<br />Comm. ID: 32<b...
MPI_MPROBE<br />When the match occurs, message<br />is removed from the incoming queue<br />MPI_MPROBE looking for:<br />T...
MPI_MPROBE<br />Other probes / receives will no longer<br />match this message<br />Tag: 3<br />Source: 14<br />Comm. ID: ...
MPI_MRECV<br />“Matched” receive is used to receive<br />a message that was mprobed<br />MPI_MRECV(…, match_handle, …)<br ...
Another Useful Case<br />Probe to find the size of an incoming message<br />MPI_PROBE(…);<br />
Another Useful Case<br />But malloc takes some time to complete<br />MPI_PROBE(…);<br />buf = malloc(incoming_size);<br />...
Another Useful Case<br />But malloc takes some time to complete<br />MPI_PROBE(…);<br />buf = malloc(incoming_size);<br />...
Another Useful Case<br />But malloc takes some time to complete<br />MPI_PROBE(…);<br />buf = malloc(incoming_size);<br />...
Another Useful Case<br />Delays between MPROBE and MPRECV do not matter<br />MPI_MPROBE(…);<br />buf = malloc(incoming_siz...
Another Useful Case<br />Delays between MPROBE and MPRECV do not matter<br />MPI_MPROBE(…);<br />buf = malloc(incoming_siz...
Summary<br />MPI_MPROBE eliminates race condition between probe and corresponding receive<br />Good for:<br />Event-based ...
Upcoming SlideShare
Loading in...5
×

MPI_Mprobe is good for you

587

Published on

Graphical description of the proposed MPI_MPROBE interface.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
587
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "MPI_Mprobe is good for you"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×