1 ! This file created from test/mpi/f77/datatype/typecntsf.f with f77tof90
2 ! -*- Mode: Fortran; -*-
4 ! (C) 2003 by Argonne National Laboratory.
5 ! See COPYRIGHT in top-level directory.
10 integer ntype1, ntype2
12 ! This is a very simple test that just tests that the contents/envelope
13 ! routines can be called. This should be upgraded to test the new
14 ! MPI-2 datatype routines (which use address-sized integers)
18 call mtest_init( ierr )
20 call explore( MPI_INTEGER, MPI_COMBINER_NAMED, errs )
21 call explore( MPI_BYTE, MPI_COMBINER_NAMED, errs )
22 call mpi_type_vector( 10, 1, 30, MPI_DOUBLE_PRECISION, ntype1, &
24 call explore( ntype1, MPI_COMBINER_VECTOR, errs )
25 call mpi_type_dup( ntype1, ntype2, ierr )
26 call explore( ntype2, MPI_COMBINER_DUP, errs )
27 call mpi_type_free( ntype2, ierr )
28 call mpi_type_free( ntype1, ierr )
31 call mtest_finalize( errs )
32 call mpi_finalize( ierr )
35 subroutine explore( dtype, mycomb, errs )
37 integer dtype, mycomb, errs
39 integer nints, nadds, ntype, combiner
40 integer max_nints, max_dtypes, max_asizev
41 parameter (max_nints = 10, max_dtypes = 10, max_asizev=10)
42 integer intv(max_nints), dtypesv(max_dtypes)
43 integer (kind=MPI_ADDRESS_KIND) aintv(max_asizev)
46 call mpi_type_get_envelope( dtype, nints, nadds, ntype, &
49 if (combiner .ne. MPI_COMBINER_NAMED) then
50 call mpi_type_get_contents( dtype, &
51 & max_nints, max_asizev, max_dtypes, &
52 & intv, aintv, dtypesv, ierr )
54 ! dtypesv of constructed types must be free'd now
56 if (combiner .eq. MPI_COMBINER_DUP) then
57 call mpi_type_free( dtypesv(1), ierr )
60 if (combiner .ne. mycomb) then
62 print *, ' Expected combiner ', mycomb, ' but got ', &
66 ! List all combiner types to check that they are defined in mpif.h
67 if (combiner .eq. MPI_COMBINER_NAMED) then
68 else if (combiner .eq. MPI_COMBINER_DUP) then
69 else if (combiner .eq. MPI_COMBINER_CONTIGUOUS) then
70 else if (combiner .eq. MPI_COMBINER_VECTOR) then
71 else if (combiner .eq. MPI_COMBINER_HVECTOR_INTEGER) then
72 else if (combiner .eq. MPI_COMBINER_HVECTOR) then
73 else if (combiner .eq. MPI_COMBINER_INDEXED) then
74 else if (combiner .eq. MPI_COMBINER_HINDEXED_INTEGER) then
75 else if (combiner .eq. MPI_COMBINER_HINDEXED) then
76 else if (combiner .eq. MPI_COMBINER_INDEXED_BLOCK) then
77 else if (combiner .eq. MPI_COMBINER_STRUCT_INTEGER) then
78 else if (combiner .eq. MPI_COMBINER_STRUCT) then
79 else if (combiner .eq. MPI_COMBINER_SUBARRAY) then
80 else if (combiner .eq. MPI_COMBINER_DARRAY) then
81 else if (combiner .eq. MPI_COMBINER_F90_REAL) then
82 else if (combiner .eq. MPI_COMBINER_F90_COMPLEX) then
83 else if (combiner .eq. MPI_COMBINER_F90_INTEGER) then
84 else if (combiner .eq. MPI_COMBINER_RESIZED) then
87 print *, ' Unknown combiner ', combiner