Commit fb17d2b0 authored by Junchao Zhang's avatar Junchao Zhang
Browse files

Disable Clang's type checking for MPI_2INT

Type checking for MPI_2INT is commented out because Clang 3.3 flags
struct {int i1; int i2;} as different from int[2]. But actually these
two types are of the same layout. Clang gives a type mismatch warning
for a definitely correct code like the following:
 int in[2], out[2];
 MPI_Reduce(in, out, 1, MPI_2INT, MPI_MAXLOC, 0, MPI_COMM_WORLD);

So, we disable type checking for MPI_2INT until Clang fixes this bug.

Fixes #1993

Signed off by Rajeev Thakur <thakur@mcs.anl.gov>
parent 8c5ab383
......@@ -168,7 +168,21 @@ static const MPI_Datatype mpich_mpi_float_int MPICH_ATTR_TYPE_TAG_LAYOUT_C
static const MPI_Datatype mpich_mpi_double_int MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE(struct mpich_struct_mpi_double_int) = MPI_DOUBLE_INT;
static const MPI_Datatype mpich_mpi_long_int MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE(struct mpich_struct_mpi_long_int) = MPI_LONG_INT;
static const MPI_Datatype mpich_mpi_short_int MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE(struct mpich_struct_mpi_short_int) = MPI_SHORT_INT;
static const MPI_Datatype mpich_mpi_2int MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE(struct mpich_struct_mpi_2int) = MPI_2INT;
/*
* The MPI_2INT line is commented out because currently Clang 3.3 flags
* struct {int i1; int i2;} as different from int[2]. But actually these
* two types are of the same layout. Clang gives a type mismatch warning
* for a definitely correct code like the following:
* int in[2], out[2];
* MPI_Reduce(in, out, 1, MPI_2INT, MPI_MAXLOC, 0, MPI_COMM_WORLD);
*
* So, we disable type checking for MPI_2INT until Clang fixes this bug.
*/
/* static const MPI_Datatype mpich_mpi_2int MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE(struct mpich_struct_mpi_2int) = MPI_2INT
*/
#if @MPI_LONG_DOUBLE_INT@ != 0x0c000000
static const MPI_Datatype mpich_mpi_long_double_int MPICH_ATTR_TYPE_TAG_LAYOUT_COMPATIBLE(struct mpich_struct_mpi_long_double_int) = MPI_LONG_DOUBLE_INT;
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment