Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Optimizing High Performance Computing Applications for Energy
Next
Download to read offline and view in fullscreen.

1

Share

Download to read offline

(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE

Download to read offline

This is one of two mini-talks that I gave at Euro MPI 2015 / Bordeaux. It's mainly a taste of the kinds of discussions that we have at the MPI Forum. This particular talk is about some thoughts I've had about revamping MPI_INIT and MPI_FINALIZE. It is by NO means a finalized proposal -- it's mainly to give you an idea of the scope of ideas that are routinely discussed at the Forum. ...hey, you should attend MPI Forum meetings and see for yourself!

Related Books

Free with a 30 day trial from Scribd

See all

(Very) Loose proposal to revamp MPI_INIT and MPI_FINALIZE

  1. 1. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 1© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 1 (Very) Loose Proposal to Revamp MPI_INIT and MPI_FINALIZE These are the kinds of crazy ideas that we discuss at the MPI Forum Jeffrey M. Squyres Cisco Systems 23 September 2015
  2. 2. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 2 int my_thread1_main(void *context) { MPI_Initialized(&flag); // … } int my_thread2_main(void *context) { MPI_Initialized(&flag); // … } int main(int argc, char **argv) { MPI_Init_thread(…, MPI_THREAD_FUNNELED, …); pthread_create(…, my_thread1_main, NULL); pthread_create(…, my_thread2_main, NULL); // … } These might run at the same time (!)
  3. 3. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 3 • MPI_INITIALIZED (and friends) are allowed to be called at any time …even by multiple threads …regardless of MPI_THREAD_* level • This is a simple, easy-to-explain solution And probably what most applications do, anyway  • But many other paths were investigated
  4. 4. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 4 • Cannot call MPI_INIT more than once • Cannot set error behavior of MPI_INIT • Cannot re-initialize MPI after it has been finalized • Cannot init MPI from different entities within a process without a priori knowledge / coordination MPI Process // Library 1 MPI_Initialized(&flag); if (!flag) MPI_Init(…); // Library 2 MPI_Initialized(&flag); if (!flag) MPI_Init(…);
  5. 5. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 5 • Cannot call MPI_INIT more than once • Cannot set error behavior of MPI_INIT • Cannot re-initialize MPI after it has been finalized • Cannot init MPI from different entities within a process without a priori knowledge / coordination MPI Process // Library 1 MPI_Initialized(&flag); if (!flag) MPI_Init(…); // Library 2 MPI_Initialized(&flag); if (!flag) MPI_Init(…); THIS IS INSUFFICIENT / POTENTIALLY ERRONEOUS
  6. 6. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
  7. 7. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 7 • Call MPI_INIT as many times as you like • By whomever wants to call it MPI Process // Library 3 MPI_Init(…); // Library 4 MPI_Init(…); // Library 5 MPI_Init(…); // Library 6 MPI_Init(…);// Library 7 MPI_Init(…); // Library 8 MPI_Init(…); // Library 9 MPI_Init(…); // Library 10 MPI_Init(…); // Library 11 MPI_Init(…); // Library 12 MPI_Init(…); // Library 2 MPI_Init(…); // Library 1 MPI_Init(…);
  8. 8. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 8 Do you have to call MPI_FINALIZE exactly that many times? Do you allow MPI_INIT after MPI_FINALIZE? Or perhaps you only allow MPI_INIT before MPI has been finalized? How can you tell if it’s safe to call MPI_INIT? Atomic “test-and-init”? I IS CONFUSED
  9. 9. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
  10. 10. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 10© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 10 The following are just (incomplete) crazy ideas WARNING!
  11. 11. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 11 int my_thread1_main(void *context) { MPI_Session session; MPI_Session_create(…, &session); // Do MPI things MPI_Session_free(&session); } int my_thread2_main(void *context) { MPI_Session session; MPI_Session_create(…, &session); // Do MPI things MPI_Session_free(&session); } int main(int argc, char **argv) { pthread_create(…, my_thread1_main, NULL); pthread_create(…, my_thread2_main, NULL); … }
  12. 12. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 12 int my_thread1_main(void *context) { MPI_Session session; MPI_Session_create(…, &session); // Do MPI things MPI_Session_free(&session); } int my_thread2_main(void *context) { MPI_Session session; MPI_Session_create(…, &session); // Do MPI things MPI_Session_free(&session); } int main(int argc, char **argv) { pthread_create(…, my_thread1_main, NULL); pthread_create(…, my_thread2_main, NULL); … }
  13. 13. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 13 int my_thread1_main(void *context) { MPI_Session session; MPI_Session_create(&session); MPI_Comm_create_from_session(session, &comm) // Do MPI things with comm MPI_Comm_free(&comm); MPI_Session_free(&session); } int my_thread1_main(void *context) { MPI_Session session; MPI_Session_create(&session); MPI_Comm_create_from_session(session, &comm) // Do MPI things with comm MPI_Comm_free(&comm); MPI_Session_free(&session); }
  14. 14. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 14 Each entity (library?) in an OS process can have its own session Any session-local state can be encapsulated in the handle Entities can create / destroy sessions at any time …in any thread
  15. 15. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 15
  16. 16. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 16 • When is MPI_COMM_WORLD created (and/or initialized)? • When is MPI_COMM_WORLD destroyed? • Can you use MPI_COMM_WORLD with any session?  There doesn’t seem to be an obvious relation between MCW and individual sessions (ditto for MPI_COMM_SELF)
  17. 17. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
  18. 18. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 18 • Addresses logical inconsistency with session concept • Clean separation of communicators between sub-entities …maybe slightly better than we have it today (sub-entities dup’ing COMM_WORLD) • Side effects: Fault tolerance issues become easier Opens some possibilities for scalability improvements
  19. 19. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 19 • Users will riot …but what if they don’t?
  20. 20. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 20 • What would be the forward / backward compatibility strategy? E.g., deprecate INIT, FINALIZE, INITIALIZED, FINALIZED…? • What are the other arguments to MPI_SESSION_CREATE? • Can you call both MPI_INIT and MPI_SESSION_CREATE in the same process? • Can you do anything else with a session?
  21. 21. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
  22. 22. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 22© 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 22 Come to MPI Forum meetings Discuss this and other scintillating MPI topics
  23. 23. © 2015 Cisco and/or its affiliates. All rights reserved. Cisco Public 23 Thank you.
  • mkurnosov

    Oct. 4, 2015

This is one of two mini-talks that I gave at Euro MPI 2015 / Bordeaux. It's mainly a taste of the kinds of discussions that we have at the MPI Forum. This particular talk is about some thoughts I've had about revamping MPI_INIT and MPI_FINALIZE. It is by NO means a finalized proposal -- it's mainly to give you an idea of the scope of ideas that are routinely discussed at the Forum. ...hey, you should attend MPI Forum meetings and see for yourself!

Views

Total views

1,833

On Slideshare

0

From embeds

0

Number of embeds

1,065

Actions

Downloads

5

Shares

0

Comments

0

Likes

1

×