1 C -*- Mode: Fortran; -*-
4 C (C) 2003 by Argonne National Laboratory.
5 C See COPYRIGHT in top-level directory.
10 character*(MPI_MAX_OBJECT_NAME) name
16 call mtest_init( ierr )
18 C Check each Fortran datatype, including the size-specific ones
19 C See the C version (typename.c) for the relevant MPI sections
21 call MPI_Type_get_name( MPI_COMPLEX, name, namelen, ierr )
22 if (name(1:namelen) .ne. "MPI_COMPLEX") then
24 print *, "Expected MPI_COMPLEX but got "//name(1:namelen)
27 call MPI_Type_get_name( MPI_DOUBLE_COMPLEX, name, namelen, ierr )
28 if (name(1:namelen) .ne. "MPI_DOUBLE_COMPLEX") then
30 print *, "Expected MPI_DOUBLE_COMPLEX but got "//
34 call MPI_Type_get_name( MPI_LOGICAL, name, namelen, ierr )
35 if (name(1:namelen) .ne. "MPI_LOGICAL") then
37 print *, "Expected MPI_LOGICAL but got "//name(1:namelen)
40 call MPI_Type_get_name( MPI_REAL, name, namelen, ierr )
41 if (name(1:namelen) .ne. "MPI_REAL") then
43 print *, "Expected MPI_REAL but got "//name(1:namelen)
46 call MPI_Type_get_name( MPI_DOUBLE_PRECISION, name, namelen, ierr)
47 if (name(1:namelen) .ne. "MPI_DOUBLE_PRECISION") then
49 print *, "Expected MPI_DOUBLE_PRECISION but got "//
53 call MPI_Type_get_name( MPI_INTEGER, name, namelen, ierr )
54 if (name(1:namelen) .ne. "MPI_INTEGER") then
56 print *, "Expected MPI_INTEGER but got "//name(1:namelen)
59 call MPI_Type_get_name( MPI_2INTEGER, name, namelen, ierr )
60 if (name(1:namelen) .ne. "MPI_2INTEGER") then
62 print *, "Expected MPI_2INTEGER but got "//name(1:namelen)
65 C 2COMPLEX was present only in MPI 1.0
66 C call MPI_Type_get_name( MPI_2COMPLEX, name, namelen, ierr )
67 C if (name(1:namelen) .ne. "MPI_2COMPLEX") then
69 C print *, "Expected MPI_2COMPLEX but got "//name(1:namelen)
72 call MPI_Type_get_name(MPI_2DOUBLE_PRECISION, name, namelen, ierr)
73 if (name(1:namelen) .ne. "MPI_2DOUBLE_PRECISION") then
75 print *, "Expected MPI_2DOUBLE_PRECISION but got "//
79 call MPI_Type_get_name( MPI_2REAL, name, namelen, ierr )
80 if (name(1:namelen) .ne. "MPI_2REAL") then
82 print *, "Expected MPI_2REAL but got "//name(1:namelen)
85 C 2DOUBLE_COMPLEX isn't in MPI 2.1
86 C call MPI_Type_get_name( MPI_2DOUBLE_COMPLEX, name, namelen, ierr )
87 C if (name(1:namelen) .ne. "MPI_2DOUBLE_COMPLEX") then
89 C print *, "Expected MPI_2DOUBLE_COMPLEX but got "//
93 call MPI_Type_get_name( MPI_CHARACTER, name, namelen, ierr )
94 if (name(1:namelen) .ne. "MPI_CHARACTER") then
96 print *, "Expected MPI_CHARACTER but got "//name(1:namelen)
99 call MPI_Type_get_name( MPI_BYTE, name, namelen, ierr )
100 if (name(1:namelen) .ne. "MPI_BYTE") then
102 print *, "Expected MPI_BYTE but got "//name(1:namelen)
105 if (MPI_REAL4 .ne. MPI_DATATYPE_NULL) then
106 call MPI_Type_get_name( MPI_REAL4, name, namelen, ierr )
107 if (name(1:namelen) .ne. "MPI_REAL4") then
109 print *, "Expected MPI_REAL4 but got "//name(1:namelen)
113 if (MPI_REAL8 .ne. MPI_DATATYPE_NULL) then
114 call MPI_Type_get_name( MPI_REAL8, name, namelen, ierr )
115 if (name(1:namelen) .ne. "MPI_REAL8") then
117 print *, "Expected MPI_REAL8 but got "//name(1:namelen)
121 if (MPI_REAL16 .ne. MPI_DATATYPE_NULL) then
122 call MPI_Type_get_name( MPI_REAL16, name, namelen, ierr )
123 if (name(1:namelen) .ne. "MPI_REAL16") then
125 print *, "Expected MPI_REAL16 but got "//name(1:namelen)
129 if (MPI_COMPLEX8 .ne. MPI_DATATYPE_NULL) then
130 call MPI_Type_get_name( MPI_COMPLEX8, name, namelen, ierr )
131 if (name(1:namelen) .ne. "MPI_COMPLEX8") then
133 print *, "Expected MPI_COMPLEX8 but got "//
138 if (MPI_COMPLEX16 .ne. MPI_DATATYPE_NULL) then
139 call MPI_Type_get_name( MPI_COMPLEX16, name, namelen, ierr )
140 if (name(1:namelen) .ne. "MPI_COMPLEX16") then
142 print *, "Expected MPI_COMPLEX16 but got "//
147 if (MPI_COMPLEX32 .ne. MPI_DATATYPE_NULL) then
148 call MPI_Type_get_name( MPI_COMPLEX32, name, namelen, ierr )
149 if (name(1:namelen) .ne. "MPI_COMPLEX32") then
151 print *, "Expected MPI_COMPLEX32 but got "//
156 if (MPI_INTEGER1 .ne. MPI_DATATYPE_NULL) then
157 call MPI_Type_get_name( MPI_INTEGER1, name, namelen, ierr )
158 if (name(1:namelen) .ne. "MPI_INTEGER1") then
160 print *, "Expected MPI_INTEGER1 but got "//
165 if (MPI_INTEGER2 .ne. MPI_DATATYPE_NULL) then
166 call MPI_Type_get_name( MPI_INTEGER2, name, namelen, ierr )
167 if (name(1:namelen) .ne. "MPI_INTEGER2") then
169 print *, "Expected MPI_INTEGER2 but got "//
174 if (MPI_INTEGER4 .ne. MPI_DATATYPE_NULL) then
175 call MPI_Type_get_name( MPI_INTEGER4, name, namelen, ierr )
176 if (name(1:namelen) .ne. "MPI_INTEGER4") then
178 print *, "Expected MPI_INTEGER4 but got "//
183 if (MPI_INTEGER8 .ne. MPI_DATATYPE_NULL) then
184 call MPI_Type_get_name( MPI_INTEGER8, name, namelen, ierr )
185 if (name(1:namelen) .ne. "MPI_INTEGER8") then
187 print *, "Expected MPI_INTEGER8 but got "//
192 C MPI_INTEGER16 is in MPI 2.1, but it is missing from most tables
193 C Some MPI implementations may not provide it
194 C if (MPI_INTEGER16 .ne. MPI_DATATYPE_NULL) then
195 C call MPI_Type_get_name( MPI_INTEGER16, name, namelen, ierr )
196 C if (name(1:namelen) .ne. "MPI_INTEGER16") then
198 C print *, "Expected MPI_INTEGER16 but got "//
203 call mtest_finalize( errs )
204 call MPI_Finalize( ierr )