cmake (3.27.7)

(root)/
share/
cmake-3.27/
Modules/
FindMPI/
test_mpi.c
       1  #include <mpi.h>
       2  
       3  #ifdef __cplusplus
       4  #  include <cstdio>
       5  #else
       6  #  include <stdio.h>
       7  #endif
       8  
       9  #if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
      10  static const char mpiver_str[] = { 'I', 'N',
      11                                     'F', 'O',
      12                                     ':', 'M',
      13                                     'P', 'I',
      14                                     '-', 'V',
      15                                     'E', 'R',
      16                                     '[', ('0' + MPI_VERSION),
      17                                     '.', ('0' + MPI_SUBVERSION),
      18                                     ']', '\0' };
      19  #endif
      20  
      21  int main(int argc, char* argv[])
      22  {
      23  #if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
      24  #  ifdef __cplusplus
      25    std::puts(mpiver_str);
      26  #  else
      27    puts(mpiver_str);
      28  #  endif
      29  #endif
      30  #ifdef TEST_MPI_MPICXX
      31    MPI::MPI_Init(&argc, &argv);
      32    MPI::MPI_Finalize();
      33  #else
      34    MPI_Init(&argc, &argv);
      35    MPI_Finalize();
      36  #endif
      37    return 0;
      38  }