The GPU support from \gromacs{} version 4.5 using \openmm{}
\url{https://simtk.org/home/openmm} is still contained in the code,
but in the ``user contributions'' section (\verb+src/contrib+). You
-will need to edit \verb+src/contrib/CMakeLists.txt+ to enable it. It
-also requires \cuda{}, and remains the only hardware-based
-acceleration available for implicit solvent simulations in
-\gromacs{} at the moment. However, the long-term plan is to enable
-this functionality in core Gromacs, and not have the OpenMM
-interface supported by the \gromacs team. Right now there are
-some build issues for OpenMM.
+will need to set
+\verb+-DGMX_OPENMM=on -DGMX_GPU=off -DGMX_MPI=off
+-DGMX_THREAD_MPI=off\+ in order to build it. It also requires \cuda{},
+and remains the only hardware-based acceleration available for
+implicit solvent simulations in \gromacs{} at the moment. However, the
+long-term plan is to enable this functionality in core Gromacs, and
+not have the OpenMM interface supported by the \gromacs team.
If you wish to run in parallel on multiple machines across a network,
you will need to have
# if the same OpenMM installation is used for running and building
add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" )
file(TO_CMAKE_PATH ${OpenMM_PLUGIN_DIR} _path)
-add_library(openmm_api_wrapper STATIC openmm_wrapper.cpp)
+add_library(openmm_api_wrapper STATIC ${CMAKE_SOURCE_DIR}/src/contrib/openmm_wrapper.cpp)
target_link_libraries(openmm_api_wrapper ${OpenMM_LIBRARIES})
-list(APPEND GMX_EXTRA_LIBRARIES openmm_api_wrapper ${OpenMM_LIBRARIES})
-list(REMOVE_ITEM MDRUN_SOURCES mdrun.c)
+list(REMOVE_ITEM MDRUN_SOURCES mdrun.c runner.c)
list(APPEND MDRUN_SOURCES
- ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/md_openmm.c
- ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/mdrun_openmm.c)
+ ${CMAKE_SOURCE_DIR}/src/contrib/md_openmm.c
+ ${CMAKE_SOURCE_DIR}/src/contrib/mdrun_openmm.c
+ ${CMAKE_SOURCE_DIR}/src/contrib/runner_openmm.c
+ )
# this is to circumvent the following MSVC error:
# warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs
message(FATAL_ERROR "The OpenMM build is not compatible with the native GPU build")
endif()
- enable_language(CXX)
- set (GMX_BINARY_SUFFIX "-openmm")
- set (GMX_LIBS_SUFFIX "_openmm")
+ # These won't actually do anything unless they precede the
+ # definition of these options elsewhere. However, they can't be
+ # FORCE-d either.
+ set(GMX_BINARY_SUFFIX "-openmm" CACHE STRING "Suffix to distinguish OpenMM build from normal")
+ set(GMX_LIBS_SUFFIX "_openmm" CACHE STRING "Suffix to distinguish OpenMM build from normal")
#######################################################################
# Check for options incompatible with OpenMM build #
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(CUDA_VERBOSE_BUILD ON)
endif()
- list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib)
- find_package(OpenMM)
# mark as advanced the unused variables
mark_as_advanced(FORCE GMX_CPU_ACCELERATION GMX_MPI GMX_FFT_LIBRARY
{ efXVG, "-tpi", "tpi", ffOPTWR },
{ efXVG, "-tpid", "tpidist", ffOPTWR },
{ efEDI, "-ei", "sam", ffOPTRD },
- { efEDO, "-eo", "sam", ffOPTWR },
+ { efXVG, "-eo", "sam", ffOPTWR },
{ efGCT, "-j", "wham", ffOPTRD },
{ efGCT, "-jo", "bam", ffOPTWR },
{ efXVG, "-ffout", "gct", ffOPTWR },
{ NULL, "interleave", "pp_pme", "cartesian", NULL };
const char *dddlb_opt[] =
{ NULL, "auto", "no", "yes", NULL };
+ const char *thread_aff_opt[threadaffNR+1] =
+ { NULL, "auto", "no", "yes", NULL };
const char *nbpu_opt[] =
{ NULL, "auto", "cpu", "gpu", "gpu_cpu", NULL };
real rdd=0.0,rconstr=0.0,dlb_scale=0.8,pforce=-1;
"Number of OpenMP threads per MPI process/thread to start (0 is guess)" },
{ "-ntomp_pme", FALSE, etINT, {&hw_opt.nthreads_omp_pme},
"Number of OpenMP threads per MPI process/thread to start (0 is -ntomp)" },
- { "-pin", FALSE, etBOOL, {&hw_opt.bThreadPinning},
+ { "-pin", FALSE, etBOOL, {thread_aff_opt},
"Pin OpenMP threads to cores" },
- { "-pinht", FALSE, etBOOL, {&hw_opt.bPinHyperthreading},
- "Always pin threads to Hyper-Threading cores" },
{ "-pinoffset", FALSE, etINT, {&hw_opt.core_pinning_offset},
"Core offset for pinning (for running multiple mdrun processes on a single physical node)" },
+ { "-pinstride", FALSE, etINT, {&hw_opt.core_pinning_stride},
+ "Pinning distance in logical cores for threads, use 0 to minimize the number of threads per physical core" },
{ "-gpu_id", FALSE, etSTR, {&hw_opt.gpu_id},
"List of GPU id's to use" },
{ "-ddcheck", FALSE, etBOOL, {&bDDBondCheck},
if (MULTISIM(cr) && MASTER(cr))
{
- check_multi_int(stdout,cr->ms,sim_part,"simulation part");
+ check_multi_int(stdout,cr->ms,sim_part,"simulation part", TRUE);
}
}
else
# Even though the OpenMM build has "moved to contrib", many things
# have be be done from within the scope of the CMakeLists.txt that
# builds its mdrun, and that is here
- include(../contrib/BuildMdrunOpenMM)
+ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/contrib)
+ find_package(OpenMM)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ include(${CMAKE_SOURCE_DIR}/src/contrib/BuildMdrunOpenMM.cmake)
endif(GMX_OPENMM)
if(GMX_GPU OR GMX_FORCE_CXX)
target_link_libraries(mdrun gmxpreprocess md gmx ${OpenMP_LINKER_FLAGS})
set_target_properties(mdrun PROPERTIES OUTPUT_NAME "mdrun${GMX_BINARY_SUFFIX}" COMPILE_FLAGS "${OpenMP_C_FLAGS}")
+if(GMX_OPENMM)
+ target_link_libraries(mdrun openmm_api_wrapper)
+endif()
+
# Construct component groups for installation; note that a component may
# belong to only one group
foreach(PROGRAM ${GMX_KERNEL_PROGRAMS})