| Home | Libraries | People | FAQ | More

## Function wait_some

boost::mpi::wait_some — Wait until some non-blocking requests have completed.

## Synopsis

    // In header: <boost/mpi/nonblocking.hpp>

    template<typename BidirectionalIterator, typename OutputIterator>
      std::pair< OutputIterator, BidirectionalIterator >
      wait_some(BidirectionalIterator first, BidirectionalIterator last,
                OutputIterator out);
    template<typename BidirectionalIterator>
      BidirectionalIterator
      wait_some(BidirectionalIterator first, BidirectionalIterator last);

## Description

This routine takes in a set of requests stored in the iterator range ``[first,last) and waits until at least one of the requests has completed. It then completes all of the requests it can, partitioning the input sequence into pending requests followed by completed requests. If an output iterator is provided, `status` objects will be emitted for each of the completed requests. This routine provides functionality equivalent to `MPI_Waitsome`.

Parameters: |
`first` | The iterator that denotes the beginning of the sequence of request objects.
`last` | The iterator that denotes the end of the sequence of request objects. This may not be equal to `first`.
`out` | If provided, the `status` objects corresponding to completed requests will be emitted through this output iterator.
Returns: | If the `out` parameter was provided, a pair containing the output iterator `out` after all of the `status` objects have been written through it and an iterator referencing the first completed request. If no `out` parameter was provided, only the iterator referencing the first completed request will be emitted.