From 0d8aa9c874605914a4ce69f3c991d5e3485eb028 Mon Sep 17 00:00:00 2001 From: Jussi Enkovaara Date: Tue, 14 Sep 2021 16:03:15 +0300 Subject: [PATCH] More MPI functions --- docs/mpi-reference.md | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/docs/mpi-reference.md b/docs/mpi-reference.md index b75e077..4f03669 100644 --- a/docs/mpi-reference.md +++ b/docs/mpi-reference.md @@ -150,6 +150,8 @@ int MPI_Waitall(int count, MPI_Request *array_of_requests, MPI_Status *array_of_ int MPI_Cart_create(MPI_Comm old_comm, int ndims, int *dims, int *periods, int reorder, MPI_Comm *comm_cart) +int MPI_Dims_create(int ntasks, int ndims, int *dims); + int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdim, int *coords) int MPI_Cart_rank(MPI_Comm comm, int *coords, int rank) @@ -157,6 +159,45 @@ int MPI_Cart_rank(MPI_Comm comm, int *coords, int rank) int MPI_Cart_shift( MPI_Comm comm, int direction, int displ, int *low, int *high ) ``` +# C interfaces for persistent communication + +```c +int MPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dest, int tag, + MPI_Comm comm, MPI_Request *request ) + +int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source, int tag, + MPI_Comm comm, MPI_Request *request ) + +int MPI_Start(MPI_Request *request) + +int MPI_Startall(int count, MPI_Request *array_of_requests); +``` + +# C interfaces for neighborhood collectives + +```c +int MPI_Neighbor_allgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_datatype recvtype, MPI_Comm comm); + +int MPI_Neighbor_allgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int* recvcounts, int* displs, MPI_datatype recvtype, + MPI_Comm comm); + +int MPI_Neighbor_alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, + void* recvbuf, int recvcount, MPI_datatype recvtype, + MPI_Comm comm); + +int MPI_Neighbor_alltoallv(void* sendbuf, int* sendcounts, int* senddispls, MPI_Datatype sendtype, + void* recvbuf, int* recvcounts, int* recvdispls, MPI_datatype recvtype, + MPI_Comm comm); + +int MPI_Neighbor_alltoallw(void* sendbuf, int* sendcounts, int* senddispls, MPI_Datatype* sendtypes, + void* recvbuf, int* recvcounts, int* recvdispls, MPI_datatype* recvtypes, + MPI_Comm comm); + +``` + + # C interfaces for datatype routines ```c @@ -496,6 +537,9 @@ mpi_cart_create(old_comm, ndims, dims, periods, reorder, comm_cart, ierror) type(mpi_comm) :: old_comm, comm_cart logical :: reorder, periods(:) +mpi_dims_create(ntasks, ndims, dims, ierror) + integer :: ntasks, ndims, dims(:), ierror + mpi_cart_coords(comm, rank, maxdim, coords, ierror) integer :: rank, maxdim, coords(:), ierror type(mpi_comm) :: comm @@ -509,6 +553,77 @@ mpi_cart_shift(comm, direction, displ, low, high, ierror) type(mpi_comm) :: comm ``` +# Fortran interfaces for persistent communication + + +```fortran +mpi_send_init(buf, count, datatype, dest, tag, comm, request,ierror) + :: buf(*) + integer :: count, dest, tag, ierror + type(mpi_datatype) :: datatype + type(mpi_request) :: request + type(mpi_comm) :: comm + +mpi_recv_init(buf, count, datatype, source, tag, comm, request,ierror) + :: buf(*) + integer :: count, source, tag, ierror + type(mpi_datatype) :: datatype + type(mpi_request) :: request + type(mpi_comm) :: comm + +mpi_start(request, ierror) + integer :: ierror + type(mpi_request) :: request + +mpi_startall(count, array_of_requests, ierror) + integer :: count, ierror + type(mpi_request) :: array_of_requests(:) +``` + + +# Fortran interfaces for neighborhood collectives + +```fortran +mpi_neighbor_allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, ierror) + :: sendbuf(*), recvbuf(*) + integer :: sendcount, recvcount, ierror + type(mpi_datatype) :: sendtype, recvtype + type(mpi_comm) :: comm + +mpi_neighbor_allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, & + comm, ierror) + :: sendbuf(*), recvbuf(*) + integer :: sendcount, recvcounts(:), displs(:), ierror + type(mpi_datatype) :: sendtype, recvtype + type(mpi_comm) :: comm + +mpi_neighbor_alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, ierror) + :: sendbuf(*), recvbuf(*) + integer :: sendcount, recvcount, ierror + type(mpi_datatype) :: sendtype, recvtype + type(mpi_comm) :: comm + +``` + +# Fortran interfaces for neighborhood collectives + +```fortran +mpi_neighbor_alltoallv(sendbuf, sendcounts, sendtype, senddispls, & + recvbuf, recvcounts, recvdispls, recvtype, comm, ierror) + :: sendbuf(*), recvbuf(*) + integer :: sendcounts(:), recvcounts(:), senddispls(:), recvdispls(:), ierror + type(mpi_datatype) :: sendtype, recvtype + type(mpi_comm) :: comm + +mpi_neighbor_alltoallw(sendbuf, sendcounts, sendtypes, senddispls, & + recvbuf, recvcounts, recvdispls, recvtypes, comm, ierror) + :: sendbuf(*), recvbuf(*) + integer :: sendcounts(:), recvcounts(:), senddispls(:), recvdispls(:), ierror + type(mpi_datatype) :: sendtypes(:), recvtypes(:) + type(mpi_comm) :: comm + +``` + # Fortran interfaces for datatype routines