Commit 676c29f9 authored by Antonio J. Pena's avatar Antonio J. Pena
Browse files

Fixed --enabled-debuginfo segfaults tt #1932



Addresses #1932. Includes:
  - MPI_Bsend/MPI_Ibsend
  - Several collectives
  - Some RMA operations
  - MPI_Dist_graph_create
Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent 0b126663
......@@ -451,6 +451,8 @@ int MPIR_Alltoall_intra(
MPIU_CHKLMEM_MALLOC(starray, MPI_Status *, 2*bblock*sizeof(MPI_Status), mpi_errno, "starray");
for (ii=0; ii<comm_size; ii+=bblock) {
int reqidx;
ss = comm_size-ii < bblock ? comm_size-ii : bblock;
/* do the communication -- post ss sends and receives: */
for ( i=0; i<ss; i++ ) {
......@@ -463,14 +465,23 @@ int MPIR_Alltoall_intra(
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
reqidx = ss;
for ( i=0; i<ss; i++ ) {
dst = (rank-i-ii+comm_size) % comm_size;
mpi_errno = MPIC_Isend((char *)sendbuf +
dst*sendcount*sendtype_extent,
sendcount, sendtype, dst,
MPIR_ALLTOALL_TAG, comm,
&reqarray[i+ss], errflag);
&reqarray[reqidx], errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
#ifdef HAVE_DEBUGGER_SUPPORT
{
MPID_Request *request_ptr;
MPID_Request_get_ptr(reqarray[reqidx], request_ptr);
MPIR_SENDQ_REMEMBER(request_ptr, dst, MPIR_ALLTOALL_TAG, comm_ptr->context_id);
}
#endif
++reqidx;
}
/* ... then wait for them to finish: */
......
......@@ -183,6 +183,13 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
#ifdef HAVE_DEBUGGER_SUPPORT
{
MPID_Request *request_ptr;
MPID_Request_get_ptr(reqarray[req_cnt], request_ptr);
MPIR_SENDQ_REMEMBER(request_ptr, dst, MPIR_ALLTOALLV_TAG, comm_ptr->context_id);
}
#endif
req_cnt++;
}
}
......
......@@ -158,7 +158,13 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
MPIR_ALLTOALLW_TAG, comm,
&reqarray[outstanding_requests], errflag);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
#ifdef HAVE_DEBUGGER_SUPPORT
{
MPID_Request *request_ptr;
MPID_Request_get_ptr(reqarray[outstanding_requests], request_ptr);
MPIR_SENDQ_REMEMBER(request_ptr, dst, MPIR_ALLTOALLW_TAG, comm_ptr->context_id);
}
#endif
outstanding_requests++;
}
}
......
......@@ -101,8 +101,16 @@ int MPIR_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
else {
mpi_errno = MPIC_Isend(((char *)sendbuf+displs[i]*extent),
sendcounts[i], sendtype, i,
MPIR_SCATTERV_TAG, comm, &reqarray[reqs++], errflag);
MPIR_SCATTERV_TAG, comm, &reqarray[reqs], errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
#ifdef HAVE_DEBUGGER_SUPPORT
{
MPID_Request *request_ptr;
MPID_Request_get_ptr(reqarray[reqs], request_ptr);
MPIR_SENDQ_REMEMBER(request_ptr, i, MPIR_SCATTERV_TAG, comm_ptr->context_id);
}
#endif
++reqs;
}
}
}
......
......@@ -165,6 +165,7 @@ int MPI_Bsend(const void *buf, int count, MPI_Datatype datatype, int dest, int t
/* Note that we can ignore the request_ptr because it is handled internally
by the bsend util routines */
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_SENDQ_REMEMBER(request_ptr, dest, tag, comm_ptr->context_id);
/* ... end of body of routine ... */
......
......@@ -105,6 +105,7 @@ int MPIR_Ibsend_impl(const void *buf, int count, MPI_Datatype datatype, int dest
mpi_errno = MPIR_Bsend_isend( buf, count, datatype, dest, tag, comm_ptr,
IBSEND, &request_ptr );
if (mpi_errno != MPI_SUCCESS) goto fn_fail;
MPIR_SENDQ_REMEMBER(request_ptr, dest, tag, comm_ptr->context_id);
/* FIXME: use the memory management macros */
ibinfo = (ibsend_req_info *)MPIU_Malloc( sizeof(ibsend_req_info) );
......
......@@ -271,13 +271,29 @@ int MPI_Dist_graph_create(MPI_Comm comm_old, int n, const int sources[],
for (i = 0; i < comm_size; ++i) {
if (rin_sizes[i]) {
/* send edges where i is a destination to process i */
mpi_errno = MPIC_Isend(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_old, &reqs[idx++], &errflag);
mpi_errno = MPIC_Isend(&rin[i][0], rin_sizes[i], MPI_INT, i, MPIR_TOPO_A_TAG, comm_old, &reqs[idx], &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
#ifdef HAVE_DEBUGGER_SUPPORT
{
MPID_Request *request_ptr;
MPID_Request_get_ptr(reqs[idx], request_ptr);
MPIR_SENDQ_REMEMBER(request_ptr, i, MPIR_TOPO_A_TAG, comm_ptr->context_id);
}
#endif
++idx;
}
if (rout_sizes[i]) {
/* send edges where i is a source to process i */
mpi_errno = MPIC_Isend(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_old, &reqs[idx++], &errflag);
mpi_errno = MPIC_Isend(&rout[i][0], rout_sizes[i], MPI_INT, i, MPIR_TOPO_B_TAG, comm_old, &reqs[idx], &errflag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
#ifdef HAVE_DEBUGGER_SUPPORT
{
MPID_Request *request_ptr;
MPID_Request_get_ptr(reqs[idx], request_ptr);
MPIR_SENDQ_REMEMBER(request_ptr, i, MPIR_TOPO_B_TAG, comm_ptr->context_id);
}
#endif
++idx;
}
}
MPIU_Assert(idx <= (2 * comm_size));
......
......@@ -1388,6 +1388,7 @@ int MPIDI_Win_post(MPID_Group *post_grp_ptr, int assert, MPID_Win *win_ptr)
mpi_errno = MPID_Isend(&i, 0, MPI_INT, dst, SYNC_POST_TAG, win_comm_ptr,
MPID_CONTEXT_INTRA_PT2PT, &req_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
MPIR_SENDQ_REMEMBER(req_ptr, dst, SYNC_POST_TAG, win_comm_ptr->context_id);
req[i] = req_ptr->handle;
} else {
req[i] = MPI_REQUEST_NULL;
......
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