1 C -*- Mode: Fortran; -*-
3 C (C) 2004 by Argonne National Laboratory.
4 C See COPYRIGHT in top-level directory.
10 C This program makes use of a common (but not universal; g77 doesn't
11 C have it) extension: the "Cray" pointer. This allows MPI_Alloc_mem
12 C to allocate memory and return it to Fortran, where it can be used.
13 C As this is not standard Fortran, this test is not run by default.
14 C To run it, build (with a suitable compiler) and run with
15 C mpiexec -n 1 ./allocmemf
18 pointer (p,a(100,100))
20 integer ierr, sizeofreal, errs
25 call mpi_type_size( MPI_REAL, sizeofreal, ierr )
26 C Make sure we pass in an integer of the correct type
27 asize = sizeofreal * 100 * 100
28 call mpi_alloc_mem( asize,MPI_INFO_NULL,p,ierr )
37 call mpi_free_mem( a, ierr )
38 call mtest_finalize(errs)
39 call mpi_finalize(ierr)