| Home | Libraries | People | FAQ | More

## Function test_all

boost::mpi::test_all — Tests whether all non-blocking requests have completed.

## Synopsis

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

    template<typename ForwardIterator, typename OutputIterator>
      optional< OutputIterator >
      test_all(ForwardIterator first, ForwardIterator last, OutputIterator out);
    template<typename ForwardIterator>
      bool test_all(ForwardIterator first, ForwardIterator last);

## Description

This routine takes in a set of requests stored in the iterator range ``[first,last) and determines whether all of these requests have been completed. However, due to limitations of the underlying MPI implementation, if any of the requests refers to a non-blocking send or receive of a serialized data type, `test_all` will always return the equivalent of `false` (i.e., the requests cannot all be finished at this time). This routine performs the same functionality as `wait_all`, except that this routine will not block. This routine provides functionality equivalent to `MPI_Testall`.

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.
`out` | If provided and all requests hav been completed, an output iterator through which the status of each request will be emitted. The `status` objects are emitted in the same order as the requests are retrieved from ``[first,last).

Returns: | If an `out` parameter was provided, the value `out` after all of the `status` objects have been emitted (if all requests were completed) or an empty `optional<>`. If no `out` parameter was provided, returns `true` if all requests have completed or `false` otherwise.