Hello Sylvain,

On Friday 04 December 2009 02:27:22 pm Sylvain Jeaugey wrote:
> There is definetly something wrong in types.
Yes, the new ids for optional Fortran datatypes are wrong.

So, as with other Fortran types, IMHO they need to map to C types, aka the IDs 
should map. Therefore, we should _not_ increase the number of predefined types 
-- these are fixed as representable by C...

The below patch does just that and fixes Your testcase!

George, what do You think? Could You check, please?

Best regards,
Rainer

PS: Yes, You're perfectly right, that the number of Fortran tests (esp. with 
regard to optional ddt) are too low.
Several features of MPI (MPI-2 are not well represented in MTT).
-- 
------------------------------------------------------------------------
Rainer Keller, PhD                  Tel: +1 (865) 241-6293
Oak Ridge National Lab          Fax: +1 (865) 241-4811
PO Box 2008 MS 6164           Email: kel...@ornl.gov
Oak Ridge, TN 37831-2008    AIM/Skype: rusraink

Index: ompi/datatype/ompi_datatype_internal.h
===================================================================
--- ompi/datatype/ompi_datatype_internal.h	(revision 22270)
+++ ompi/datatype/ompi_datatype_internal.h	(working copy)
@@ -86,22 +86,189 @@
 #define OMPI_DATATYPE_MPI_MAX_PREDEFINED          0x2B

 /*
- * Optional Fortran datatypes, previously no fixed id
+ * Optional Fortran datatypes, these map to representable types
+ * in the lower layer, aka as other Fortran types have to map to C types,
+ * additionally, if the type has the same size as the mandatory
+ * Fortran type, map to this one.
  */
-#define OMPI_DATATYPE_MPI_LOGICAL1                0x2B
-#define OMPI_DATATYPE_MPI_LOGICAL2                0x2C
-#define OMPI_DATATYPE_MPI_LOGICAL4                0x2D
-#define OMPI_DATATYPE_MPI_LOGICAL8                0x2E
-#define OMPI_DATATYPE_MPI_INTEGER1                0x2F
-#define OMPI_DATATYPE_MPI_INTEGER2                0x30
-#define OMPI_DATATYPE_MPI_INTEGER4                0x31
-#define OMPI_DATATYPE_MPI_INTEGER8                0x32
-#define OMPI_DATATYPE_MPI_INTEGER16               0x33
-#define OMPI_DATATYPE_MPI_REAL2                   0x34
-#define OMPI_DATATYPE_MPI_REAL4                   0x35
-#define OMPI_DATATYPE_MPI_REAL8                   0x36
-#define OMPI_DATATYPE_MPI_REAL16                  0x37
+/* LOGICAL */
+#if OMPI_SIZEOF_FORTRAN_LOGICAL1 == OMPI_SIZEOF_FORTRAN_LOGICAL
+#  define OMPI_DATATYPE_MPI_LOGICAL1              OMPI_DATATYPE_MPI_LOGICAL
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_LOGICAL1              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_LOGICAL1              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_LOGICAL1              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_LOGICAL1              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_LOGICAL1              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif

