Pop bubbles discovered previously. */
| 1008 | |
| 1009 | /** Pop bubbles discovered previously. */ |
| 1010 | size_t NetworkSequenceCollection:: |
| 1011 | performNetworkPopBubbles(ostream& out) |
| 1012 | { |
| 1013 | Timer timer("NetworkPopBubbles"); |
| 1014 | |
| 1015 | // Deal with any packets still in the queue. The barrier |
| 1016 | // synchronization guarantees that the packets have been |
| 1017 | // delivered, but we may not have dealt with them yet. |
| 1018 | pumpNetwork(); |
| 1019 | assert(m_comm.receiveEmpty()); |
| 1020 | |
| 1021 | size_t numPopped = 0; |
| 1022 | for (BranchGroupMap::iterator iter = m_bubbles.begin(); |
| 1023 | iter != m_bubbles.end(); iter++) { |
| 1024 | assert(iter->second.getStatus() == BGS_JOINED); |
| 1025 | // Check whether this bubble has already been popped. |
| 1026 | if (!iter->second.isAmbiguous(m_data)) |
| 1027 | continue; |
| 1028 | numPopped++; |
| 1029 | AssemblyAlgorithms::writeBubble(out, |
| 1030 | iter->second, m_numPopped + numPopped); |
| 1031 | AssemblyAlgorithms::collapseJoinedBranches( |
| 1032 | this, iter->second); |
| 1033 | assert(!iter->second.isAmbiguous(m_data)); |
| 1034 | assert(m_comm.receiveEmpty()); |
| 1035 | } |
| 1036 | m_bubbles.clear(); |
| 1037 | out.flush(); |
| 1038 | assert(out.good()); |
| 1039 | |
| 1040 | logger(0) << "Removed " << numPopped << " bubbles.\n"; |
| 1041 | return numPopped; |
| 1042 | } |
| 1043 | |
| 1044 | // |
| 1045 | // Process groups that are finished searching for bubbles |
nothing calls this directly
no test coverage detected