1 C -*- Mode: Fortran; -*-
3 C (C) 2003 by Argonne National Laboratory.
4 C See COPYRIGHT in top-level directory.
11 integer errs, toterrs, ierr
13 integer wgroup, info, req, win
16 C The integer asize must be of ADDRESS_KIND size
23 C Test passing a Fortran MPI object to C
24 call mpi_comm_rank( MPI_COMM_WORLD, wrank, ierr )
26 call mpi_win_create( 0, asize, 1, MPI_INFO_NULL,
27 $ MPI_COMM_WORLD, win, ierr )
28 errs = errs + c2fwin( win )
29 call mpi_win_free( win, ierr )
32 C Test using a C routine to provide the Fortran handle
34 C no info, in comm world, created with no memory (base address 0,
36 call mpi_win_free( win, ierr )
39 C Summarize the errors
41 call mpi_allreduce( errs, toterrs, 1, MPI_INTEGER, MPI_SUM,
42 $ MPI_COMM_WORLD, ierr )
43 if (wrank .eq. 0) then
44 if (toterrs .eq. 0) then
47 print *, ' Found ', toterrs, ' errors'
51 call mpi_finalize( ierr )