Commit b8c870e7 authored by Sameh Sharkawi's avatar Sameh Sharkawi Committed by Michael Blocksome
Browse files

Fixes for MPI_Alltoall when using non-contig data and collective selection



(ibm) D192063: MPI_Alltoall issue with non-contig datatypes and colsel
(ibm) 14981425fb8db5ee7aab152ddbb5e92d8a477e1d
Signed-off-by: default avatarMichael Blocksome <blocksom@us.ibm.com>
parent c7c7d608
...@@ -248,7 +248,8 @@ int MPIDO_Alltoall_simple(const void *sendbuf, ...@@ -248,7 +248,8 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
MPIDI_Post_coll_t alltoall_post; MPIDI_Post_coll_t alltoall_post;
int sndlen, rcvlen, snd_contig = 1, rcv_contig = 1, pamidt=1; int sndlen, rcvlen, snd_contig = 1, rcv_contig = 1, pamidt=1;
int tmp; int tmp;
const int rank = comm_ptr->rank; const int rank = comm_ptr->rank;
const int size = comm_ptr->local_size;
const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid); const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
...@@ -278,15 +279,15 @@ int MPIDO_Alltoall_simple(const void *sendbuf, ...@@ -278,15 +279,15 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
send_size = sndlen * sendcount; send_size = sndlen * sendcount;
if(!snd_contig) if(!snd_contig)
{ {
snd_noncontig_buff = MPIU_Malloc(send_size); snd_noncontig_buff = MPIU_Malloc(send_size*size);
sbuf = snd_noncontig_buff; sbuf = snd_noncontig_buff;
if(snd_noncontig_buff == NULL) if(snd_noncontig_buff == NULL)
{ {
MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1, MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
"Fatal: Cannot allocate pack buffer"); "Fatal: Cannot allocate pack buffer");
} }
DLOOP_Offset last = send_size; DLOOP_Offset last = send_size*size;
MPID_Segment_init(sendbuf, sendcount, sendtype, &segment, 0); MPID_Segment_init(sendbuf, sendcount*size, sendtype, &segment, 0);
MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff); MPID_Segment_pack(&segment, 0, &last, snd_noncontig_buff);
} }
...@@ -294,7 +295,7 @@ int MPIDO_Alltoall_simple(const void *sendbuf, ...@@ -294,7 +295,7 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
if(!rcv_contig) if(!rcv_contig)
{ {
rcv_noncontig_buff = MPIU_Malloc(recv_size); rcv_noncontig_buff = MPIU_Malloc(recv_size*size);
rbuf = rcv_noncontig_buff; rbuf = rcv_noncontig_buff;
if(rcv_noncontig_buff == NULL) if(rcv_noncontig_buff == NULL)
{ {
...@@ -345,8 +346,8 @@ int MPIDO_Alltoall_simple(const void *sendbuf, ...@@ -345,8 +346,8 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
if(!rcv_contig) if(!rcv_contig)
{ {
MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR, MPIR_Localcopy(rcv_noncontig_buff, recv_size*size, MPI_CHAR,
recvbuf, recvcount, recvtype); recvbuf, recvcount*size, recvtype);
MPIU_Free(rcv_noncontig_buff); MPIU_Free(rcv_noncontig_buff);
} }
if(!snd_contig) MPIU_Free(snd_noncontig_buff); if(!snd_contig) MPIU_Free(snd_noncontig_buff);
......
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