Commit d0cfaf91 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

correcting conversion of int to MPI_Comm in DSM

parent c6357a27
...@@ -701,12 +701,13 @@ XdmfDSMBuffer::ReceiveAcknowledgment(int source, int &data, int tag, int comm) ...@@ -701,12 +701,13 @@ XdmfDSMBuffer::ReceiveAcknowledgment(int source, int &data, int tag, int comm)
&signalStatus); &signalStatus);
} }
else { else {
MPI_Comm tempComm = MPI_Comm_f2c(comm);
status = MPI_Recv(&data, status = MPI_Recv(&data,
sizeof(int), sizeof(int),
MPI_UNSIGNED_CHAR, MPI_UNSIGNED_CHAR,
source, source,
tag, tag,
comm, tempComm,
&signalStatus); &signalStatus);
} }
...@@ -752,12 +753,13 @@ XdmfDSMBuffer::ReceiveCommandHeader(int *opcode, int *source, int *address, int ...@@ -752,12 +753,13 @@ XdmfDSMBuffer::ReceiveCommandHeader(int *opcode, int *source, int *address, int
} }
else { else {
// In this case the integer is probably a pointer to an MPI_Comm object // In this case the integer is probably a pointer to an MPI_Comm object
MPI_Comm tempComm = MPI_Comm_f2c(comm);
status = MPI_Recv(&cmd, status = MPI_Recv(&cmd,
sizeof(CommandMsg), sizeof(CommandMsg),
MPI_UNSIGNED_CHAR, MPI_UNSIGNED_CHAR,
remoteSource, remoteSource,
XDMF_DSM_COMMAND_TAG, XDMF_DSM_COMMAND_TAG,
comm, tempComm,
&signalStatus); &signalStatus);
} }
...@@ -801,12 +803,13 @@ XdmfDSMBuffer::ReceiveData(int source, char * data, int aLength, int tag, int aA ...@@ -801,12 +803,13 @@ XdmfDSMBuffer::ReceiveData(int source, char * data, int aLength, int tag, int aA
&signalStatus); &signalStatus);
} }
else { else {
MPI_Comm tempComm = MPI_Comm_f2c(comm);
status = MPI_Recv(data, status = MPI_Recv(data,
aLength, aLength,
MPI_UNSIGNED_CHAR, MPI_UNSIGNED_CHAR,
source, source,
tag, tag,
comm, tempComm,
&signalStatus); &signalStatus);
} }
if (status != MPI_SUCCESS) { if (status != MPI_SUCCESS) {
...@@ -902,12 +905,13 @@ XdmfDSMBuffer::SendAcknowledgment(int dest, int data, int tag, int comm) ...@@ -902,12 +905,13 @@ XdmfDSMBuffer::SendAcknowledgment(int dest, int data, int tag, int comm)
static_cast<XdmfDSMCommMPI *>(this->Comm)->GetInterComm()); static_cast<XdmfDSMCommMPI *>(this->Comm)->GetInterComm());
} }
else { else {
MPI_Comm tempComm = MPI_Comm_f2c(comm);
status = MPI_Send(&data, status = MPI_Send(&data,
sizeof(int), sizeof(int),
MPI_UNSIGNED_CHAR, MPI_UNSIGNED_CHAR,
dest, dest,
tag, tag,
comm); tempComm);
} }
if (status != MPI_SUCCESS) { if (status != MPI_SUCCESS) {
try { try {
...@@ -952,12 +956,13 @@ XdmfDSMBuffer::SendCommandHeader(int opcode, int dest, int address, int aLength, ...@@ -952,12 +956,13 @@ XdmfDSMBuffer::SendCommandHeader(int opcode, int dest, int address, int aLength,
} }
else { else {
// In this case the comm should be a pointer to an MPI_Comm object // In this case the comm should be a pointer to an MPI_Comm object
MPI_Comm tempComm = MPI_Comm_f2c(comm);
status = MPI_Send(&cmd, status = MPI_Send(&cmd,
sizeof(CommandMsg), sizeof(CommandMsg),
MPI_UNSIGNED_CHAR, MPI_UNSIGNED_CHAR,
dest, dest,
XDMF_DSM_COMMAND_TAG, XDMF_DSM_COMMAND_TAG,
comm); tempComm);
} }
if (status != MPI_SUCCESS) { if (status != MPI_SUCCESS) {
try { try {
...@@ -990,7 +995,8 @@ XdmfDSMBuffer::SendData(int dest, char * data, int aLength, int tag, int aAddres ...@@ -990,7 +995,8 @@ XdmfDSMBuffer::SendData(int dest, char * data, int aLength, int tag, int aAddres
static_cast<XdmfDSMCommMPI *>(this->Comm)->GetInterComm()); static_cast<XdmfDSMCommMPI *>(this->Comm)->GetInterComm());
} }
else { else {
status = MPI_Send(data, aLength, MPI_UNSIGNED_CHAR, dest, tag, comm); MPI_Comm tempComm = MPI_Comm_f2c(comm);
status = MPI_Send(data, aLength, MPI_UNSIGNED_CHAR, dest, tag, tempComm);
} }
if (status != MPI_SUCCESS) { if (status != MPI_SUCCESS) {
try { try {
......
Markdown is supported
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