libver_mpi.c 357 B

1234567891011121314151617181920
  1. #include <mpi.h>
  2. #ifdef __cplusplus
  3. # include <cstdio>
  4. #else
  5. # include <stdio.h>
  6. #endif
  7. int main(int argc, char* argv[])
  8. {
  9. char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING];
  10. int mpilibver_len;
  11. MPI_Get_library_version(mpilibver_str, &mpilibver_len);
  12. #ifdef __cplusplus
  13. std::puts(mpilibver_str);
  14. #else
  15. puts(mpilibver_str);
  16. #endif
  17. return 0;
  18. }