+
+/**
+ * MPI_Sendrecv internal level
+ **/
+int smpi_mpi_sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag,
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag,
+ MPI_Comm comm, MPI_Status *status)
+{
+int rank;
+int retval = MPI_SUCCESS;
+smpi_mpi_request_t srequest;
+smpi_mpi_request_t rrequest;
+
+ rank = smpi_mpi_comm_rank(comm);
+
+ /* send */
+ retval = smpi_create_request(sendbuf, sendcount, sendtype,
+ rank,dest,sendtag,
+ comm, &srequest);
+ smpi_mpi_isend(srequest);
+
+ /* recv */
+ retval = smpi_create_request(recvbuf, recvcount, recvtype,
+ source, rank,recvtag,
+ comm, &rrequest);
+ smpi_mpi_irecv(rrequest);
+
+ smpi_mpi_wait(srequest, MPI_STATUS_IGNORE);
+ //printf("[%d] isend request src=%d dst=%d tag=%d COMPLETED (retval=%d) \n",rank,rank,dest,sendtag,retval);
+ smpi_mpi_wait(rrequest, MPI_STATUS_IGNORE);
+ //printf("[%d] irecv request src=%d -> dst=%d tag=%d COMPLETED (retval=%d)\n",rank,source,rank,recvtag,retval);
+
+ return(retval);
+}
+/**
+ * MPI_Sendrecv user entry point
+ **/
+int SMPI_MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag,
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag,
+ MPI_Comm comm, MPI_Status *status)
+{
+int retval = MPI_SUCCESS;
+
+ smpi_bench_end();
+ smpi_mpi_sendrecv( sendbuf, sendcount, sendtype, dest, sendtag,
+ recvbuf, recvcount, recvtype, source, recvtag,
+ comm, status);
+ smpi_bench_begin();
+
+ return retval;
+
+
+}
+