Commit 537cf837 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Added icetCommAlltoall collective communication function.

parent 2b735471
......@@ -100,3 +100,6 @@ ICET_MAX_IMAGE_SPLIT environment variable, cmake variable, state variable
All the matrix math helpers icetMatrix* in IceTDevMatrix.h
Const versions of icetImageGetColor* and icetImageGetDepth* functions.
Added Alltoall to communicator. (Search for Allgather for places to add in
documentation.)
......@@ -66,6 +66,11 @@ static void Allgather(IceTCommunicator self,
int sendcount,
IceTEnum datatype,
void *recvbuf);
static void Alltoall(IceTCommunicator self,
const void *sendbuf,
int sendcount,
IceTEnum datatype,
void *recvbuf);
static IceTCommRequest Isend(IceTCommunicator self,
const void *buf,
int count,
......@@ -196,6 +201,7 @@ IceTCommunicator icetCreateMPICommunicator(MPI_Comm mpi_comm)
comm->Gather = Gather;
comm->Gatherv = Gatherv;
comm->Allgather = Allgather;
comm->Alltoall = Alltoall;
comm->Isend = Isend;
comm->Irecv = Irecv;
comm->Wait = Waitone;
......@@ -365,6 +371,20 @@ static void Allgather(IceTCommunicator self,
MPI_COMM);
}
static void Alltoall(IceTCommunicator self,
const void *sendbuf,
int sendcount,
IceTEnum datatype,
void *recvbuf)
{
MPI_Datatype mpitype;
CONVERT_DATATYPE(datatype, mpitype);
MPI_Alltoall((void *)sendbuf, sendcount, mpitype,
recvbuf, sendcount, mpitype,
MPI_COMM);
}
static IceTCommRequest Isend(IceTCommunicator self,
const void *buf,
int count,
......
......@@ -158,6 +158,17 @@ void icetCommAllgather(const void *sendbuf,
comm->Allgather(comm, sendbuf, (int)sendcount, datatype, recvbuf);
}
void icetCommAlltoall(const void *sendbuf,
IceTSizeType sendcount,
IceTEnum datatype,
void *recvbuf)
{
IceTCommunicator comm = icetGetCommunicator();
icetCommCheckCount(sendcount);
icetAddSent(sendcount, datatype);
comm->Alltoall(comm, sendbuf, (int)sendcount, datatype, recvbuf);
}
IceTCommRequest icetCommIsend(const void *buf,
IceTSizeType count,
IceTEnum datatype,
......
......@@ -94,6 +94,11 @@ struct IceTCommunicatorStruct {
int sendcount,
IceTEnum datatype,
void *recvbuf);
void (*Alltoall)(struct IceTCommunicatorStruct *self,
const void *sendbuf,
int sendcount,
IceTEnum datatype,
void *recvbuf);
IceTCommRequest (*Isend)(struct IceTCommunicatorStruct *self,
const void *buf,
......
......@@ -59,6 +59,10 @@ ICET_EXPORT void icetCommAllgather(const void *sendbuf,
IceTSizeType sendcount,
IceTEnum type,
void *recvbuf);
ICET_EXPORT void icetCommAlltoall(const void *sendbuf,
IceTSizeType sendcount,
IceTEnum type,
void *recvbuf);
ICET_EXPORT IceTCommRequest icetCommIsend(const void *buf,
IceTSizeType count,
IceTEnum datatype,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment