Commit 54362c00 authored by Wesley Bland's avatar Wesley Bland Committed by Huiwei Lu
Browse files

Refactor MPIC functions to use the MPID objects



The MPIC helper functions have been using MPI_Comm and MPI_Request
objects instead of their MPID_* counterparts. This leads to a bunch of
unnecessary conversions back and forth between the two types of objects
and makes the work incompatible with other parts of the codebase
(non-blocking collectives for instance).

This patch converts all of the MPIC_* functions to use MPID_Comm and
MPID_Request and changes all of the collective calls to use them now
too.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent c04f0851
......@@ -3949,24 +3949,24 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
/* FT versions of te MPIC_ functions */
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, mpir_errflag_t *errflag);
MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag);
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Ssend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, mpir_errflag_t *errflag);
MPID_Comm *comm_ptr, mpir_errflag_t *errflag);
int MPIC_Sendrecv(const 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, mpir_errflag_t *errflag);
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag);
MPID_Comm *comm_ptr, MPI_Status *status, mpir_errflag_t *errflag);
int MPIC_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request, mpir_errflag_t *errflag);
MPID_Comm *comm_ptr, MPID_Request **request, mpir_errflag_t *errflag);
int MPIC_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
int tag, MPI_Comm comm, MPI_Request *request);
int MPIC_Waitall(int numreq, MPI_Request requests[], MPI_Status statuses[], mpir_errflag_t *errflag);
int tag, MPID_Comm *comm_ptr, MPID_Request **request);
int MPIC_Waitall(int numreq, MPID_Request *requests[], MPI_Status statuses[], mpir_errflag_t *errflag);
void MPIR_MAXF ( void *, void *, int *, MPI_Datatype * ) ;
......
......@@ -127,7 +127,6 @@ int MPIR_Allgather_intra (
int j, i, pof2, src, rem;
void *tmp_buf = NULL;
int curr_cnt, dst, type_size, left, right, jnext;
MPI_Comm comm;
MPI_Status status;
int mask, dst_tree_root, my_tree_root, is_homogeneous,
send_offset, recv_offset, last_recv_cnt = 0, nprocs_completed, k,
......@@ -140,8 +139,7 @@ int MPIR_Allgather_intra (
if (((sendcount == 0) && (sendbuf != MPI_IN_PLACE)) || (recvcount == 0))
return MPI_SUCCESS;
comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
......@@ -209,7 +207,7 @@ int MPIR_Allgather_intra (
((char *)recvbuf + recv_offset),
(comm_size-dst_tree_root)*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG, comm, &status, errflag);
MPIR_ALLGATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -271,7 +269,7 @@ int MPIR_Allgather_intra (
mpi_errno = MPIC_Send(((char *)recvbuf + offset),
last_recv_cnt,
recvtype, dst,
MPIR_ALLGATHER_TAG, comm, errflag);
MPIR_ALLGATHER_TAG, comm_ptr, errflag);
/* last_recv_cnt was set in the previous
receive. that's the amount of data to be
sent now. */
......@@ -291,7 +289,7 @@ int MPIR_Allgather_intra (
(comm_size - (my_tree_root + mask))*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
/* nprocs_completed is also equal to the
no. of processes whose data we don't have */
if (mpi_errno) {
......@@ -377,7 +375,7 @@ int MPIR_Allgather_intra (
((char *)tmp_buf + recv_offset),
tmp_buf_size - recv_offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG, comm, &status, errflag);
MPIR_ALLGATHER_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -432,7 +430,7 @@ int MPIR_Allgather_intra (
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt, MPI_BYTE,
dst, MPIR_ALLGATHER_TAG,
comm, errflag);
comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -452,7 +450,7 @@ int MPIR_Allgather_intra (
tmp_buf_size - offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
/* nprocs_completed is also equal to the
no. of processes whose data we don't have */
if (mpi_errno) {
......@@ -528,7 +526,7 @@ int MPIR_Allgather_intra (
MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
curr_cnt, recvtype,
src, MPIR_ALLGATHER_TAG, comm,
src, MPIR_ALLGATHER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -551,7 +549,7 @@ int MPIR_Allgather_intra (
dst, MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
rem * recvcount, recvtype,
src, MPIR_ALLGATHER_TAG, comm,
src, MPIR_ALLGATHER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -613,7 +611,7 @@ int MPIR_Allgather_intra (
((char *)recvbuf +
jnext*recvcount*recvtype_extent),
recvcount, recvtype, left,
MPIR_ALLGATHER_TAG, comm,
MPIR_ALLGATHER_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......
......@@ -100,7 +100,6 @@ int MPIR_Allgatherv_intra (
MPID_Comm *comm_ptr,
mpir_errflag_t *errflag )
{
MPI_Comm comm;
int comm_size, rank, j, i, left, right;
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -121,7 +120,6 @@ int MPIR_Allgatherv_intra (
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
......@@ -214,7 +212,7 @@ int MPIR_Allgatherv_intra (
((char *)tmp_buf + recv_offset * recvtype_extent),
total_count - recv_offset, recvtype, dst,
MPIR_ALLGATHERV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -282,7 +280,7 @@ int MPIR_Allgatherv_intra (
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt,
recvtype, dst,
MPIR_ALLGATHERV_TAG, comm, errflag);
MPIR_ALLGATHERV_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -306,7 +304,7 @@ int MPIR_Allgatherv_intra (
mpi_errno = MPIC_Recv(((char *)tmp_buf + offset * recvtype_extent),
total_count - offset, recvtype,
dst, MPIR_ALLGATHERV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -415,7 +413,7 @@ int MPIR_Allgatherv_intra (
MPIR_ALLGATHERV_TAG,
((char *)tmp_buf + recv_offset),
tmp_buf_size-recv_offset, MPI_BYTE, dst,
MPIR_ALLGATHERV_TAG, comm, &status, errflag);
MPIR_ALLGATHERV_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -475,7 +473,7 @@ int MPIR_Allgatherv_intra (
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt, MPI_BYTE,
dst, MPIR_ALLGATHERV_TAG,
comm, errflag);
comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -495,7 +493,7 @@ int MPIR_Allgatherv_intra (
tmp_buf_size-offset, MPI_BYTE,
dst,
MPIR_ALLGATHERV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -577,7 +575,7 @@ int MPIR_Allgatherv_intra (
MPIR_ALLGATHERV_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
total_count - curr_cnt, recvtype,
src, MPIR_ALLGATHERV_TAG, comm, &status, errflag);
src, MPIR_ALLGATHERV_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -606,7 +604,7 @@ int MPIR_Allgatherv_intra (
dst, MPIR_ALLGATHERV_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
total_count - curr_cnt, recvtype,
src, MPIR_ALLGATHERV_TAG, comm,
src, MPIR_ALLGATHERV_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -695,7 +693,7 @@ int MPIR_Allgatherv_intra (
* consecutive processes contribute 0 bytes each. */
}
else if (!sendnow) { /* If there's no data to send, just do a recv call */
mpi_errno = MPIC_Recv(rbuf, recvnow, recvtype, left, MPIR_ALLGATHERV_TAG, comm, &status, errflag);
mpi_errno = MPIC_Recv(rbuf, recvnow, recvtype, left, MPIR_ALLGATHERV_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -705,7 +703,7 @@ int MPIR_Allgatherv_intra (
torecv -= recvnow;
}
else if (!recvnow) { /* If there's no data to receive, just do a send call */
mpi_errno = MPIC_Send(sbuf, sendnow, recvtype, right, MPIR_ALLGATHERV_TAG, comm, errflag);
mpi_errno = MPIC_Send(sbuf, sendnow, recvtype, right, MPIR_ALLGATHERV_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -717,7 +715,7 @@ int MPIR_Allgatherv_intra (
else { /* There's data to be sent and received */
mpi_errno = MPIC_Sendrecv(sbuf, sendnow, recvtype, right, MPIR_ALLGATHERV_TAG,
rbuf, recvnow, recvtype, left, MPIR_ALLGATHERV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......
......@@ -37,7 +37,6 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf;
MPI_Comm comm = comm_ptr->handle;
int group_rank, group_size;
int cdst, csrc;
MPIU_CHKLMEM_DECL(3);
......@@ -92,7 +91,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
to_comm_rank(cdst, group_rank+1);
mpi_errno = MPIC_Send(recvbuf, count,
datatype, cdst,
tag, comm, errflag);
tag, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -109,7 +108,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
to_comm_rank(csrc, group_rank-1);
mpi_errno = MPIC_Recv(tmp_buf, count,
datatype, csrc,
tag, comm,
tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -158,7 +157,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
mpi_errno = MPIC_Sendrecv(recvbuf, count, datatype,
cdst, tag, tmp_buf,
count, datatype, cdst,
tag, comm,
tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -242,7 +241,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
(char *) tmp_buf +
disps[recv_idx]*extent,
recv_cnt, datatype, cdst,
tag, comm,
tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -308,7 +307,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
(char *) recvbuf +
disps[recv_idx]*extent,
recv_cnt, datatype, cdst,
tag, comm,
tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -332,13 +331,13 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
to_comm_rank(cdst, group_rank-1);
mpi_errno = MPIC_Send(recvbuf, count,
datatype, cdst,
tag, comm, errflag);
tag, comm_ptr, errflag);
}
else { /* even */
to_comm_rank(csrc, group_rank+1);
mpi_errno = MPIC_Recv(recvbuf, count,
datatype, csrc,
tag, comm,
tag, comm_ptr,
MPI_STATUS_IGNORE, errflag);
}
if (mpi_errno) {
......
......@@ -198,14 +198,12 @@ int MPIR_Allreduce_intra (
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf;
MPI_Comm comm;
MPIU_CHKLMEM_DECL(3);
/* check if multiple threads are calling this collective function */
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
if (count == 0) goto fn_exit;
comm = comm_ptr->handle;
is_commutative = MPIR_Op_is_commutative(op);
......@@ -349,7 +347,7 @@ int MPIR_Allreduce_intra (
if (rank % 2 == 0) { /* even */
mpi_errno = MPIC_Send(recvbuf, count,
datatype, rank+1,
MPIR_ALLREDUCE_TAG, comm, errflag);
MPIR_ALLREDUCE_TAG, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -365,7 +363,7 @@ int MPIR_Allreduce_intra (
else { /* odd */
mpi_errno = MPIC_Recv(tmp_buf, count,
datatype, rank-1,
MPIR_ALLREDUCE_TAG, comm,
MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -411,7 +409,7 @@ int MPIR_Allreduce_intra (
mpi_errno = MPIC_Sendrecv(recvbuf, count, datatype,
dst, MPIR_ALLREDUCE_TAG, tmp_buf,
count, datatype, dst,
MPIR_ALLREDUCE_TAG, comm,
MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -496,7 +494,7 @@ int MPIR_Allreduce_intra (
(char *) tmp_buf +
disps[recv_idx]*extent,
recv_cnt, datatype, dst,
MPIR_ALLREDUCE_TAG, comm,
MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -561,7 +559,7 @@ int MPIR_Allreduce_intra (
(char *) recvbuf +
disps[recv_idx]*extent,
recv_cnt, datatype, dst,
MPIR_ALLREDUCE_TAG, comm,
MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -584,11 +582,11 @@ int MPIR_Allreduce_intra (
if (rank % 2) /* odd */
mpi_errno = MPIC_Send(recvbuf, count,
datatype, rank-1,
MPIR_ALLREDUCE_TAG, comm, errflag);
MPIR_ALLREDUCE_TAG, comm_ptr, errflag);
else /* even */
mpi_errno = MPIC_Recv(recvbuf, count,
datatype, rank+1,
MPIR_ALLREDUCE_TAG, comm,
MPIR_ALLREDUCE_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -638,7 +636,6 @@ int MPIR_Allreduce_inter (
MPI_Aint true_extent, true_lb, extent;
void *tmp_buf=NULL;
MPID_Comm *newcomm_ptr = NULL;
MPI_Comm comm;
MPIU_CHKLMEM_DECL(1);
MPIDU_ERR_CHECK_MULTIPLE_THREADS_ENTER( comm_ptr );
......@@ -655,8 +652,6 @@ int MPIR_Allreduce_inter (
tmp_buf = (void *)((char*)tmp_buf - true_lb);
}
comm = comm_ptr->handle;
/* Get the local intracommunicator */
if (!comm_ptr->local_comm)
MPIR_Setup_intercomm_localcomm( comm_ptr );
......@@ -677,7 +672,7 @@ int MPIR_Allreduce_inter (
if (comm_ptr->rank == 0) {
mpi_errno = MPIC_Sendrecv(tmp_buf, count, datatype, 0, MPIR_REDUCE_TAG,
recvbuf, count, datatype, 0, MPIR_REDUCE_TAG,
comm, MPI_STATUS_IGNORE, errflag);
comm_ptr, MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......
......@@ -147,8 +147,7 @@ int MPIR_Alltoall_intra(
MPI_Aint pack_size, position;
MPI_Datatype newtype = MPI_DATATYPE_NULL;
void *tmp_buf;
MPI_Comm comm;
MPI_Request *reqarray;
MPID_Request **reqarray;
MPI_Status *starray;
MPIU_CHKLMEM_DECL(6);
#ifdef MPIR_OLD_SHORT_ALLTOALL_ALG
......@@ -159,7 +158,6 @@ int MPIR_Alltoall_intra(
if (recvcount == 0) return MPI_SUCCESS;
comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
......@@ -192,7 +190,7 @@ int MPIR_Alltoall_intra(
recvcount, recvtype,
j, MPIR_ALLTOALL_TAG,
j, MPIR_ALLTOALL_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -206,7 +204,7 @@ int MPIR_Alltoall_intra(
recvcount, recvtype,
i, MPIR_ALLTOALL_TAG,
i, MPIR_ALLTOALL_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -279,7 +277,7 @@ int MPIR_Alltoall_intra(
mpi_errno = MPIC_Sendrecv(tmp_buf, position, MPI_PACKED, dst,
MPIR_ALLTOALL_TAG, recvbuf, 1, newtype,
src, MPIR_ALLTOALL_TAG, comm,
src, MPIR_ALLTOALL_TAG, comm_ptr,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -371,7 +369,7 @@ int MPIR_Alltoall_intra(
dst_tree_root*sendbuf_extent),
sendbuf_extent*(comm_size-dst_tree_root),
sendtype, dst, MPIR_ALLTOALL_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -425,7 +423,7 @@ int MPIR_Alltoall_intra(
dst_tree_root*sendbuf_extent),
last_recv_cnt, sendtype,
dst, MPIR_ALLTOALL_TAG,
comm, errflag);
comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -443,7 +441,7 @@ int MPIR_Alltoall_intra(
sendbuf_extent*(comm_size-dst_tree_root),
sendtype,
dst, MPIR_ALLTOALL_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -498,7 +496,7 @@ int MPIR_Alltoall_intra(
bblock = MPIR_CVAR_ALLTOALL_THROTTLE;
if (bblock == 0) bblock = comm_size;
MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request *, 2*bblock*sizeof(MPI_Request), mpi_errno, "reqarray");
MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request **, 2*bblock*sizeof(MPID_Request*), mpi_errno, "reqarray");
MPIU_CHKLMEM_MALLOC(starray, MPI_Status *, 2*bblock*sizeof(MPI_Status), mpi_errno, "starray");
......@@ -510,7 +508,7 @@ int MPIR_Alltoall_intra(
mpi_errno = MPIC_Irecv((char *)recvbuf +
dst*recvcount*recvtype_extent,
recvcount, recvtype, dst,
MPIR_ALLTOALL_TAG, comm,
MPIR_ALLTOALL_TAG, comm_ptr,
&reqarray[i]);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
......@@ -520,7 +518,7 @@ int MPIR_Alltoall_intra(
mpi_errno = MPIC_Isend((char *)sendbuf +
dst*sendcount*sendtype_extent,
sendcount, sendtype, dst,
MPIR_ALLTOALL_TAG, comm,
MPIR_ALLTOALL_TAG, comm_ptr,
&reqarray[i+ss], errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
......@@ -588,7 +586,7 @@ int MPIR_Alltoall_intra(
((char *)recvbuf +
src*recvcount*recvtype_extent),
recvcount, recvtype, src,
MPIR_ALLTOALL_TAG, comm, &status, errflag);
MPIR_ALLTOALL_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -647,12 +645,10 @@ int MPIR_Alltoall_inter(
MPI_Status status;
int src, dst, rank;
char *sendaddr, *recvaddr;
MPI_Comm comm;
local_size = comm_ptr->local_size;
remote_size = comm_ptr->remote_size;
rank = comm_ptr->rank;
comm = comm_ptr->handle;
/* Get extent of send and recv types */
MPID_Datatype_get_extent_macro(sendtype, sendtype_extent);
......@@ -688,7 +684,7 @@ int MPIR_Alltoall_inter(
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype, dst,
MPIR_ALLTOALL_TAG, recvaddr,
recvcount, recvtype, src,
MPIR_ALLTOALL_TAG, comm, &status, errflag);
MPIR_ALLTOALL_TAG, comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......
......@@ -71,15 +71,13 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
int mpi_errno_ret = MPI_SUCCESS;
MPI_Status *starray;
MPI_Status status;
MPI_Request *reqarray;
MPID_Request **reqarray;
int dst, rank, req_cnt;
MPI_Comm comm;
int ii, ss, bblock;
int type_size;
MPIU_CHKLMEM_DECL(2);
comm = comm_ptr->handle;
comm_size = comm_ptr->local_size;
rank = comm_ptr->rank;
......@@ -108,7 +106,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
recvcounts[j], recvtype,
j, MPIR_ALLTOALLV_TAG,
j, MPIR_ALLTOALLV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -123,7 +121,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
recvcounts[i], recvtype,
i, MPIR_ALLTOALLV_TAG,
i, MPIR_ALLTOALLV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......@@ -141,7 +139,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
MPID_Datatype_get_extent_macro(sendtype, send_extent);
MPIU_CHKLMEM_MALLOC(starray, MPI_Status*, 2*bblock*sizeof(MPI_Status), mpi_errno, "starray");
MPIU_CHKLMEM_MALLOC(reqarray, MPI_Request*, 2*bblock*sizeof(MPI_Request), mpi_errno, "reqarray");
MPIU_CHKLMEM_MALLOC(reqarray, MPID_Request**, 2*bblock*sizeof(MPID_Request *), mpi_errno, "reqarray");
/* post only bblock isends/irecvs at a time as suggested by Tony Ladd */
for (ii=0; ii<comm_size; ii+=bblock) {
......@@ -158,7 +156,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
rdispls[dst]*recv_extent);
mpi_errno = MPIC_Irecv((char *)recvbuf+rdispls[dst]*recv_extent,
recvcounts[dst], recvtype, dst,
MPIR_ALLTOALLV_TAG, comm,
MPIR_ALLTOALLV_TAG, comm_ptr,
&reqarray[req_cnt]);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -180,7 +178,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
sdispls[dst]*send_extent);
mpi_errno = MPIC_Isend((char *)sendbuf+sdispls[dst]*send_extent,
sendcounts[dst], sendtype, dst,
MPIR_ALLTOALLV_TAG, comm,
MPIR_ALLTOALLV_TAG, comm_ptr,
&reqarray[req_cnt], errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
......@@ -261,11 +259,9 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
MPI_Status status;
int src, dst, rank, sendcount, recvcount;
char *sendaddr, *recvaddr;
MPI_Comm comm;
local_size = comm_ptr->local_size;
remote_size = comm_ptr->remote_size;
comm = comm_ptr->handle;
rank = comm_ptr->rank;
/* Get extent of send and recv types */
......@@ -306,7 +302,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
mpi_errno = MPIC_Sendrecv(sendaddr, sendcount, sendtype, dst,
MPIR_ALLTOALLV_TAG, recvaddr, recvcount,
recvtype, src, MPIR_ALLTOALLV_TAG,
comm, &status, errflag);
comm_ptr, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = MPIR_ERR_GET_CLASS(mpi_errno);
......
......@@ -64,15 +64,13 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
int mpi_errno_ret = MPI_SUCCESS;
MPI_Status status;
MPI_Status *starray;
MPI_Request *reqarray;