I've attached a small sample program that demonstrates the problem. You can
toggle working/non-working behaviour by toggling commenting on line 27.
I've tried to open a bug report, but the system isn't letting me register for
Trac:
Trac detected an internal error:
KeyError: 'recaptcha_challenge_field'
Shane
On Friday, November 30, 2012 10:35:57 AM users-requ...@open-mpi.org wrote:
All,
I have a Fortran code that works quite well with OpenMPI 1.4.3 where I create
a handle using:
call MPI_TYPE_CREATE_F90_INTEGER(9, COMM_INT4, ierror)
and then do a reduction with:
call MPI_ALLREDUCE(send_buffer, buffer, count, COMM_INT4, MPI_SUM,
communicator,
ierror)
However, this fails with OpenMPI 1.6.3 stating:
An error occurred in MPI_Allreduce: the reduction operation MPI_SUM is not
defined for non-intrinsic datatypes (attempted with datatype named "Dup
MPI_INT")
The MPI standard states that MPI_SUM works with Fortran integers, and Fortran
integers are defined in Section 5.9.2 as:
MPI_INTEGER, MPI_AINT, MPI_OFFSET,
*and handles returned from
MPI_TYPE_CREATE_F90_INTEGER*,
and if available: MPI_INTEGER1,
MPI_INTEGER2, MPI_INTEGER4,
MPI_INTEGER8, MPI_INTEGER16
(emphasis mine)
However the manual page on MPI_Reduce for OpenMPI only states that Fortran
integers are:
Fortran integer: MPI_INTEGER
Does OpenMPI not support using MPI_SUM with Fortran integer handles? I'm
hoping that it's just an oversight as it used to work...
System: Fedora 17
Compilers: GCC 4.7.2
OpenMPI's tested: 1.4.3 (works), 1.5.4 (doesn't work), 1.6.3 (doesn't work)
Thanks for any insight,
Shane
program mpi_sum_test
implicit none
include 'mpif.h'
integer, parameter :: my_int_kind = selected_int_kind(9)
integer(kind=my_int_kind) :: my_ints
integer(kind=my_int_kind) :: my_ints_sum
integer :: test_fortran_integer_handle
integer :: test_fortran_integer_size
integer :: ierror
integer :: node_num
integer :: num_nodes
call mpi_init(ierror)
call mpi_comm_rank(mpi_comm_world, node_num, ierror)
call mpi_comm_size(mpi_comm_world, num_nodes, ierror)
call mpi_type_create_f90_integer(9, test_fortran_integer_handle, ierror)
test_fortran_integer_size = sizeof(my_ints)
if (node_num == 0) write (*,*) 'integer handle created as: ', test_fortran_integer_handle, ' mpi_int is ', mpi_int
! *** An error occurred in MPI_Reduce: the reduction operation MPI_SUM is not defined for non-intrinsic datatypes
! (attempted with datatype named "Dup MPI_INT")
! Uncomment next line to make this program work (since MPI reports my handle is a duplicate of MPI_INT we can just use that):
!test_fortran_integer_handle = mpi_int
my_ints = int(node_num+1, kind=my_int_kind)
call mpi_reduce(my_ints, my_ints_sum, 1, test_fortran_integer_handle, mpi_sum, 0, mpi_comm_world, ierror)
if (node_num == 0) write (*,*) 'Sum = ', my_ints_sum
call mpi_finalize(ierror)
end program mpi_sum_test