mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Fix mpi 3 interface change
This commit is contained in:
parent
7d88198387
commit
0b0cf62193
@ -621,6 +621,17 @@ void CartesianCommunicator::SendToRecvFromBegin(std::vector<CommsRequest_t> &lis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double CartesianCommunicator::StencilSendToRecvFrom( void *xmit,
|
||||||
|
int dest,
|
||||||
|
void *recv,
|
||||||
|
int from,
|
||||||
|
int bytes,int dir)
|
||||||
|
{
|
||||||
|
std::vector<CommsRequest_t> list;
|
||||||
|
StencilSendToRecvFromBegin(list,xmit,dest,recv,from,bytes,dir);
|
||||||
|
StencilSendToRecvFromComplete(list,dir);
|
||||||
|
}
|
||||||
|
|
||||||
double CartesianCommunicator::StencilSendToRecvFromBegin(std::vector<CommsRequest_t> &list,
|
double CartesianCommunicator::StencilSendToRecvFromBegin(std::vector<CommsRequest_t> &list,
|
||||||
void *xmit,
|
void *xmit,
|
||||||
int dest,
|
int dest,
|
||||||
|
@ -242,17 +242,12 @@ double CartesianCommunicator::StencilSendToRecvFromBegin(std::vector<CommsReques
|
|||||||
int recv_from_rank,
|
int recv_from_rank,
|
||||||
int bytes,int dir)
|
int bytes,int dir)
|
||||||
{
|
{
|
||||||
int myrank = _processor;
|
StencilSendToRecvFrom(xmit,xmit_to_rank,recv,recv_from_rank,bytes,dir);
|
||||||
int ierr;
|
|
||||||
assert(dir < communicator_halo.size());
|
|
||||||
|
|
||||||
ierr=MPI_Sendrecv(xmit,bytes,MPI_CHAR,xmit_to_rank,myrank,
|
|
||||||
recv,bytes,MPI_CHAR,recv_from_rank, recv_from_rank,
|
|
||||||
communicator_halo[dir],MPI_STATUS_IGNORE);
|
|
||||||
assert(ierr==0);
|
|
||||||
return 2.0*bytes;
|
|
||||||
}
|
}
|
||||||
|
void CartesianCommunicator::StencilSendToRecvFromComplete(std::vector<CommsRequest_t> &waitall,int dir)
|
||||||
|
{
|
||||||
|
// Do nothing
|
||||||
|
};
|
||||||
double CartesianCommunicator::StencilSendToRecvFrom(void *xmit,
|
double CartesianCommunicator::StencilSendToRecvFrom(void *xmit,
|
||||||
int xmit_to_rank,
|
int xmit_to_rank,
|
||||||
void *recv,
|
void *recv,
|
||||||
@ -266,17 +261,11 @@ double CartesianCommunicator::StencilSendToRecvFrom(void *xmit,
|
|||||||
// std::cout << " sending on communicator "<<dir<<" " <<communicator_halo[dir]<<std::endl;
|
// std::cout << " sending on communicator "<<dir<<" " <<communicator_halo[dir]<<std::endl;
|
||||||
// Give the CPU to MPI immediately; can use threads to overlap optionally
|
// Give the CPU to MPI immediately; can use threads to overlap optionally
|
||||||
MPI_Request req[2];
|
MPI_Request req[2];
|
||||||
MPI_Irecv(recv,bytes,MPI_CHAR,recv_from_rank,recv_from_rank,
|
MPI_Irecv(recv,bytes,MPI_CHAR,recv_from_rank,recv_from_rank, communicator_halo[dir],&req[1]);
|
||||||
communicator_halo[dir],&req[1]);
|
MPI_Isend(xmit,bytes,MPI_CHAR,xmit_to_rank,myrank, communicator_halo[dir], &req[0]);
|
||||||
MPI_Isend(xmit,bytes,MPI_CHAR,xmit_to_rank,myrank,
|
|
||||||
communicator_halo[dir], &req[0]);
|
|
||||||
MPI_Waitall(2, req, MPI_STATUSES_IGNORE);
|
MPI_Waitall(2, req, MPI_STATUSES_IGNORE);
|
||||||
return 2.0*bytes;
|
return 2.0*bytes;
|
||||||
}
|
}
|
||||||
void CartesianCommunicator::StencilSendToRecvFromComplete(std::vector<CommsRequest_t> &waitall,int dir)
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user