Commit cada47cb authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Merge branch 'SendRecvLargeMessagesManyProc'

parents 01be34ff 6f878a67
......@@ -100,3 +100,8 @@ 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.)
icetSendRecvLargeMessages takes const array for messageDestinations.
......@@ -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,
......@@ -360,8 +365,9 @@ ICET_EXPORT void icetDiagnostics(IceTBitField mask);
#define ICET_DATA_REP_GROUP_BUF (ICET_CORE_BUFFER_START | (IceTEnum)0x0003)
#define ICET_COMM_COUNT_BUF (ICET_CORE_BUFFER_START | (IceTEnum)0x0004)
#define ICET_COMM_OFFSET_BUF (ICET_CORE_BUFFER_START | (IceTEnum)0x0005)
#define ICET_IMAGE_COLLECT_OFFSET_BUF (ICET_CORE_BUFFER_START | (IceTEnum)0x0006)
#define ICET_IMAGE_COLLECT_SIZE_BUF (ICET_CORE_BUFFER_START | (IceTEnum)0x0007)
#define ICET_STRATEGY_COMMON_BUF_0 (ICET_CORE_BUFFER_START | (IceTEnum)0x0006)
#define ICET_STRATEGY_COMMON_BUF_1 (ICET_CORE_BUFFER_START | (IceTEnum)0x0007)
#define ICET_STRATEGY_COMMON_BUF_2 (ICET_CORE_BUFFER_START | (IceTEnum)0x0008)
#define ICET_RENDER_LAYER_BUFFER_START (ICET_STATE_BUFFER_START | (IceTEnum)0x0010)
#define ICET_RENDER_LAYER_BUFFER_END (ICET_STATE_BUFFER_START | (IceTEnum)0x0020)
......
......@@ -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,
......
This diff is collapsed.
......@@ -96,8 +96,10 @@ void icetRenderTransferSparseImages(IceTSparseImage compositeImage1,
messageDestinations - An array of size numMessagesSending that contains
the ranks of message destinations.
messagesInOrder - If true, then messages will be received in the order
specified by the ICET_PROCESS_ORDERS state variable. If false,
messages may come in an arbitrary order.
specified by the ICET_PROCESS_ORDERS state variable. The locally
generated message will come in first, followed by messages adjacent to
either the left or right. If messagesInOrder is false, messages may
come in an arbitrary order.
generateDataFunc - A callback function that generates messages. The
function is given the index in messageDestinations and the rank of
the destination as arguments. The data of the message and the size
......@@ -118,7 +120,7 @@ typedef IceTVoid *(*IceTGenerateData)(IceTInt id, IceTInt dest,
IceTSizeType *size);
typedef void (*IceTHandleData)(void *buffer, IceTInt src);
void icetSendRecvLargeMessages(IceTInt numMessagesSending,
IceTInt *messageDestinations,
const IceTInt *messageDestinations,
IceTBoolean messagesInOrder,
IceTGenerateData generateDataFunc,
IceTHandleData handleDataFunc,
......
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