1 # Manage the MPI setup, assuming that CMAKE_C_COMPILER is an MPI
5 message(STATUS "MPI is not compatible with thread-MPI. Disabling thread-MPI.")
6 set(GMX_THREAD_MPI OFF CACHE BOOL
7 "Build a thread-MPI-based multithreaded version of GROMACS (not compatible with MPI)" FORCE)
10 # Test the CMAKE_C_COMPILER for being an MPI (wrapper) compiler
11 TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR}
12 "${CMAKE_SOURCE_DIR}/cmake/TestMPI.c"
17 add_definitions( -DMPI ) #for FAHCORE
19 include(gmxTestMPI_IN_PLACE)
21 gmx_test_mpi_in_place(MPI_IN_PLACE_EXISTS)
24 # Test for and warn about unsuitable MPI versions
25 exec_program(ompi_info
27 OUTPUT_VARIABLE OPENMPI_TYPE
28 RETURN_VALUE OPENMPI_EXEC_RETURN)
29 if(OPENMPI_EXEC_RETURN EQUAL 0)
30 string(REGEX REPLACE ".*Open MPI: \([0-9]+\\.[0-9]*\\.?[0-9]*\).*" "\\1" OPENMPI_VERSION ${OPENMPI_TYPE})
31 if(OPENMPI_VERSION VERSION_LESS "1.4.1")
33 CMake found OpenMPI version ${OPENMPI_VERSION} on your system.
34 There are known problems with GROMACS and OpenMPI version < 1.4.1.
35 Please consider updating your OpenMPI if your MPI wrapper compilers
36 are using the above OpenMPI version.")
38 unset(OPENMPI_VERSION)
40 unset(OPENMPI_EXEC_RETURN)
44 OUTPUT_VARIABLE MVAPICH2_TYPE
45 RETURN_VALUE MVAPICH2_EXEC_RETURN)
46 if(MVAPICH2_EXEC_RETURN EQUAL 0)
47 string(REGEX MATCH "MVAPICH2" MVAPICH2_NAME ${MVAPICH2_TYPE})
48 # Want to check for MVAPICH2 in case some other library supplies mpiname
49 string(REGEX REPLACE "MVAPICH2 \([0-9]+\\.[0-9]*[a-z]?\\.?[0-9]*\)" "\\1" MVAPICH2_VERSION ${MVAPICH2_TYPE})
50 if(${MVAPICH2_NAME} STREQUAL "MVAPICH2" AND MVAPICH2_VERSION VERSION_LESS "1.5")
51 # This test works correctly even with 1.5a1
53 CMake found MVAPICH2 version ${MVAPICH2_VERSION} on your system.
54 There are known problems with GROMACS and MVAPICH2 version < 1.5.
55 Please consider updating your MVAPICH2 if your MPI wrapper compilers
56 are using the above MVAPICH2 version.")
58 unset(MVAPICH2_VERSION)
61 unset(MVAPICH2_EXEC_RETURN)
65 message(FATAL_ERROR "MPI support requested, but no MPI compiler found.")
68 include(gmxTestCatamount)
69 gmx_test_catamount(GMX_CRAY_XT3)
71 set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_CRAY_XT3")
77 set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_LIB_MPI")