1 # Manage the MPI setup, assuming that CMAKE_C_COMPILER is an MPI
5 set(GMX_THREADS OFF CACHE BOOL
6 "Thread-based parallelization conflicts with MPI." FORCE)
9 # Test the CMAKE_C_COMPILER for being an MPI (wrapper) compiler
10 TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR}
11 "${CMAKE_SOURCE_DIR}/cmake/TestMPI.c"
16 add_definitions( -DMPI ) #for FAHCORE
18 include(gmxTestMPI_IN_PLACE)
20 gmx_test_mpi_in_place(MPI_IN_PLACE_EXISTS)
23 # Test for and warn about unsuitable MPI versions
24 exec_program(ompi_info
26 OUTPUT_VARIABLE OPENMPI_TYPE
27 RETURN_VALUE OPENMPI_EXEC_RETURN)
28 if(OPENMPI_EXEC_RETURN EQUAL 0)
29 string(REGEX REPLACE ".*Open MPI: \([0-9]+\\.[0-9]*\\.?[0-9]*\).*" "\\1" OPENMPI_VERSION ${OPENMPI_TYPE})
30 if(OPENMPI_VERSION VERSION_LESS "1.4.1")
32 CMake found OpenMPI version ${OPENMPI_VERSION} on your system.
33 There are known problems with GROMACS and OpenMPI version < 1.4.1.
34 Please consider updating your OpenMPI if your MPI wrapper compilers
35 are using the above OpenMPI version.")
37 unset(OPENMPI_VERSION)
39 unset(OPENMPI_EXEC_RETURN)
43 OUTPUT_VARIABLE MVAPICH2_TYPE
44 RETURN_VALUE MVAPICH2_EXEC_RETURN)
45 if(MVAPICH2_EXEC_RETURN EQUAL 0)
46 string(REGEX MATCH "MVAPICH2" MVAPICH2_NAME ${MVAPICH2_TYPE})
47 # Want to check for MVAPICH2 in case some other library supplies mpiname
48 string(REGEX REPLACE "MVAPICH2 \([0-9]+\\.[0-9]*[a-z]?\\.?[0-9]*\)" "\\1" MVAPICH2_VERSION ${MVAPICH2_TYPE})
49 if(${MVAPICH2_NAME} STREQUAL "MVAPICH2" AND MVAPICH2_VERSION VERSION_LESS "1.5")
50 # This test works correctly even with 1.5a1
52 CMake found MVAPICH2 version ${MVAPICH2_VERSION} on your system.
53 There are known problems with GROMACS and MVAPICH2 version < 1.5.
54 Please consider updating your MVAPICH2 if your MPI wrapper compilers
55 are using the above MVAPICH2 version.")
57 unset(MVAPICH2_VERSION)
60 unset(MVAPICH2_EXEC_RETURN)
64 message(FATAL_ERROR "MPI support requested, but no MPI compiler found.")
67 include(gmxTestCatamount)
68 gmx_test_catamount(GMX_CRAY_XT3)
70 set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_CRAY_XT3")
76 set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_LIB_MPI")