[mpich-discuss] Problem with mpi_type_create_f90_real
marco restelli
mrestelli at gmail.com
Tue Aug 5 04:22:30 CDT 2014
Hi,
I have a problem using mpi_type_create_f90_real: I can compile the
attached code but when I run it I get
$ mpiexec -n 1 ./mpitest
Fatal error in MPI_Allreduce: Invalid MPI_Op, error stack:
MPI_Allreduce(861)......: MPI_Allreduce(sbuf=0x7fff02a4eec0,
rbuf=0x7fff02a4eed0, count=1, dtype=USER<f90_real>, MPI_SUM,
MPI_COMM_WORLD) failed
MPIR_SUM_check_dtype(97): MPI_Op MPI_SUM operation not defined for
this datatype
I am using:
$ mpif90 -v
mpif90 for MPICH2 version 1.5
Is this a problem in my use of mpi_type_create_f90_real or in mpich?
Thanks,
Marco
program mpitest
use mpi
implicit none
integer, parameter :: wp = selected_real_kind(12,307)
integer, parameter :: &
wp_p = precision(1.0_wp), &
wp_r = range(1.0_wp)
integer :: wp_mpi, mpi_id, ierr
real(wp) :: res
! MPI setup
call mpi_init(ierr)
call mpi_comm_rank(mpi_comm_world,mpi_id,ierr)
!wp_mpi = mpi_double_precision ! works fine
call mpi_type_create_f90_real(wp_p,wp_r,wp_mpi,ierr)
call mpi_allreduce( real(mpi_id,wp) , res , 1 , &
wp_mpi,mpi_sum,mpi_comm_world, ierr)
write(*,*) "res = ",res
call mpi_finalize(ierr)
end program mpitest
More information about the discuss
mailing list