summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/FindMPI/test_mpi.c
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-11-27 18:46:04 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-11-27 18:46:04 (GMT)
commita6970e204cdcff1fdbd31e40ad9adc65e2162008 (patch)
tree1aff80b47866e9bf9be99c348ea504f5b8caac89 /config/cmake_ext_mod/FindMPI/test_mpi.c
parentea4f752ace88b0a9931d6f806044d86fc652ecf7 (diff)
parent96784c9873433b57de813c5afadd5d9771103686 (diff)
downloadhdf5-a6970e204cdcff1fdbd31e40ad9adc65e2162008.zip
hdf5-a6970e204cdcff1fdbd31e40ad9adc65e2162008.tar.gz
hdf5-a6970e204cdcff1fdbd31e40ad9adc65e2162008.tar.bz2
Merge branch 'bugfix/version_bounds' of https://bitbucket.hdfgroup.org/scm/~bmribler/version_bounds_bmr into bugfix/version_bounds
Diffstat (limited to 'config/cmake_ext_mod/FindMPI/test_mpi.c')
-rw-r--r--config/cmake_ext_mod/FindMPI/test_mpi.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/config/cmake_ext_mod/FindMPI/test_mpi.c b/config/cmake_ext_mod/FindMPI/test_mpi.c
new file mode 100644
index 0000000..b8a308a
--- /dev/null
+++ b/config/cmake_ext_mod/FindMPI/test_mpi.c
@@ -0,0 +1,37 @@
+#include <mpi.h>
+
+#ifdef __cplusplus
+#include <cstdio>
+#else
+#include <stdio.h>
+#endif
+
+#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
+const char mpiver_str[] = { 'I', 'N',
+ 'F', 'O',
+ ':', 'M',
+ 'P', 'I',
+ '-', 'V',
+ 'E', 'R',
+ '[', ('0' + MPI_VERSION),
+ '.', ('0' + MPI_SUBVERSION),
+ ']', '\0' };
+#endif
+
+int main(int argc, char* argv[])
+{
+#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
+#ifdef __cplusplus
+ std::puts(mpiver_str);
+#else
+ puts(mpiver_str);
+#endif
+#endif
+#ifdef TEST_MPI_MPICXX
+ MPI::MPI_Init(&argc, &argv);
+ MPI::MPI_Finalize();
+#else
+ MPI_Init(&argc, &argv);
+ MPI_Finalize();
+#endif
+}