39 using namespace G4mpi;
41 std::sort(input.begin(),input.end());
42 if ( input.size() < 1 || input[0] != 0 ) {
44 "Empty input or cannot find rank 0 in input.");
47 std::vector<rank_t> copy(input.size());
48 std::copy(input.begin(),input.end(),copy.begin());
49 copy.erase( std::unique(copy.begin(),copy.end()),copy.end());
53 "There are duplicates in list of input ranks.");
61 std::vector<couple_t> couples;
65 std::vector<rank_t> receiving;
69 while ( input.size() > 1 ) {
71 std::sort( input.begin(),input.end() );
73 const auto& send_ = input.back();
75 const auto& rec_ = input.back();
79 receiving.push_back( rec_ );
81 couples.push_back( std::make_pair(send_,rec_) );
84 mymap[cycle++]=couples;
86 input.insert( input.end() , receiving.begin() , receiving.end() );
88 }
while ( input.size()!=1 );
std::map< int, std::vector< couple_t > > commMap_t
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)