..
   Generated automatically by cpp2rst

.. highlight:: c
.. role:: red
.. role:: green
.. role:: param


.. _mpi__mpi_gather:

mpi::mpi_gather
===============

*#include <mpi.hpp>*



**Synopsis**

 .. rst-class:: cppsynopsis

       | :green:`template<typename T>`
       | std::vector<T> :red:`mpi_gather` (std::vector<T> const & :param:`v`, :ref:`communicator <mpi__communicator>` :param:`c` = {}, int :param:`root` = 0, bool :param:`all` = false)











Template parameters
^^^^^^^^^^^^^^^^^^^

 * :param:`T` Value type of the vector.


Parameters
^^^^^^^^^^

 * :param:`v` std::vector to gather.

 * :param:`c` mpi::communicator.

 * :param:`root` Rank of the root process.

 * :param:`all` Should all processes receive the result of the reduction.


Returns
^^^^^^^

std::vector containing the result of the gather operation.