Skip to content

Commit bc35052

Browse files
Fix: Assert that MPI_BYTE is 1 byte large
Signed-off-by: Florent Germain <florent.germain@atos.net>
1 parent 0c1a20f commit bc35052

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

ompi/datatype/ompi_datatype_internal.h

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,14 @@
133133
* of being redefined as independent types, they will be made synonyms to
134134
* the most basic type.
135135
*/
136-
#if SIZEOF_CHAR == 1
136+
#if SIZEOF_CHAR != 1
137+
#error Open MPI asserts that sizeof(char) is 1. This seems not to be the case here. Please report on Open MPI github (see issue #11815)
138+
#endif
139+
137140
#define OMPI_DATATYPE_MPI_CHAR OMPI_DATATYPE_MPI_INT8_T
138141
#define OMPI_DATATYPE_MPI_SIGNED_CHAR OMPI_DATATYPE_MPI_INT8_T
139142
#define OMPI_DATATYPE_MPI_UNSIGNED_CHAR OMPI_DATATYPE_MPI_UINT8_T
140143
#define OMPI_DATATYPE_MPI_BYTE OMPI_DATATYPE_MPI_UINT8_T
141-
#elif SIZEOF_CHAR == 2
142-
#define OMPI_DATATYPE_MPI_CHAR OMPI_DATATYPE_MPI_INT16_T
143-
#define OMPI_DATATYPE_MPI_SIGNED_CHAR OMPI_DATATYPE_MPI_INT16_T
144-
#define OMPI_DATATYPE_MPI_UNSIGNED_CHAR OMPI_DATATYPE_MPI_UINT16_T
145-
#define OMPI_DATATYPE_MPI_BYTE OMPI_DATATYPE_MPI_UINT16_T
146-
#elif SIZEOF_CHAR == 4
147-
#define OMPI_DATATYPE_MPI_CHAR OMPI_DATATYPE_MPI_INT32_T
148-
#define OMPI_DATATYPE_MPI_SIGNED_CHAR OMPI_DATATYPE_MPI_INT32_T
149-
#define OMPI_DATATYPE_MPI_UNSIGNED_CHAR OMPI_DATATYPE_MPI_UINT32_T
150-
#define OMPI_DATATYPE_MPI_BYTE OMPI_DATATYPE_MPI_UINT32_T
151-
#elif SIZEOF_CHAR == 8
152-
#define OMPI_DATATYPE_MPI_CHAR OMPI_DATATYPE_MPI_INT64_T
153-
#define OMPI_DATATYPE_MPI_SIGNED_CHAR OMPI_DATATYPE_MPI_INT64_T
154-
#define OMPI_DATATYPE_MPI_UNSIGNED_CHAR OMPI_DATATYPE_MPI_UINT64_T
155-
#define OMPI_DATATYPE_MPI_BYTE OMPI_DATATYPE_MPI_UINT64_T
156-
#endif
157144

158145
#if SIZEOF_SHORT == 1
159146
#define OMPI_DATATYPE_MPI_SHORT OMPI_DATATYPE_MPI_INT8_T
@@ -519,27 +506,10 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX
519506
#define OMPI_DATATYPE_INITIALIZER_INT64_T OPAL_DATATYPE_INITIALIZER_INT8
520507
#define OMPI_DATATYPE_INITIALIZER_UINT64_T OPAL_DATATYPE_INITIALIZER_UINT8
521508

522-
#if SIZEOF_CHAR == 1
523509
#define OMPI_DATATYPE_INITIALIZER_CHAR OPAL_DATATYPE_INITIALIZER_INT1
524510
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_CHAR OPAL_DATATYPE_INITIALIZER_UINT1
525511
#define OMPI_DATATYPE_INITIALIZER_SIGNED_CHAR OPAL_DATATYPE_INITIALIZER_INT1
526512
#define OMPI_DATATYPE_INITIALIZER_BYTE OPAL_DATATYPE_INITIALIZER_UINT1
527-
#elif SIZEOF_CHAR == 2
528-
#define OMPI_DATATYPE_INITIALIZER_CHAR OPAL_DATATYPE_INITIALIZER_INT2
529-
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_CHAR OPAL_DATATYPE_INITIALIZER_UINT2
530-
#define OMPI_DATATYPE_INITIALIZER_SIGNED_CHAR OPAL_DATATYPE_INITIALIZER_INT2
531-
#define OMPI_DATATYPE_INITIALIZER_BYTE OPAL_DATATYPE_INITIALIZER_UINT2
532-
#elif SIZEOF_CHAR == 4
533-
#define OMPI_DATATYPE_INITIALIZER_CHAR OPAL_DATATYPE_INITIALIZER_INT4
534-
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_CHAR OPAL_DATATYPE_INITIALIZER_UINT4
535-
#define OMPI_DATATYPE_INITIALIZER_SIGNED_CHAR OPAL_DATATYPE_INITIALIZER_INT4
536-
#define OMPI_DATATYPE_INITIALIZER_BYTE OPAL_DATATYPE_INITIALIZER_UINT4
537-
#elif SIZEOF_CHAR == 8
538-
#define OMPI_DATATYPE_INITIALIZER_CHAR OPAL_DATATYPE_INITIALIZER_INT8
539-
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_CHAR OPAL_DATATYPE_INITIALIZER_UINT8
540-
#define OMPI_DATATYPE_INITIALIZER_SIGNED_CHAR OPAL_DATATYPE_INITIALIZER_INT8
541-
#define OMPI_DATATYPE_INITIALIZER_BYTE OPAL_DATATYPE_INITIALIZER_UINT8
542-
#endif
543513

544514
#if SIZEOF_SHORT == 2
545515
#define OMPI_DATATYPE_INITIALIZER_SHORT OPAL_DATATYPE_INITIALIZER_INT2

0 commit comments

Comments
 (0)