| Home | Libraries | People | FAQ | More

## Function scatterv

boost::mpi::scatterv — Similar to boost::mpi::scatter with the difference that the number of values stored at the root process does not need to be a multiple of the communicator's size.

## Synopsis

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

    template<typename T>
      void scatterv(const communicator & comm, const std::vector< T > & in_values,
                    const std::vector< int > & sizes,
                    const std::vector< int > & displs, T * out_values,
                    int out_size, int root);
    template<typename T>
      void scatterv(const communicator & comm, const T * in_values,
                    const std::vector< int > & sizes,
                    const std::vector< int > & displs, T * out_values,
                    int out_size, int root);
    template<typename T>
      void scatterv(const communicator & comm, T * out_values, int out_size,
                    int root);
    template<typename T>
      void scatterv(const communicator & comm, const T * in_values,
                    const std::vector< int > & sizes, T * out_values, int root);
    template<typename T>
      void scatterv(const communicator & comm, const std::vector< T > & in_values,
                    const std::vector< int > & sizes, T * out_values, int root);

## Description

Parameters: |

`comm` | The communicator over which the scatter will occur.
`displs` | A vector such that the i-th entry specifies the displacement (relative to `in_values`) from which to take the outgoing data to process i. Overloaded versions for which `displs` is omitted assume that the data is contiguous at the `root` process.
`in_values` | A vector or pointer to storage that will contain the values to send to each process, indexed by the process rank. For non-root processes, this parameter may be omitted. If it is still provided, however, it will be unchanged.
`out_size` | For each non-root process this will contain the size of `out_values`.
`out_values` | The array of values received by each process.
`root` | The process ID number that will scatter the values. This value must be the same on all processes.
`sizes` | A vector containing the number of elements each non-root process will receive.