Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-11 Thread Hugo Gagnon
On Wed, Sep 11, 2013, at 13:24, Jeff Squyres (jsquyres) wrote: > On Sep 11, 2013, at 7:22 PM, Hugo Gagnon > wrote: > > >> This is definitely a puzzle, because I just installed gcc 4.8.1 on my > >> 10.8.4 OS X MBP, > > > > I also just recompiled gcc 4.8.1_3

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-11 Thread Jeff Squyres (jsquyres)
On Sep 11, 2013, at 7:22 PM, Hugo Gagnon wrote: >> This is definitely a puzzle, because I just installed gcc 4.8.1 on my >> 10.8.4 OS X MBP, > > I also just recompiled gcc 4.8.1_3 from MacPorts, and will recompile > openmpi 1.6.5 myself rather than using

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-11 Thread Hugo Gagnon
On Wed, Sep 11, 2013, at 12:26, Jeff Squyres (jsquyres) wrote: > On Sep 10, 2013, at 2:33 PM, Hugo Gagnon > wrote: > > > I only get the correct output when I use the more "conventional" syntax: > > > > ... > > call

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-11 Thread Jeff Squyres (jsquyres)
On Sep 10, 2013, at 2:33 PM, Hugo Gagnon 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

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-10 Thread Hugo Gagnon
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) ... 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) ... hence

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-10 Thread Jeff Squyres (jsquyres)
On Sep 7, 2013, at 5:14 AM, Hugo Gagnon wrote: > $ openmpif90 test.f90 > $ openmpirun -np 2 a.out > 0 4 6 > 1 4 6 > > Now I'd be curious to know why your OpenMPI implementation handles >

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-07 Thread Tom Rosmond
What Fortran compiler is your OpenMPI build with? Some fortran's don't understand MPI_IN_PLACE. Do a 'fortran MPI_IN_PLACE' search to see several instances. T. Rosmond On Sat, 2013-09-07 at 10:16 -0400, Hugo Gagnon wrote: > Nope, no luck. My environment is: > > OpenMPI 1.6.5 > gcc 4.8.1 >

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-07 Thread Hugo Gagnon
Nope, no luck. My environment is: OpenMPI 1.6.5 gcc 4.8.1 Mac OS 10.8 I found a ticket reporting a similar problem on OS X: https://svn.open-mpi.org/trac/ompi/ticket/1982 It said to make sure $prefix/share/ompi/mpif90-wrapper-data.txt had the following line:

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-07 Thread Tom Rosmond
Just as an experiment, try replacing use mpi with include 'mpif.h' If that fixes the problem, you can confront the OpenMPI experts T. Rosmond On Fri, 2013-09-06 at 23:14 -0400, Hugo Gagnon wrote: > Thanks for the input but it still doesn't work for me... Here's the > version without

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-07 Thread Tom Rosmond
I'm afraid I can't answer that. Here's my environment: OpenMPI 1.6.1 IFORT 12.0.3.174 Scientific Linux 6.4 What fortran compiler are you using? T. Rosmond On Fri, 2013-09-06 at 23:14 -0400, Hugo Gagnon wrote: > Thanks for the input but it still doesn't work for me... Here's the >

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-07 Thread Hugo Gagnon
Thanks for the input but it still doesn't work for me... Here's the version without MPI_IN_PLACE that does work: program test use mpi integer :: ierr, myrank, a(2), a_loc(2) = 0 call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr) if (myrank == 0) then a_loc(1) = 1 a_loc(2) = 2

Re: [OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-06 Thread Tom Rosmond
Hello, Your syntax defining 'a' is not correct. This code works correctly. program test use mpi integer :: ierr, myrank, a(2) = 0 call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr) if (myrank == 0) then a(1) = 1 a(2) = 2 else a(1) = 3 a(2) = 4 endif call

[OMPI users] MPI_IN_PLACE in a call to MPI_Allreduce in Fortran

2013-09-06 Thread Hugo Gagnon
Hello, I'm trying to run this bit of code: program test use mpi integer :: ierr, myrank, a(2) = 0 call MPI_Init(ierr) call MPI_Comm_rank(MPI_COMM_WORLD,myrank,ierr) if (myrank == 0) a(1) = 1; a(2) = 2 if (myrank == 1) a(1) = 3; a(2) = 4 call