SYNTAX
------

C Syntax
^^^^^^^^

.. code-block:: c

    int MPI_Allreduce(const void* sendbuf, void* recvbuf, int count,
        MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)

    int MPI_Allreduce_c(const void* sendbuf, void* recvbuf, MPI_Count
        count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)

    int MPI_Iallreduce(const void* sendbuf, void* recvbuf, int count,
        MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request*
        request)

    int MPI_Iallreduce_c(const void* sendbuf, void* recvbuf, MPI_Count
        count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm,
        MPI_Request* request)

    int MPI_Allreduce_init(const void* sendbuf, void* recvbuf, int
        count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Info
        info, MPI_Request* request)

    int MPI_Allreduce_init_c(const void* sendbuf, void* recvbuf,
        MPI_Count count, MPI_Datatype datatype, MPI_Op op, MPI_Comm
        comm, MPI_Info info, MPI_Request* request)

Fortran Syntax
^^^^^^^^^^^^^^

.. code-block:: fortran

    USE MPI
    ! or the older form: INCLUDE 'mpif.h'
    MPI_ALLREDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, IERROR)
    	<type> SENDBUF(*), RECVBUF(*)
    	INTEGER COUNT, DATATYPE, OP, COMM, IERROR

    MPI_IALLREDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, REQUEST, IERROR)
    	<type> SENDBUF(*), RECVBUF(*)
    	INTEGER COUNT, DATATYPE, OP, COMM, REQUEST, IERROR

    MPI_ALLREDUCE_INIT(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, INFO, REQUEST, IERROR)
    	<type> SENDBUF(*), RECVBUF(*)
    	INTEGER COUNT, DATATYPE, OP, COMM, INFO, REQUEST, IERROR

Fortran 2008 Syntax
^^^^^^^^^^^^^^^^^^^

.. code-block:: fortran

    USE mpi_f08
    MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm, ierror)
    	TYPE(*), DIMENSION(..), INTENT(IN) :: sendbuf
    	TYPE(*), DIMENSION(..) :: recvbuf
    	INTEGER, INTENT(IN) :: count
    	TYPE(MPI_Datatype), INTENT(IN) :: datatype
    	TYPE(MPI_Op), INTENT(IN) :: op
    	TYPE(MPI_Comm), INTENT(IN) :: comm
    	INTEGER, OPTIONAL, INTENT(OUT) :: ierror

    MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm, ierror)
    	TYPE(*), DIMENSION(..), INTENT(IN) :: sendbuf
    	TYPE(*), DIMENSION(..) :: recvbuf
    	INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: count
    	TYPE(MPI_Datatype), INTENT(IN) :: datatype
    	TYPE(MPI_Op), INTENT(IN) :: op
    	TYPE(MPI_Comm), INTENT(IN) :: comm
    	INTEGER, OPTIONAL, INTENT(OUT) :: ierror

    MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request, ierror)
    	TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: sendbuf
    	TYPE(*), DIMENSION(..), ASYNCHRONOUS :: recvbuf
    	INTEGER, INTENT(IN) :: count
    	TYPE(MPI_Datatype), INTENT(IN) :: datatype
    	TYPE(MPI_Op), INTENT(IN) :: op
    	TYPE(MPI_Comm), INTENT(IN) :: comm
    	TYPE(MPI_Request), INTENT(OUT) :: request
    	INTEGER, OPTIONAL, INTENT(OUT) :: ierror

    MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, request, ierror)
    	TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: sendbuf
    	TYPE(*), DIMENSION(..), ASYNCHRONOUS :: recvbuf
    	INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: count
    	TYPE(MPI_Datatype), INTENT(IN) :: datatype
    	TYPE(MPI_Op), INTENT(IN) :: op
    	TYPE(MPI_Comm), INTENT(IN) :: comm
    	TYPE(MPI_Request), INTENT(OUT) :: request
    	INTEGER, OPTIONAL, INTENT(OUT) :: ierror

    MPI_Allreduce_init(sendbuf, recvbuf, count, datatype, op, comm, info, request, ierror)
    	TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: sendbuf
    	TYPE(*), DIMENSION(..), ASYNCHRONOUS :: recvbuf
    	INTEGER, INTENT(IN) :: count
    	TYPE(MPI_Datatype), INTENT(IN) :: datatype
    	TYPE(MPI_Op), INTENT(IN) :: op
    	TYPE(MPI_Comm), INTENT(IN) :: comm
    	TYPE(MPI_Info), INTENT(IN) :: info
    	TYPE(MPI_Request), INTENT(OUT) :: request
    	INTEGER, OPTIONAL, INTENT(OUT) :: ierror

    MPI_Allreduce_init(sendbuf, recvbuf, count, datatype, op, comm, info, request, ierror)
    	TYPE(*), DIMENSION(..), INTENT(IN), ASYNCHRONOUS :: sendbuf
    	TYPE(*), DIMENSION(..), ASYNCHRONOUS :: recvbuf
    	INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: count
    	TYPE(MPI_Datatype), INTENT(IN) :: datatype
    	TYPE(MPI_Op), INTENT(IN) :: op
    	TYPE(MPI_Comm), INTENT(IN) :: comm
    	TYPE(MPI_Info), INTENT(IN) :: info
    	TYPE(MPI_Request), INTENT(OUT) :: request
    	INTEGER, OPTIONAL, INTENT(OUT) :: ierror
