1 / 20

POE ( P artial O rder reduction avoiding E lusive interleavings)

POE ( P artial O rder reduction avoiding E lusive interleavings). In this presentation let see how works POE algorithm thru an example with a DEADLOCK. Example #1. P 0. P 1. P 2. void Scheduler::generateFirstInterleaving () { ... while (count) {

maj
Download Presentation

POE ( P artial O rder reduction avoiding E lusive interleavings)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. POE (Partial Order reduction avoiding Elusive interleavings) In thispresentationletseehowworks POE algorithmthruanexamplewith a DEADLOCK

  2. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if (_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize()

  3. Initially _runQ[i]->_read_next_env == true Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if (_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... (count == nprocs)== 3 Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize()

  4. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Not-Blocking Type

  5. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Not-Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true

  6. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true i = 2 - _runQ[2]->read_next_env = false Barrier()

  7. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... (count == nprocs)== 3 Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Barrier() - _runQ[0]->read_next_env = false Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true i = 2 Barrier() - _runQ[2]->read_next_env = false

  8. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Barrier() - _runQ[0]->read_next_env = false Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true Barrier() - _runQ[1]->read_next_env = false i = 2 Barrier() - _runQ[2]->read_next_env = false

  9. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() false i = 0 Isend(P1) - _runQ[0]->read_next_env = true Barrier() Barrier() - _runQ[0]->read_next_env = false - _runQ[1]->read_next_env = false i = 1 Irecv(*) - _runQ[1]->read_next_env = true i = 2 Barrier() - _runQ[2]->read_next_env = false

  10. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { … while (!hasMoreEnvelopeToRead ()) { it->CHECK (*this, l); iter_end = l.end(); if (Scheduler::_probed) { assert (l.size() <= 2); _runQ[l.back()]->_read_next_env = true; Scheduler::_probed = false; } else { for (iter = l.begin (); iter != iter_end; iter++) { _runQ[*iter]->_read_next_env = true; } } } } } Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() _runQ[i]->read_next_env = false for i=0 to nprocs Finds out Enabled Transition Forms Match-Set in Priority • Barrier/Collectives • Wait • Non-Wildcards • Wildcards

  11. Match-Set in Priority, in this case Barrier/Collectives and Wildcards Example #1 P0 P1 P2 P2 P1 P0 void Scheduler::generateFirstInterleaving () { … while (!hasMoreEnvelopeToRead ()) { it->CHECK (*this, l); iter_end = l.end(); if (Scheduler::_probed) { assert (l.size() <= 2); _runQ[l.back()]->_read_next_env = true; Scheduler::_probed = false; } else { for (iter = l.begin (); iter != iter_end; iter++) { _runQ[*iter]->_read_next_env = true; } } } } } Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() Forms Match-Set in Priority Finds out Enabled Transition Isend(P1) Barrier() Irecv(*) Barrier() Barrier()

  12. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { … while (!hasMoreEnvelopeToRead ()) { it->CHECK (*this, l); iter_end = l.end(); if (Scheduler::_probed) { assert (l.size() <= 2); _runQ[l.back()]->_read_next_env = true; Scheduler::_probed = false; } else { for (iter = l.begin (); iter != iter_end; iter++) { _runQ[*iter]->_read_next_env = true; } } } } } Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() Forms Match-Set before with Barrier • Send “GoAhead” to Profiler • Profiler issues the Barrier with PMPI_Execute • All _runQ[i]->read_next_event are TRUE • Re-back in the WHILE and FOR Loop

  13. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... (count == nprocs)== 3 Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Not-Blocking Type

  14. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Not-Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true

  15. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true Not-Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true i = 2 - _runQ[2]->read_next_env = true Isend(P1)

  16. Example #1 P1 P2 P0 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... (count == nprocs)== 3 Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true - _runQ[0]->read_next_env = false Wait() Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true i = 2 - _runQ[2]->read_next_env = true Isend(P1)

  17. Example #1 P2 P1 P0 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true - _runQ[0]->read_next_env = false Wait() Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true - _runQ[1]->read_next_env = false Wait() i = 2 - _runQ[2]->read_next_env = true Isend(P1)

  18. Example #1 P2 P1 P0 void Scheduler::generateFirstInterleaving () { ... while (count) { for (int i = 0 ; i < nprocs; i++) { if(_runQ[i]->_read_next_env) { t = getTransition (i); … if(! t->GetEnvelope ()->isBlockingType ()) { std::cout.flush(); Send (i, goback); } else { _runQ[i]->_read_next_env = false; } if (t->GetEnvelope ()->func_id == FINALIZE) { _runQ[i]->_read_next_env = false count--; } } } ... Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() true i = 0 Isend(P1) - _runQ[0]->read_next_env = true - _runQ[0]->read_next_env = false Wait() Blocking Type i = 1 Irecv(*) - _runQ[1]->read_next_env = true - _runQ[1]->read_next_env = false Wait() i = 2 - _runQ[2]->read_next_env = true Isend(P1) - _runQ[2]->read_next_env = false Wait()

  19. Example #1 P0 P1 P2 void Scheduler::generateFirstInterleaving () { … while (!hasMoreEnvelopeToRead ()) { it->CHECK (*this, l); iter_end = l.end(); if (Scheduler::_probed) { assert (l.size() <= 2); _runQ[l.back()]->_read_next_env = true; Scheduler::_probed = false; } else { for (iter = l.begin (); iter != iter_end; iter++) { _runQ[*iter]->_read_next_env = true; } } } } } Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() _runQ[i]->read_next_env = false for i=0 to nprocs Finds out Enabled Transition Forms Match-Set in Priority • Barrier/Collectives • Wait • Non-Wildcards • Wildcards

  20. Match-Set in Priority, in this case onlyWildcards Example #1 P0 P0 P1 P2 P2 P1 void Scheduler::generateFirstInterleaving () { … while (!hasMoreEnvelopeToRead ()) { it->CHECK (*this, l); iter_end = l.end(); if (Scheduler::_probed) { assert (l.size() <= 2); _runQ[l.back()]->_read_next_env = true; Scheduler::_probed = false; } else { for (iter = l.begin (); iter != iter_end; iter++) { _runQ[*iter]->_read_next_env = true; } } } } } Irecv(*) Isend(P1) Barrier() Barrier() Barrier() Isend(P1) Wait() Wait() Wait() Finalize() Finalize() Finalize() Forms Match-Set in Priority Finds out Enabled Transition DEADLOCK Isend(P1) Two probable matches (2 possible interleavings)… • …but in both cases there is a DEADLOCK, because one Isend(P1) does not have a match. Irecv(*) Isend(P1) DEADLOCK

More Related