On Sep 10, 2013, at 2:33 PM, Hugo Gagnon <opensource.open...@user.fastmail.fm> wrote:
> I only get the correct output when I use the more "conventional" syntax: > > ... > call MPI_Allreduce(a_loc,a,2,MPI_INTEGER,MPI_SUM,MPI_COMM_WORLD,ierr) > ... What is a_loc? I'm assuming you know it can't be the same buffer as a. > However, I get the wrong output when I use MPI_IN_PLACE: > > ... > MPI_Allreduce(MPI_IN_PLACE,a,2,MPI_INTEGER,MPI_SUM,MPI_COMM_WORLD,ierr) > ... This is definitely a puzzle, because I just installed gcc 4.8.1 on my 10.8.4 OS X MBP, compiled OMPI 1.6.5 from the open-mpi.org web site, and ran the test program, and I get the correct answers: ----- [6:23] jsquyres-mac:~/mpi ❯❯❯ mpif90 in_place.f90 [6:23] jsquyres-mac:~/mpi ❯❯❯ mpirun -np 2 ./a.out 0 4 6 1 4 6 [6:24] jsquyres-mac:~/mpi ❯❯❯ mpirun -np 3 ./a.out 0 7 10 1 7 10 2 7 10 [6:24] jsquyres-mac:~/mpi ❯❯❯ mpirun -np 4 ./a.out 0 10 14 1 10 14 2 10 14 3 10 14 [6:24] jsquyres-mac:~/mpi ❯❯❯ mpicc --version gcc-mp-4.8 (MacPorts gcc48 4.8.1_3) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [6:24] jsquyres-mac:~/mpi ❯❯❯ mpif90 --version GNU Fortran (MacPorts gcc48 4.8.1_3) 4.8.1 Copyright (C) 2013 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING [6:24] jsquyres-mac:~/mpi ❯❯❯ ----- Since I'm unable to replicate the problem, can you dig into the OMPI internals and see what's going wrong (e.g., via gdb or some other debugger)? -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/