Hi,

there appears to be a regression in revision 1.5.2rc3r24441.
The attached program crashes even with 1 PE with:

 Default real, digits:           4          24
 Real kind,    digits:           8          53
 Integer kind,   bits:           8                   64
 Default Integer     :           4          32
 Sum[real]:   1.0000000       2.0000000       3.0000000
 Sum[real(8)]:   1.0000000000000000        2.0000000000000000
3.0000000000000000
 Sum[integer(4)]:           1           2           3
[proton:24826] *** An error occurred in MPI_Allreduce: the reduction
operation MPI_SUM is not defined on the MPI_INTEGER8 datatype


On the other hand,

% ompi_info --arch
 Configured architecture: i686-pc-linux-gnu
% ompi_info --all |grep 'integer[48]'
      Fort have integer4: yes
      Fort have integer8: yes
      Fort integer4 size: 4
      Fort integer8 size: 8
     Fort integer4 align: 4
     Fort integer8 align: 8

There are no problems with 1.4.x and earlier revisions.
program test
  use mpi
  implicit none
  integer, parameter :: i8 = selected_int_kind  (15)
  integer, parameter :: r8 = selected_real_kind (15,90)
  integer, parameter :: N  = 3

  integer     :: i4i(N), i4s(N)
  integer(i8) :: i8i(N), i8s(N)
  real        :: r4i(N), r4s(N)
  real(r8)    :: r8i(N), r8s(N)
  integer     :: ierr, nproc, myrank, i

  i4i = (/ (i, i=1,N) /); i8i = (/ (i, i=1,N) /)
  r4i = (/ (i, i=1,N) /); r8i = (/ (i, i=1,N) /)

  call MPI_INIT      (ierr)
  call MPI_COMM_SIZE (MPI_COMM_WORLD, nproc,  ierr)
  call MPI_COMM_RANK (MPI_COMM_WORLD, myrank, ierr)

  if (myrank == 0) then
     print *, "Default real, digits:", kind (1.0), digits (1.0)
     print *, "Real kind,    digits:", r8, digits (1._r8)
     print *, "Integer kind,   bits:", i8, bit_size (1_i8)
     print *, "Default Integer     :", kind (1), bit_size (1)
  end if

  call MPI_ALLREDUCE (r4i, r4s, N, MPI_REAL,     MPI_SUM, MPI_COMM_WORLD, ierr)
  if (myrank == 0)    print *, "Sum[real]:", r4s

  call MPI_ALLREDUCE (r8i, r8s, N, MPI_REAL8,    MPI_SUM, MPI_COMM_WORLD, ierr)
  if (myrank == 0)    print *, "Sum[real(8)]:", r8s

  call MPI_ALLREDUCE (i4i, i4s, N, MPI_INTEGER4, MPI_SUM, MPI_COMM_WORLD, ierr)
  if (myrank == 0)    print *, "Sum[integer(4)]:", i4s

  call MPI_ALLREDUCE (i8i, i8s, N, MPI_INTEGER8, MPI_SUM, MPI_COMM_WORLD, ierr)
  if (myrank == 0)    print *, "Sum[integer(8)]:", i8s

  call MPI_FINALIZE (ierr)
end program test

Reply via email to