MPI-3 Timer requests proposal

1,008 views

Published on

Proposal by Jeff Squyres and Fab Tillier for user-level timers in MPI-3.

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
1,008
On SlideShare
0
From Embeds
0
Number of Embeds
527
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

MPI-3 Timer requests proposal

  1. 1. MPI Timers<br />Tick tock tick tock<br />
  2. 2. Wouldn’t it be nice…<br />To block in MPI_WAIT*<br />…but only for a while? (even if nothing completes)<br />Useful for:<br />Checking progress of non-MPI things<br />Avoid putting MPI into its own progress thread<br />Avoid using MPI_THREAD_MULTIPLE<br />Dynamically updating array of requests to MPI_WAIT*<br />MPI_TEST<br />The missing middle<br />MPI_WAIT<br />Immediate<br />Infinite<br />
  3. 3. Why not generalized requests?<br />Generalized requests are completed by the application calling MPI_GREQUEST_COMPLETE<br />To “break out” of MPI_WAITANY, impl. must support:<br />Multi-threaded applications and MPI_THREAD_MULTIPLE<br />Or calling GREQUEST_COMPLETE from signal handler<br />Thread 1<br />MPI_WAITANY (including a grequest)<br />Causes generalized <br />request to complete; <br />WAITANY returns<br />Threaded<br />example<br />Time <br />Thread 2<br />(or signal handler)<br />MPI_GREQUEST_COMPLETE<br />
  4. 4. New type of MPI_Request: timer<br />MPI_TIMER_CREATE(double completion_time, MPI_Request *request)<br />Creates a new timer request<br />Request can be tested, waited, canceled, and freed – just like any other request<br />Will complete when MPI_Wtime() >= completion_time<br />Completed timer requests return the empty status<br />
  5. 5. Use cases<br />MPI_WAIT on a timer request<br />Completes when MPI_Wtime() >= completion_time<br />High quality implementations can block / progress<br />MPI_WAITANY (including a timer request)<br />Timer request may be the first to complete<br />Forces a “premature” return from WAITANY<br />MPI_WAITALL (including a timer request)<br />Same as usual: completes when all complete<br />Timer request sets a lower bound on when all complete<br />Not enumerated here, but works with all MPI_WAIT* and MPI_TEST* functions – just like any other request<br />
  6. 6. Use cases<br />MPI_CANCEL a timer request<br />Cancels just like any other request (i.e., optional)<br /> Although we expect all MPI implementations to be able to implement canceling timers easily<br />Still has to be tested or waited – just like any other request<br />MPI_REQUEST_FREE a timer request<br />Moral equivalent of a successful MPI_CANCEL followed by an MPI_TEST<br />
  7. 7. Use cases: Dave/HP FT example<br />Master<br />Master<br />Master<br />MPI_Allgather<br />P<br />P<br />P<br />P<br />P<br />P<br />P<br />P<br />P<br />P<br />P<br />
  8. 8. Convenience Function<br />MPI_Timer_reset(double completion_time, MPI_Request *request)<br />Lets application re-use timer requests cheaply<br />Any timer can be reset if it has not yet been completed via TEST or WAIT<br />Specifically: it is ok if MPI_Wtime() >= completion_time<br />See example on next slide…<br />
  9. 9. Restarting timer in a loop<br />MPI_Requestreq[21];<br />fill_20_requests(req);<br />MPI_Timer_create(MPI_Wtime() + 5, &req[20]);<br />while (1) {<br />   MPI_Waitany(21, req, &index, MPI_STATUS_IGNORE);<br />   if (index != 20) {<br />       go_handle_completed_request(req, index);<br />check_for_other_progress();<br />       MPI_Timer_restart(MPI_Wtime() + 5, &req[20]);<br />   } else {<br />check_for_other_progress();<br />       MPI_Timer_create(MPI_Wtime() + 5, &req[20]);<br /> }<br />}<br />
  10. 10. If the Forum likes the idea…<br />What chapter should text about timers go in?<br />Environment control (with WTIME, WTICK)<br />Point to point (with TEST, WAIT, etc.)<br />…?<br />Optional ideas<br />Timer request query function to find out when it will expired<br />

×