1 C -*- Mode: Fortran; -*-
3 C (C) 2007 by Argonne National Laboratory.
4 C See COPYRIGHT in top-level directory.
9 integer*8 inbuf, outbuf
10 double complex zinbuf, zoutbuf
16 call mtest_init( ierr )
17 call mpi_comm_size( MPI_COMM_WORLD, wsize, ierr )
19 C A simple test of allreduce for the optional integer*8 type
23 call mpi_allreduce(inbuf, outbuf, 1, MPI_INTEGER8, MPI_SUM,
24 & MPI_COMM_WORLD, ierr)
25 if (outbuf .ne. wsize ) then
27 print *, "result wrong for sum with integer*8 = got ", outbuf,
28 & " but should have ", wsize
32 call mpi_allreduce(zinbuf, zoutbuf, 1, MPI_DOUBLE_COMPLEX,
33 & MPI_SUM, MPI_COMM_WORLD, ierr)
34 if (dreal(zoutbuf) .ne. wsize ) then
36 print *, "result wrong for sum with double complex = got ",
37 & outbuf, " but should have ", wsize
39 if (dimag(zoutbuf) .ne. wsize ) then
41 print *, "result wrong for sum with double complex = got ",
42 & outbuf, " but should have ", wsize
44 call mtest_finalize( errs )
45 call mpi_finalize( ierr )