1 ! This file created from test/mpi/f77/datatype/allctypesf.f with f77tof90
2 ! -*- Mode: Fortran; -*-
4 ! (C) 2004 by Argonne National Laboratory.
5 ! See COPYRIGHT in top-level directory.
12 call mpi_comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN, &
15 ! Check that all Ctypes are available in Fortran (MPI 2.1, p 483, line 46)
17 call checkdtype( MPI_CHAR, "MPI_CHAR", ierr )
18 call checkdtype( MPI_SIGNED_CHAR, "MPI_SIGNED_CHAR", ierr )
19 call checkdtype( MPI_UNSIGNED_CHAR, "MPI_UNSIGNED_CHAR", ierr )
20 call checkdtype( MPI_BYTE, "MPI_BYTE", ierr )
21 call checkdtype( MPI_WCHAR, "MPI_WCHAR", ierr )
22 call checkdtype( MPI_SHORT, "MPI_SHORT", ierr )
23 call checkdtype( MPI_UNSIGNED_SHORT, "MPI_UNSIGNED_SHORT", ierr )
24 call checkdtype( MPI_INT, "MPI_INT", ierr )
25 call checkdtype( MPI_UNSIGNED, "MPI_UNSIGNED", ierr )
26 call checkdtype( MPI_LONG, "MPI_LONG", ierr )
27 call checkdtype( MPI_UNSIGNED_LONG, "MPI_UNSIGNED_LONG", ierr )
28 call checkdtype( MPI_FLOAT, "MPI_FLOAT", ierr )
29 call checkdtype( MPI_DOUBLE, "MPI_DOUBLE", ierr )
30 if (MPI_LONG_DOUBLE .ne. MPI_DATATYPE_NULL) then
31 call checkdtype( MPI_LONG_DOUBLE, "MPI_LONG_DOUBLE", ierr )
33 if (MPI_LONG_LONG_INT .ne. MPI_DATATYPE_NULL) then
34 call checkdtype2( MPI_LONG_LONG_INT, "MPI_LONG_LONG_INT", &
35 & "MPI_LONG_LONG", ierr )
37 if (MPI_UNSIGNED_LONG_LONG .ne. MPI_DATATYPE_NULL) then
38 call checkdtype( MPI_UNSIGNED_LONG_LONG, &
39 & "MPI_UNSIGNED_LONG_LONG", ierr )
41 if (MPI_LONG_LONG .ne. MPI_DATATYPE_NULL) then
42 call checkdtype2( MPI_LONG_LONG, "MPI_LONG_LONG", &
43 & "MPI_LONG_LONG_INT", ierr )
45 call checkdtype( MPI_PACKED, "MPI_PACKED", ierr )
46 call checkdtype( MPI_LB, "MPI_LB", ierr )
47 call checkdtype( MPI_UB, "MPI_UB", ierr )
48 call checkdtype( MPI_FLOAT_INT, "MPI_FLOAT_INT", ierr )
49 call checkdtype( MPI_DOUBLE_INT, "MPI_DOUBLE_INT", ierr )
50 call checkdtype( MPI_LONG_INT, "MPI_LONG_INT", ierr )
51 call checkdtype( MPI_SHORT_INT, "MPI_SHORT_INT", ierr )
52 call checkdtype( MPI_2INT, "MPI_2INT", ierr )
53 if (MPI_LONG_DOUBLE_INT .ne. MPI_DATATYPE_NULL) then
54 call checkdtype( MPI_LONG_DOUBLE_INT, "MPI_LONG_DOUBLE_INT", &
58 ! Check that all Ctypes are available in Fortran (MPI 2.2)
59 ! Note that because of implicit declarations in Fortran, this
60 ! code should compile even with pre MPI 2.2 implementations.
62 if (MPI_VERSION .gt. 2 .or. (MPI_VERSION .eq. 2 .and. &
63 & MPI_SUBVERSION .ge. 2)) then
64 call checkdtype( MPI_INT8_T, "MPI_INT8_T", ierr )
65 call checkdtype( MPI_INT16_T, "MPI_INT16_T", ierr )
66 call checkdtype( MPI_INT32_T, "MPI_INT32_T", ierr )
67 call checkdtype( MPI_INT64_T, "MPI_INT64_T", ierr )
68 call checkdtype( MPI_UINT8_T, "MPI_UINT8_T", ierr )
69 call checkdtype( MPI_UINT16_T, "MPI_UINT16_T", ierr )
70 call checkdtype( MPI_UINT32_T, "MPI_UINT32_T", ierr )
71 call checkdtype( MPI_UINT64_T, "MPI_UINT64_T", ierr )
73 call checkdtype( MPI_C_BOOL, "MPI_C_BOOL", ierr )
74 call checkdtype( MPI_C_FLOAT_COMPLEX, "MPI_C_FLOAT_COMPLEX", &
76 call checkdtype2( MPI_C_COMPLEX, "MPI_C_COMPLEX", &
77 & "MPI_C_FLOAT_COMPLEX", ierr )
78 call checkdtype( MPI_C_DOUBLE_COMPLEX, "MPI_C_DOUBLE_COMPLEX", &
80 if (MPI_C_LONG_DOUBLE_COMPLEX .ne. MPI_DATATYPE_NULL) then
81 call checkdtype( MPI_C_LONG_DOUBLE_COMPLEX, &
82 & "MPI_C_LONG_DOUBLE_COMPLEX", ierr )
84 ! address/offset types
85 call checkdtype( MPI_AINT, "MPI_AINT", ierr )
86 call checkdtype( MPI_OFFSET, "MPI_OFFSET", ierr )
89 call mtest_finalize( ierr )
90 call MPI_Finalize( ierr )
93 ! Check name of datatype
94 subroutine CheckDtype( intype, name, ierr )
99 character *(MPI_MAX_OBJECT_NAME) outname
102 call MPI_TYPE_GET_NAME( intype, outname, rlen, ir )
103 if (ir .ne. MPI_SUCCESS) then
104 print *, " Datatype ", name, " not available in Fortran"
107 if (outname .ne. name) then
108 print *, " For datatype ", name, " found name ", &
117 ! Check name of datatype (allows alias)
118 subroutine CheckDtype2( intype, name, name2, ierr )
121 character *(*) name, name2
123 character *(MPI_MAX_OBJECT_NAME) outname
126 call MPI_TYPE_GET_NAME( intype, outname, rlen, ir )
127 if (ir .ne. MPI_SUCCESS) then
128 print *, " Datatype ", name, " not available in Fortran"
131 if (outname .ne. name .and. outname .ne. name2) then
132 print *, " For datatype ", name, " found name ", &