I mean to write:
call mpi_allreduce(inside, outside, 5,mpi_real, mpi_double_precision,
mpi_comm_world, ierr)
-- 
  Hugo Gagnon


On Wed, 28 Jul 2010 09:33 -0400, "Hugo Gagnon"
<sourceforge.open...@user.fastmail.fm> wrote:
> And how do I know how big my data buffer is? I ran MPI_TYPE_EXTENT of
> And how do I know how big my data buffer is? I ran MPI_TYPE_EXTENT of
> MPI_DOUBLE_PRECISION and the result was 8. So I changed my program to:
> 
>   1 program test
>   2 
>   3         use mpi
>   4 
>   5         implicit none
>   6 
>   7         integer :: ierr, nproc, myrank
>   8         !integer, parameter :: dp = kind(1.d0)
>   9         real(kind=8) :: inside(5), outside(5)
>  10 
>  11         call mpi_init(ierr)
>  12         call mpi_comm_size(mpi_comm_world, nproc, ierr)
>  13         call mpi_comm_rank(mpi_comm_world, myrank, ierr)
>  14 
>  15         inside = (/ 1., 2., 3., 4., 5. /)
>  16         call mpi_allreduce(inside, outside, 5, mpi_real, mpi_sum,
>  mpi_comm_world, ierr)
>  17 
>  18         if (myrank == 0) then
>  19                 print*, outside
>  20         end if
>  21 
>  22         call mpi_finalize(ierr)
>  23 
>  24 end program test
> 
> but I still get a SIGSEGV fault:
> 
> forrtl: severe (174): SIGSEGV, segmentation fault occurred
> Image              PC                Routine            Line       
> Source             
> libmpi.0.dylib     00000001001BB4B7  Unknown               Unknown 
> Unknown
> libmpi_f77.0.dyli  00000001000AF046  Unknown               Unknown 
> Unknown
> a.out              0000000100000D87  _MAIN__                    16 
> test.f90
> a.out              0000000100000C9C  Unknown               Unknown 
> Unknown
> a.out              0000000100000C34  Unknown               Unknown 
> Unknown
> forrtl: severe (174): SIGSEGV, segmentation fault occurred
> Image              PC                Routine            Line       
> Source             
> libmpi.0.dylib     00000001001BB4B7  Unknown               Unknown 
> Unknown
> libmpi_f77.0.dyli  00000001000AF046  Unknown               Unknown 
> Unknown
> a.out              0000000100000D87  _MAIN__                    16 
> test.f90
> a.out              0000000100000C9C  Unknown               Unknown 
> Unknown
> a.out              0000000100000C34  Unknown               Unknown 
> Unknown
> 
> What is wrong now?
> -- 
>   Hugo Gagnon
> 
> 
> On Wed, 28 Jul 2010 07:56 -0400, "Jeff Squyres" <jsquy...@cisco.com>
> wrote:
> > On Jul 27, 2010, at 4:19 PM, Gus Correa wrote:
> > 
> > > Is there a simple way to check the number of bytes associated to each
> > > MPI basic type of OpenMPI on a specific machine (or machine+compiler)?
> > > 
> > > Something that would come out easily, say, from ompi_info?
> > 
> > Not via ompi_info, but the MPI function MPI_GET_EXTENT will tell you the
> > datatype's size.
> > 
> > -----
> > [4:54] svbu-mpi:~/mpi % cat extent.f90
> >       program main
> >       use mpi
> >       implicit none
> >       integer ierr, ext
> >       
> >       call MPI_INIT(ierr)
> >       call MPI_TYPE_EXTENT(MPI_DOUBLE_PRECISION, ext, ierr)
> >       print *, 'Type extent of DOUBLE_PREC is', ext
> >       call MPI_FINALIZE(ierr)
> >       
> >       end
> > [4:54] svbu-mpi:~/mpi % mpif90 extent.f90 -o extent -g
> > [4:54] svbu-mpi:~/mpi % ./extent
> >  Type extent of DOUBLE_PREC is           8
> > [4:54] svbu-mpi:~/mpi % 
> > -----
> > 
> > -- 
> > Jeff Squyres
> > jsquy...@cisco.com
> > For corporate legal information go to:
> > http://www.cisco.com/web/about/doing_business/legal/cri/
> > 
> > 
> > _______________________________________________
> > users mailing list
> > us...@open-mpi.org
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
> > 
> -- 
>   Hugo Gagnon
> 
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users
> 
-- 
  Hugo Gagnon

Reply via email to