@@ -117,199 +117,37 @@ int ompi_abi_get_fortran_info(ompi_info_t **info)
117117 }
118118#endif
119119
120- #if OMPI_DATATYPE_MPI_LOGICAL1
121- cptr = (OMPI_DATATYPE_MPI_LOGICAL1 != OMPI_DATATYPE_MPI_UNAVAILABLE ) ? true_str : false_str ;
122- cptr = true_str ;
123- #else
124- cptr = false_str ;
125- #endif
126- ret = opal_info_set (& newinfo -> super , "mpi_logical1_supported" , cptr );
127- if (OPAL_SUCCESS != ret ) {
128- goto err_cleanup ;
129- }
130-
131- #if OMPI_DATATYPE_MPI_LOGICAL2
132- cptr = (OMPI_DATATYPE_MPI_LOGICAL2 != OMPI_DATATYPE_MPI_UNAVAILABLE ) ? true_str : false_str ;
133- #else
134- cptr = false_str ;
135- #endif
136- ret = opal_info_set (& newinfo -> super , "mpi_logical2_supported" , cptr );
137- if (OPAL_SUCCESS != ret ) {
138- goto err_cleanup ;
139- }
140-
141- #if OMPI_DATATYPE_MPI_LOGICAL4
142- cptr = (OMPI_DATATYPE_MPI_LOGICAL4 != OMPI_DATATYPE_MPI_UNAVAILABLE ) ? true_str : false_str ;
143- #else
144- cptr = false_str ;
145- #endif
146- ret = opal_info_set (& newinfo -> super , "mpi_logical4_supported" , cptr );
147- if (OPAL_SUCCESS != ret ) {
148- goto err_cleanup ;
149- }
150-
151- #if OMPI_DATATYPE_MPI_LOGICAL8
152- cptr = (OMPI_DATATYPE_MPI_LOGICAL8 != OMPI_DATATYPE_MPI_UNAVAILABLE ) ? true_str : false_str ;
153- #else
154- cptr = false_str ;
155- #endif
156- ret = opal_info_set (& newinfo -> super , "mpi_logical8_supported" , cptr );
157- if (OPAL_SUCCESS != ret ) {
158- goto err_cleanup ;
159- }
160-
161- #if OMPI_DATATYPE_MPI_LOGICAL16
162- cptr = (OMPI_DATATYPE_MPI_LOGICAL16 != OMPI_DATATYPE_MPI_UNAVAILABLE ) ? true_str : false_str ;
163- fprintf (stderr , "cptr = %s\n" , cptr );
164- #else
165- cptr = false_str ;
166- #endif
167- fprintf (stderr ,"setting mpi_logical16_supported to %s\n" , cptr );
168- ret = opal_info_set (& newinfo -> super , "mpi_logical16_supported" , cptr );
169- if (OPAL_SUCCESS != ret ) {
170- goto err_cleanup ;
171- }
172-
173- #if OMPI_SIZEOF_FORTRAN_INTEGER1
174- cptr = true_str ;
175- #else
176- cptr = false_str ;
177- #endif
178- ret = opal_info_set (& newinfo -> super , "mpi_integer1_supported" , cptr );
179- if (OPAL_SUCCESS != ret ) {
180- goto err_cleanup ;
181- }
182-
183- #if OMPI_SIZEOF_FORTRAN_INTEGER2
184- cptr = true_str ;
185- #else
186- cptr = false_str ;
187- #endif
188- ret = opal_info_set (& newinfo -> super , "mpi_integer2_supported" , cptr );
189- if (OPAL_SUCCESS != ret ) {
190- goto err_cleanup ;
191- }
192-
193- #if OMPI_SIZEOF_FORTRAN_INTEGER4
194- cptr = true_str ;
195- #else
196- cptr = false_str ;
197- #endif
198- ret = opal_info_set (& newinfo -> super , "mpi_integer4_supported" , cptr );
199- if (OPAL_SUCCESS != ret ) {
200- goto err_cleanup ;
201- }
202-
203- #if OMPI_SIZEOF_FORTRAN_INTEGER8
204- cptr = true_str ;
205- #else
206- cptr = false_str ;
207- #endif
208- ret = opal_info_set (& newinfo -> super , "mpi_integer8_supported" , cptr );
209- if (OPAL_SUCCESS != ret ) {
210- goto err_cleanup ;
211- }
120+ #define OMPI_DATATYPE_SET_SUPPORTED (type , TYPE ) do { \
121+ cptr = (OMPI_DATATYPE_##TYPE != OMPI_DATATYPE_MPI_UNAVAILABLE) ? true_str : false_str; \
122+ ret = opal_info_set(&newinfo->super, #type "_supported", cptr); \
123+ if (OPAL_SUCCESS != ret) goto err_cleanup; } while (0)
124+
125+ OMPI_DATATYPE_SET_SUPPORTED (mpi_logical1 , MPI_LOGICAL1 );
126+ OMPI_DATATYPE_SET_SUPPORTED (mpi_logical2 , MPI_LOGICAL2 );
127+ OMPI_DATATYPE_SET_SUPPORTED (mpi_logical4 , MPI_LOGICAL4 );
128+ OMPI_DATATYPE_SET_SUPPORTED (mpi_logical8 , MPI_LOGICAL8 );
129+ OMPI_DATATYPE_SET_SUPPORTED (mpi_logical16 , MPI_LOGICAL16 );
130+
131+ OMPI_DATATYPE_SET_SUPPORTED (mpi_integer1 , MPI_INTEGER1 );
132+ OMPI_DATATYPE_SET_SUPPORTED (mpi_integer2 , MPI_INTEGER2 );
133+ OMPI_DATATYPE_SET_SUPPORTED (mpi_integer4 , MPI_INTEGER4 );
134+ OMPI_DATATYPE_SET_SUPPORTED (mpi_integer8 , MPI_INTEGER8 );
135+ OMPI_DATATYPE_SET_SUPPORTED (mpi_integer16 , MPI_INTEGER16 );
136+
137+ OMPI_DATATYPE_SET_SUPPORTED (mpi_real2 , MPI_REAL2 );
138+ OMPI_DATATYPE_SET_SUPPORTED (mpi_real4 , MPI_REAL4 );
139+ OMPI_DATATYPE_SET_SUPPORTED (mpi_real8 , MPI_REAL8 );
140+ OMPI_DATATYPE_SET_SUPPORTED (mpi_real16 , MPI_REAL16 );
141+
142+ OMPI_DATATYPE_SET_SUPPORTED (mpi_complex4 , MPI_COMPLEX4 );
143+ OMPI_DATATYPE_SET_SUPPORTED (mpi_complex8 , MPI_COMPLEX8 );
144+ OMPI_DATATYPE_SET_SUPPORTED (mpi_complex16 , MPI_COMPLEX16 );
145+ OMPI_DATATYPE_SET_SUPPORTED (mpi_complex32 , MPI_COMPLEX32 );
146+
147+ OMPI_DATATYPE_SET_SUPPORTED (mpi_double_complex , MPI_DOUBLE_COMPLEX );
148+
149+ #undef OMPI_DATATYPE_SET_SUPPORTED
212150
213- #if OMPI_SIZEOF_FORTRAN_INTEGER16
214- cptr = true_str ;
215- #else
216- cptr = false_str ;
217- #endif
218- ret = opal_info_set (& newinfo -> super , "mpi_integer16_supported" , cptr );
219- if (OPAL_SUCCESS != ret ) {
220- goto err_cleanup ;
221- }
222-
223- #if OMPI_SIZEOF_FORTRAN_REAL4
224- cptr = true_str ;
225- #else
226- cptr = false_str ;
227- #endif
228- ret = opal_info_set (& newinfo -> super , "mpi_real2_supported" , cptr );
229- if (OPAL_SUCCESS != ret ) {
230- goto err_cleanup ;
231- }
232-
233- #if OMPI_SIZEOF_FORTRAN_REAL4
234- cptr = true_str ;
235- #else
236- cptr = false_str ;
237- #endif
238- ret = opal_info_set (& newinfo -> super , "mpi_real4_supported" , cptr );
239- if (OPAL_SUCCESS != ret ) {
240- goto err_cleanup ;
241- }
242-
243- #if OMPI_SIZEOF_FORTRAN_REAL8
244- cptr = true_str ;
245- #else
246- cptr = false_str ;
247- #endif
248- ret = opal_info_set (& newinfo -> super , "mpi_real8_supported" , cptr );
249- if (OPAL_SUCCESS != ret ) {
250- goto err_cleanup ;
251- }
252-
253- #if OMPI_SIZEOF_FORTRAN_REAL16
254- cptr = true_str ;
255- #else
256- cptr = false_str ;
257- #endif
258- ret = opal_info_set (& newinfo -> super , "mpi_real16_supported" , cptr );
259- if (OPAL_SUCCESS != ret ) {
260- goto err_cleanup ;
261- }
262-
263- #if OMPI_SIZEOF_FORTRAN_COMPLEX4
264- cptr = true_str ;
265- #else
266- cptr = false_str ;
267- #endif
268- ret = opal_info_set (& newinfo -> super , "mpi_complex4_supported" , cptr );
269- if (OPAL_SUCCESS != ret ) {
270- goto err_cleanup ;
271- }
272-
273- #if OMPI_SIZEOF_FORTRAN_COMPLEX8
274- cptr = true_str ;
275- #else
276- cptr = false_str ;
277- #endif
278- ret = opal_info_set (& newinfo -> super , "mpi_complex8_supported" , cptr );
279- if (OPAL_SUCCESS != ret ) {
280- goto err_cleanup ;
281- }
282-
283- #if OMPI_SIZEOF_FORTRAN_COMPLEX16
284- cptr = true_str ;
285- #else
286- cptr = false_str ;
287- #endif
288- ret = opal_info_set (& newinfo -> super , "mpi_complex16_supported" , cptr );
289- if (OPAL_SUCCESS != ret ) {
290- goto err_cleanup ;
291- }
292-
293- #if OMPI_SIZEOF_FORTRAN_COMPLEX32
294- cptr = true_str ;
295- #else
296- cptr = false_str ;
297- #endif
298- ret = opal_info_set (& newinfo -> super , "mpi_complex32_supported" , cptr );
299- if (OPAL_SUCCESS != ret ) {
300- goto err_cleanup ;
301- }
302-
303- #if OMPI_SIZEOF_FORTRAN_DOUBLE_COMPLEX
304- cptr = true_str ;
305- #else
306- cptr = false_str ;
307- #endif
308- ret = opal_info_set (& newinfo -> super , "mpi_double_complex_supported" , cptr );
309- if (OPAL_SUCCESS != ret ) {
310- goto err_cleanup ;
311- }
312-
313151 * info = newinfo ;
314152
315153#else
0 commit comments