Skip to content

Commit a3452ad

Browse files
markallejjhursey
authored andcommitted
coll/base: Allgatherv MPI_IN_PLACE Bug
MPI_Allgatherv with MPI_IN_PLACE reads data from wrong location. They were locating the MPI_IN_PLACE send buffer as ```c send_buf = (char*)rbuf; for (i = 0; i < rank; ++i) { send_buf += ((ptrdiff_t)rcounts[i] * extent); } ``` when it should be ```c send_buf = (char*)rbuf; send_buf += ((ptrdiff_t)disps[rank] * extent); ``` because disps[] specifies where things are in the v-style buffers. Signed-off-by: Joshua Hursey <[email protected]>
1 parent c6595c2 commit a3452ad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ompi/mca/coll/base/coll_base_allgatherv.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* reserved.
1616
* Copyright (c) 2015-2016 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1819
* $COPYRIGHT$
1920
*
2021
* Additional copyrights may follow
@@ -615,9 +616,7 @@ ompi_coll_base_allgatherv_intra_basic_default(const void *sbuf, int scount,
615616
ompi_datatype_get_extent(rdtype, &lb, &extent);
616617
send_type = rdtype;
617618
send_buf = (char*)rbuf;
618-
for (i = 0; i < rank; ++i) {
619-
send_buf += ((ptrdiff_t)rcounts[i] * extent);
620-
}
619+
send_buf += ((ptrdiff_t)disps[rank] * extent);
621620
scount = rcounts[rank];
622621
} else {
623622
send_buf = (char*)sbuf;

0 commit comments

Comments
 (0)