[mvapich-discuss] Segfault in MPI_Reduce
Bayatpour, Mohammadreza
bayatpour.1 at buckeyemail.osu.edu
Tue Jan 22 11:45:35 EST 2019
Hi, Samuel.
Thanks for getting back to us with a reproducer. Please use the following patch on MV2 2.3GA to fix the issue.
diff --git a/src/mpi/coll/reduce_osu.c b/src/mpi/coll/reduce_osu.c
index 65d8531..cb98202 100644
--- a/src/mpi/coll/reduce_osu.c
+++ b/src/mpi/coll/reduce_osu.c
@@ -153,7 +153,7 @@ int MPIR_Reduce_binomial_MV2(const void *sendbuf,
/* If I'm not the root, then my recvbuf may not be valid, therefore
I have to allocate a temporary one */
- if ((rank != root) && (recvbuf == NULL)) {
+ if ((rank != root) && (sendbuf != MPI_IN_PLACE)) {
MPIU_CHKLMEM_MALLOC(recvbuf, void *,
count * (MPIR_MAX(extent, true_extent)),
mpi_errno, "receive buffer");
Thanks,
Mamzi
________________________________
From: mvapich-discuss <mvapich-discuss-bounces at cse.ohio-state.edu> on behalf of Khuvis, Samuel <skhuvis at osc.edu>
Sent: Thursday, January 17, 2019 2:50:06 PM
To: mvapich-discuss at cse.ohio-state.edu
Subject: [mvapich-discuss] Segfault in MPI_Reduce
Hi,
I get a segfault when running a code with MV2 2.3 but not with MV2 2.2. It segfaults in the memcpy call in MPIR_Localcopy, which is called from MPI_Reduce. This only seems to happen when memory is allocated for the recv_buf on the root process and not on all processes.
I have attached a small reproducer to this email. This seems to happen in all cases with the full code, but for the attached code I need to compile with “mpicc -g -check-pointers=rw” to reproduce the error. The attached code should segfault with 2.3 but not 2.2. Also, if you comment out line 15 it should run without segfault-ing with both versions.
--
Samuel Khuvis
Scientific Applications Engineer
Ohio Supercomputer Center (OSC)<https://osc.edu/>
A member of the Ohio Technology Consortium<https://oh-tech.org/>
1224 Kinnear Road, Columbus, Ohio 43212
Office: (614) 292-5178<tel:+16142925178> • Fax: (614) 292-7168<tel:+16142927168>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cse.ohio-state.edu/pipermail/mvapich-discuss/attachments/20190122/905ef70f/attachment.html>
More information about the mvapich-discuss
mailing list