+#if OMPI_SIZEOF_FORTRAN_LOGICAL2 == OMPI_SIZEOF_FORTRAN_LOGICAL
+#  define OMPI_DATATYPE_MPI_LOGICAL2              OMPI_DATATYPE_MPI_LOGICAL
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_LOGICAL2              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_LOGICAL2              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_LOGICAL2              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_LOGICAL2              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_LOGICAL2              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_LOGICAL4 == OMPI_SIZEOF_FORTRAN_LOGICAL
+#  define OMPI_DATATYPE_MPI_LOGICAL4              OMPI_DATATYPE_MPI_LOGICAL
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_LOGICAL4              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_LOGICAL4              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_LOGICAL4              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_LOGICAL4              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_LOGICAL4              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_LOGICAL8 == OMPI_SIZEOF_FORTRAN_LOGICAL
+#  define OMPI_DATATYPE_MPI_LOGICAL8              OMPI_DATATYPE_MPI_LOGICAL
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_LOGICAL8              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_LOGICAL8              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_LOGICAL8              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_LOGICAL8              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_LOGICAL8              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+/* INTEGER */
+#if OMPI_SIZEOF_FORTRAN_INTEGER1 == OMPI_SIZEOF_FORTRAN_INTEGER
+#  define OMPI_DATATYPE_MPI_INTEGER1              OMPI_DATATYPE_MPI_INTEGER
+#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_INTEGER1              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_INTEGER1              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_INTEGER1              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_INTEGER1              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_INTEGER1              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_INTEGER2 == OMPI_SIZEOF_FORTRAN_INTEGER
+#  define OMPI_DATATYPE_MPI_INTEGER2              OMPI_DATATYPE_MPI_INTEGER
+#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_INTEGER2              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_INTEGER2              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_INTEGER2              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_INTEGER2              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_INTEGER2              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_INTEGER4 == OMPI_SIZEOF_FORTRAN_INTEGER
+#  define OMPI_DATATYPE_MPI_INTEGER4              OMPI_DATATYPE_MPI_INTEGER
+#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_INTEGER4              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_INTEGER4              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_INTEGER4              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_INTEGER4              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_INTEGER4              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_INTEGER8 == OMPI_SIZEOF_FORTRAN_INTEGER
+#  define OMPI_DATATYPE_MPI_INTEGER8              OMPI_DATATYPE_MPI_INTEGER
+#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_INTEGER8              OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_INTEGER8              OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_INTEGER8              OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_INTEGER8              OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_INTEGER8              OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_INTEGER16 == OMPI_SIZEOF_FORTRAN_INTEGER
+#  define OMPI_DATATYPE_MPI_INTEGER16             OMPI_DATATYPE_MPI_INTEGER
+#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == SIZEOF_CHAR
+#  define OMPI_DATATYPE_MPI_INTEGER16             OMPI_DATATYPE_MPI_CHAR
+#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == SIZEOF_SHORT
+#  define OMPI_DATATYPE_MPI_INTEGER16             OMPI_DATATYPE_MPI_SHORT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == SIZEOF_INT
+#  define OMPI_DATATYPE_MPI_INTEGER16             OMPI_DATATYPE_MPI_INT
+#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == SIZEOF_LONG
+#  define OMPI_DATATYPE_MPI_INTEGER16             OMPI_DATATYPE_MPI_LONG
+#else
+#  define OMPI_DATATYPE_MPI_INTEGER16             OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+/* REAL */
+#if OMPI_SIZEOF_FORTRAN_REAL2 == OMPI_SIZEOF_FORTRAN_REAL
+#  define OMPI_DATATYPE_MPI_REAL2                 OMPI_DATATYPE_MPI_REAL
+#elif OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_FLOAT
+#  define OMPI_DATATYPE_MPI_REAL2                 OMPI_DATATYPE_MPI_FLOAT
+#elif OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL2                 OMPI_DATATYPE_MPI_DOUBLE
+#elif OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_LONG_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL2                 OMPI_DATATYPE_MPI_LONG_DOUBLE
+#else
+#  define OMPI_DATATYPE_MPI_REAL2                 OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_REAL4 == OMPI_SIZEOF_FORTRAN_REAL
+#  define OMPI_DATATYPE_MPI_REAL4                 OMPI_DATATYPE_MPI_REAL
+#elif OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_FLOAT
+#  define OMPI_DATATYPE_MPI_REAL4                 OMPI_DATATYPE_MPI_FLOAT
+#elif OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL4                 OMPI_DATATYPE_MPI_DOUBLE
+#elif OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_LONG_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL4                 OMPI_DATATYPE_MPI_LONG_DOUBLE
+#else
+#  define OMPI_DATATYPE_MPI_REAL4                 OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_REAL8 == OMPI_SIZEOF_FORTRAN_REAL
+#  define OMPI_DATATYPE_MPI_REAL8                 OMPI_DATATYPE_MPI_REAL
+#elif OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_FLOAT
+#  define OMPI_DATATYPE_MPI_REAL8                 OMPI_DATATYPE_MPI_FLOAT
+#elif OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL8                 OMPI_DATATYPE_MPI_DOUBLE
+#elif OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_LONG_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL8                 OMPI_DATATYPE_MPI_LONG_DOUBLE
+#else
+#  define OMPI_DATATYPE_MPI_REAL8                 OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+#if OMPI_SIZEOF_FORTRAN_REAL16 == OMPI_SIZEOF_FORTRAN_REAL
+#  define OMPI_DATATYPE_MPI_REAL16                OMPI_DATATYPE_MPI_REAL
+#elif OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_FLOAT
+#  define OMPI_DATATYPE_MPI_REAL16                OMPI_DATATYPE_MPI_FLOAT
+#elif OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL16                OMPI_DATATYPE_MPI_DOUBLE
+#elif OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_LONG_DOUBLE
+#  define OMPI_DATATYPE_MPI_REAL16                OMPI_DATATYPE_MPI_LONG_DOUBLE
+#else
+#  define OMPI_DATATYPE_MPI_REAL16                OMPI_DATATYPE_MPI_UNAVAILABLE
+#endif
+
+
 OMPI_DECLSPEC extern union dt_elem_desc ompi_datatype_predefined_elem_desc[2 * OMPI_DATATYPE_MPI_MAX_PREDEFINED];
 extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX_PREDEFINED];

Reply via email to