xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/mpi/type-mismatch.rst (revision 6e566bc5523f743bc34a7e26f050f1f2b4d699a8)
1.. title:: clang-tidy - mpi-type-mismatch
2
3mpi-type-mismatch
4=================
5
6This check verifies if buffer type and MPI (Message Passing Interface) datatype
7pairs match for used MPI functions. All MPI datatypes defined by the MPI
8standard (3.1) are verified by this check. User defined typedefs, custom MPI
9datatypes and null pointer constants are skipped, in the course of verification.
10
11Example:
12
13.. code-block:: c++
14
15  // In this case, the buffer type matches MPI datatype.
16  char buf;
17  MPI_Send(&buf, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
18
19  // In the following case, the buffer type does not match MPI datatype.
20  int buf;
21  MPI_Send(&buf, 1, MPI_CHAR, 0, 0, MPI_COMM_WORLD);
22