set(GMX_SHARED_LINKER_FLAGS ${GMX_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS})
endif()
+
########################################################################
# Specify install locations
########################################################################
# Use GNUInstallDirs to set paths on multiarch systems.
include(GNUInstallDirs)
-# Customization for the installation tree paths.
-set(GMX_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
- "Library installation directory (default: ${CMAKE_INSTALL_LIBDIR})")
-set(GMX_DATA_INSTALL_DIR gromacs CACHE STRING
- "Data installation directory under share/ (default: gromacs)")
-mark_as_advanced(GMX_LIB_INSTALL_DIR GMX_DATA_INSTALL_DIR)
-
-# These variables are used internally to provide a central location for
-# customizing the install locations.
-set(LIB_INSTALL_DIR ${GMX_LIB_INSTALL_DIR})
-set(BIN_INSTALL_DIR bin)
-# This variable also gets written into config.h for use in finding the data
-# directories.
-set(DATA_INSTALL_DIR share/${GMX_DATA_INSTALL_DIR})
-set(MAN_INSTALL_DIR share/man)
+set(GMX_INSTALL_DATASUBDIR "gromacs" CACHE STRING "Subdirectory for GROMACS data under CMAKE_INSTALL_DATADIR")
+mark_as_advanced(GMX_INSTALL_DATASUBDIR)
+
+# Internal convenience so we do not have to join two path segments in the code
+set(GMX_INSTALL_GMXDATADIR ${CMAKE_INSTALL_DATADIR}/${GMX_INSTALL_DATASUBDIR})
+
# If the nesting level wrt. the installation root is changed,
# gromacs-config.cmake.cmakein needs to be adapted.
-set(CMAKE_INSTALL_DIR share/cmake)
+set(GMX_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATAROOTDIR}/cmake)
+
# TODO: Make GMXRC adapt if this is changed
-set(PKGCONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/pkgconfig)
-set(OCL_INSTALL_DIR ${DATA_INSTALL_DIR}/opencl)
-set(INCL_INSTALL_DIR include)
+set(GMX_INSTALL_PKGCONFIGDIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+set(GMX_INSTALL_OCLDIR ${GMX_INSTALL_GMXDATADIR}/opencl)
-list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${INCL_INSTALL_DIR})
+list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${CMAKE_INSTALL_INCLUDEDIR})
# Binary and library suffix options
include(gmxManageSuffixes)
# install to lib/, then the installation RPATH works also in the build
# tree. This makes installation slightly faster (no need to rewrite the
# RPATHs), and makes the binaries in the build tree relocatable.
- if(GMX_LIB_INSTALL_DIR STREQUAL "lib")
+ if(CMAKE_INSTALL_LIBDIR STREQUAL "lib")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW) # From CMake-3.9
# Set the RPATH as relative to the executable location to make the
# binaries relocatable.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") #Assume OS X >=10.5
- set(CMAKE_INSTALL_RPATH "@executable_path/../${GMX_LIB_INSTALL_DIR}")
+ set(CMAKE_INSTALL_RPATH "@executable_path/../${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_RPATH})
else()
- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${GMX_LIB_INSTALL_DIR}")
+ set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MACOSX_RPATH 1)
#COPYING file: Only necessary for binary distributions.
#Simpler to always install.
-install(FILES COPYING DESTINATION ${DATA_INSTALL_DIR} COMPONENT data)
+install(FILES COPYING DESTINATION ${GMX_INSTALL_GMXDATADIR} COMPONENT data)
if (GMX_BUILD_FOR_COVERAGE)
# Code heavy with asserts makes conditional coverage close to useless metric,
* GROMACS: A message-passing parallel molecular dynamics implementation
H.J.C. Berendsen, D. van der Spoel and R. van Drunen
Comp. Phys. Comm. 91, 43-56 (1995)
- DOI: 10.1016/0010-4655(95)00042-E
+ DOI: https://doi.org/10.1016/0010-4655(95)00042-E
* GROMACS 4: Algorithms for highly efficient, load-balanced, and scalable
molecular simulation
B. Hess and C. Kutzner and D. van der Spoel and E. Lindahl
J. Chem. Theory Comput. 4 (2008) pp. 435-447
- DOI: 10.1021/ct700301q
+ DOI: https://doi.org/10.1021/ct700301q
* GROMACS 4.5: a high-throughput and highly parallel open source
molecular simulation toolkit
Rossen Apostolov, Michael R. Shirts, Jeremy C. Smith, Peter M. Kasson,
David van der Spoel, Berk Hess, Erik Lindahl.
Bioinformatics 29 (2013) pp. 845-54
- DOI: 10.1093/bioinformatics/btt055
+ DOI: https://doi.org/10.1093/bioinformatics/btt055
* Tackling Exascale Software Challenges in Molecular Dynamics Simulations
with GROMACS
Szilárd Páll, Mark J. Abraham, Carsten Kutzner, Berk Hess, Erik Lindahl
In S. Markidis & E. Laure (Eds.), Solving Software Challenges for Exascale,
- 8759 (2015) pp. 3–27
- DOI: 10.1007/978-3-319-15976-8_1
+ Lecture Notes for Computer Science, 8759 (2015) pp. 3–27
+ DOI: https://doi.org/10.1007/978-3-319-15976-8_1
+
+* GROMACS: High performance molecular simulations through multi-level parallelism from laptops to supercomputers
+ M. J. Abraham, T. Murtola, R. Schulz, S. Páll, J. C. Smith, B. Hess, E. Lindahl,
+ SoftwareX, 1, (2015), 19-25
+ DOI: https://doi.org/10.1016/j.softx.2015.06.001
There are a lot of cool features we'd like to include in future versions,
but our resources are limited. All kinds of donations are welcome, both in
-#!/usr/bin/env python2
+#!/usr/bin/env python
#
# This file is part of the GROMACS molecular simulation package.
#
set(REGRESSIONTEST_VERSION "${GMX_VERSION_STRING}")
set(REGRESSIONTEST_BRANCH "refs/heads/release-2018")
-set(REGRESSIONTEST_MD5SUM "1a94916e2cf90e34fddb3514a65e0154" CACHE INTERNAL "MD5 sum of the regressiontests tarball")
+# Run the regressiontests packaging job with the correct pakage
+# version string, and the release box checked, in order to have it
+# build the regressiontests tarball with all the right naming. The
+# naming affects the md5sum that has to go here, and if it isn't right
+# release workflow will report a failure.
+set(REGRESSIONTEST_MD5SUM "135149af467a37714a92bc29801cafda" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
math(EXPR GMX_VERSION_NUMERIC
"${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
release-notes/removed-features.rst
release-notes/portability.rst
release-notes/miscellaneous.rst
+ release-notes/2018/2018.3.rst
release-notes/2018/2018.2.rst
release-notes/2018/2018.1.rst
release-notes/2018/major/highlights.rst
# Trailing slash on directory is significant for
# install(DIRECTORY). See CMake docs.
install(DIRECTORY ${MAN_PAGE_DIR}/
- DESTINATION ${MAN_INSTALL_DIR}/man1
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
COMPONENT man OPTIONAL
FILES_MATCHING PATTERN "*.1")
endif()
subcounters which are available.
Defaults to ``OFF``.
-.. cmake:: GMX_DATA_INSTALL_DIR
+.. cmake:: GMX_INSTALL_DATASUBDIR
- Sets the directory under :file:`share/` where data files are installed.
- The default is ``gromacs``, which puts the files under
- file:`share/gromacs/`.
+ Sets the subdirectory under CMAKE_INSTALL_DATADIR where GROMACS-specific
+ read-only architecture-independent data files are installed. The default
+ is ``gromacs``, which means the files will go under ``share/gromacs``.
+ To alter the ``share`` part, change CMAKE_INSTALL_DATADIR.
See :doc:`relocatable-binaries` for how this influences the build.
.. cmake:: GMX_DOUBLE
Pass additional CUDA-only compiler flags to clang using this variable.
-.. cmake:: GMX_LIB_INSTALL_DIR
+.. cmake:: CMAKE_INSTALL_LIBDIR
Sets the installation directory for libraries (default is determined by
standard CMake package ``GNUInstallDirs``).
contains :file:`share/{gromacs}/top/gurgle.dat`, this directory is returned
as the installation prefix. The file name ``gurgle.dat`` and the location
are considered unique enough to ensure that the correct directory has been
- found. The installation directory for the data files can be customized
- during CMake configuration by setting ``GMX_DATA_INSTALL_DIR``, which
- affects the *gromacs* part in the above path (both in the installation
- structure and in this search logic).
+ found. The installation directory for read-only architecture-independent
+ data files can be customized during CMake configuration by setting
+ ``CMAKE_INSTALL_DATADIR``, and the subdirectory under this that hosts the
+ GROMACS-specific data is set by ``GMX_INSTALL_DATASUBDIR``.
Note that this search does not resolve symbolic links or normalize the input
path beforehand: if there are ``..`` components *and* symbolic links in the
The standard location for executables and some scripts.
Some of the scripts hardcode the absolute installation prefix, which needs
to be changed if the scripts are relocated.
+ The name of the directory can be changed using ``CMAKE_INSTALL_BINDIR`` CMake
+ variable.
``include/gromacs/``
The standard location for installed headers.
``lib/``
The standard location for libraries. The default depends on the system, and
is determined by CMake.
- The name of the directory can be changed using ``GMX_LIB_INSTALL_DIR`` CMake
+ The name of the directory can be changed using ``CMAKE_INSTALL_LIBDIR`` CMake
variable.
``lib/pkgconfig/``
Information about the installed ``libgromacs`` library for ``pkg-config`` is
``share/cmake/``
CMake package configuration files are installed here.
``share/gromacs/``
- Various data files and some documentation go here.
- The ``gromacs`` part can be changed using ``GMX_DATA_INSTALL_DIR``. Using this
- CMake variable is the preferred way of changing the installation path for
+ Various data files and some documentation go here. The first part can
+ be changed using ``CMAKE_INSTALL_DATADIR``, and the second by using
+ ``GMX_INSTALL_DATASUBDIR`` Using these CMake variables is the preferred
+ way of changing the installation path for
``share/gromacs/top/``, since the path to this directory is built into
``libgromacs`` as well as some scripts, both as a relative and as an absolute
path (the latter as a fallback if everything else fails).
GROMACS 2018.2 release notes
----------------------------
-This version was released on TODO, 2018. These release notes document
+This version was released on June 14, 2018. These release notes document
the changes that have taken place in GROMACS since version 2018.1, to fix known
-issues. It also incorporates all fixes made in version TODO and
+issues. It also incorporates all fixes made in version 2016.5 and
earlier, which you can find described in the :ref:`release-notes`.
Fixes where mdrun could behave incorrectly
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Prevent OpenCL timing memory leak
-"""""""""""""""""""""""""""""""""
+Prevented OpenCL timing memory leak
+"""""""""""""""""""""""""""""""""""
When using OpenCL builds and timing, a memory leak would lead to all system memory being used up.
:issue:`2470`
+Fixed MPI error after constraint failure during energy minimization
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+:issue:`2540`
+
+Fixed moving frozen atoms with constraints
+""""""""""""""""""""""""""""""""""""""""""
+
+Frozen atoms which also had bond constraints could move.
+
+:issue:`2542`
+
+Fixed COM removal moving frozen atoms
+"""""""""""""""""""""""""""""""""""""
+
+When frozen atoms were part of center of mass motion removal groups,
+they could accumulate momentum and move.
+
+:issue:`2551`
+
+Fixed AWH too infrequent checks for covering
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+For multidimensional AWH grids with many points relative to the number
+of samples required for covering the grid, the detection of covering
+could be delayed because of too infrequent checks.
+
+:issue:`2487`
+
+Fixed AWH continuation consistency checks
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Some kinds of changes upon restarts are now disallowed, as intended.
+
+Fixed AWH awh-nsamples-update value checking
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Zero is now forbidden, as intended.
+
+:issue:`2489`
+
Fixes for ``gmx`` tools
^^^^^^^^^^^^^^^^^^^^^^^
:issue:`2465`
+Fixed infinite loop in gmx solvate
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+When provided with a PDB file that had no box information for the solvent,
+gmx solvate could be stuck in an infinite loop.
+Fixed by disallowing empty boxes for solvent PDB files.
+
+:issue:`2523`
+
+Fixed enemat when the .edr file had no matching energy groups
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+:issue:`2508`
+
+Fixed PQR file output
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+PQR files from gmx editconf violated the standard for the format because
+they were always written in fixed format. This commit fixes the issue by
+introducing a different output method for PQR files that follows the
+standard.
+
+:issue:`2511`
+
+Fixed crash in gmx solvate
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+gmx solvate would crash due to memory corruption when using multiple solvent
+molecule types.
+
+Added check for unallowed periodic setups
+"""""""""""""""""""""""""""""""""""""""""
+
+Long distances between atoms in bonded interactions could lead to incorrect
+periodicity removal. In such cases an inconsistent shift message was printed,
+but the run or analysis was not terminated and other, confusing, errors
+could be issued. Now an informative fatal error is issued.
+
+:issue:`2549`
+
Fixes to improve portability
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Fixed CUDA compilation on Windows.
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+:issue:`2509`
+
+Fixed SIMD support for POWER systems in double precision with gcc 8
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+:issue:`2421`
+
+
+Fixed possible illegal instruction on KNL with Intel compiler
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+:issue:`2504`
+
Miscellaneous
^^^^^^^^^^^^^
+Information message about OMP_NUM_THREADS now sent to log file
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Made it easier to track this information by writing it to the log file
+in a clear way, rather than to stderr.
+
+:issue:`2472`
+
Fixed inadvertent disabling of SIMD version of the integrator
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-Fixed a bug so the SIMD version of the leap-frog integrator is chosen, when possible.
+Fixed a bug so the SIMD version of the leap-frog integrator is chosen,
+when possible. This may improve performance.
:issue:`2497`
+
+Fixed own FFTW builds on certain AVX2/AVX512 hardware
+"""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Version 3.3.8 of FFTW fixes some known gcc-8 errors for AVX2 by removing the
+fast-math flag, and it also appears to fix an issue with failed unit tests on
+AVX512-capable hardware, so we have bumped the version we download to 3.3.8.
+
+:issue:`2541`
+
+Switched to using more standard CMake variables for installing on GNU systems
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+GnuInstallDirs.cmake is a better approach.
+
+Several documentation and output improvements
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+* Updated top-level README file for latest GROMACS core publication.
+* Reporting about GPU detection has improved.
+* ``gmx mindist -pi`` docs improved.
+* Docs for mdp options relating to bonds improved.
+* Fixed various typos.
+* Removed a leftover mention of the twin-range scheme.
+* `gmx trjconv -ndec`` docs improved.
--- /dev/null
+GROMACS 2018.3 release notes
+----------------------------
+
+This version was released on TODO, 2018. These release notes document
+the changes that have taken place in GROMACS since version 2018.2, to fix known
+issues. It also incorporates all fixes made in version TODO and
+earlier, which you can find described in the :ref:`release-notes`.
+
+Fixes where mdrun could behave incorrectly
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Fixes for ``gmx`` tools
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Fixes to improve portability
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Miscellaneous
+^^^^^^^^^^^^^
.. toctree::
:maxdepth: 1
+ 2018/2018.3
2018/2018.2
2018/2018.1
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2014, by the GROMACS development team, led by
+# Copyright (c) 2010,2014,2018, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/GMXRC.csh.cmakein ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.csh @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/GMXRC.zsh.cmakein ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.zsh @ONLY)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.bash DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.zsh DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.csh DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.bash DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.zsh DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/GMXRC.csh DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/demux.pl DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
-install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/xplor2gmx.pl DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/demux.pl DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
+install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/xplor2gmx.pl DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
# If you move gromacs, change the first line.
##########################################################
GMXPREFIX=@CMAKE_INSTALL_PREFIX@
-GMXBIN=${GMXPREFIX}/@BIN_INSTALL_DIR@
-GMXLDLIB=${GMXPREFIX}/@LIB_INSTALL_DIR@
-GMXMAN=${GMXPREFIX}/@MAN_INSTALL_DIR@
-GMXDATA=${GMXPREFIX}/@DATA_INSTALL_DIR@
+GMXBIN=${GMXPREFIX}/@CMAKE_INSTALL_BINDIR@
+GMXLDLIB=${GMXPREFIX}/@CMAKE_INSTALL_LIBDIR@
+GMXMAN=${GMXPREFIX}/@CMAKE_INSTALL_MANDIR@
+GMXDATA=${GMXPREFIX}/@GMX_INSTALL_GMXDATADIR@
GROMACS_DIR=${GMXPREFIX}
LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
echo $shell | grep -q csh && goto CSH
# if we got here, shell is bsh/bash/zsh/ksh
-. @CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/GMXRC.bash
+. @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/GMXRC.bash
return
# csh/tcsh jump here
CSH:
-source @CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/GMXRC.csh
+source @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/GMXRC.csh
# If you move gromacs, change the first line.
##########################################################
setenv GMXPREFIX @CMAKE_INSTALL_PREFIX@
-setenv GMXBIN ${GMXPREFIX}/@BIN_INSTALL_DIR@
-setenv GMXLDLIB ${GMXPREFIX}/@LIB_INSTALL_DIR@
-setenv GMXMAN ${GMXPREFIX}/@MAN_INSTALL_DIR@
-setenv GMXDATA ${GMXPREFIX}/@DATA_INSTALL_DIR@
+setenv GMXBIN ${GMXPREFIX}/@CMAKE_INSTALL_BINDIR@
+setenv GMXLDLIB ${GMXPREFIX}/@CMAKE_INSTALL_LIBDIR@
+setenv GMXMAN ${GMXPREFIX}/@CMAKE_INSTALL_MANDIR@
+setenv GMXDATA ${GMXPREFIX}/@GMX_INSTALL_GMXDATADIR@
setenv GROMACS_DIR ${GMXPREFIX}
#make them begin with :
# zsh configuration file for Gromacs
# only kept for backwards compatibility
-source @CMAKE_INSTALL_PREFIX@/@BIN_INSTALL_DIR@/GMXRC.bash
+source @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/GMXRC.bash
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2018, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
add_subdirectory(template)
install(FILES README.tutor README_FreeEnergyModifications.txt
- DESTINATION ${DATA_INSTALL_DIR}
+ DESTINATION ${GMX_INSTALL_GMXDATADIR}
COMPONENT data)
install(DIRECTORY top
- DESTINATION ${DATA_INSTALL_DIR}
+ DESTINATION ${GMX_INSTALL_GMXDATADIR}
COMPONENT data
PATTERN "*~" EXCLUDE)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2011,2012,2014,2016, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2014,2016,2018, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
configure_file(README.cmakein README @ONLY)
install(FILES CMakeLists.txt.template
- DESTINATION ${DATA_INSTALL_DIR}/template
+ DESTINATION ${GMX_INSTALL_GMXDATADIR}/template
RENAME CMakeLists.txt
COMPONENT development)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/README template.cpp Makefile.pkg
- DESTINATION ${DATA_INSTALL_DIR}/template
+ DESTINATION ${GMX_INSTALL_GMXDATADIR}/template
COMPONENT development)
install(FILES cmake/FindGROMACS.cmake
- DESTINATION ${DATA_INSTALL_DIR}/template/cmake
+ DESTINATION ${GMX_INSTALL_GMXDATADIR}/template/cmake
COMPONENT development)
/** Binary directory for the build */
#define CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@"
-/** Location of data files in the installation directory */
-#define DATA_INSTALL_DIR "@DATA_INSTALL_DIR@"
+/** Location of GROMACS-specific data files */
+#define GMX_INSTALL_GMXDATADIR "@GMX_INSTALL_GMXDATADIR@"
/** CUDA compiler version information */
#define CUDA_COMPILER_INFO "@CUDA_COMPILER_INFO@"
#cmakedefine01 HAVE_NVML
/* Define relative path to OpenCL kernels */
-#define OCL_INSTALL_DIR "@OCL_INSTALL_DIR@"
+#define GMX_INSTALL_OCLDIR "@GMX_INSTALL_OCLDIR@"
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#cmakedefine01 HAVE_FSEEKO
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
endif()
# Machinery for running the external project
-set(EXTERNAL_FFTW_VERSION 3.3.7)
+set(EXTERNAL_FFTW_VERSION 3.3.8)
# cmake make eats slashes //// -> //
set(GMX_BUILD_OWN_FFTW_URL
"http:////www.fftw.org/fftw-${EXTERNAL_FFTW_VERSION}.tar.gz" CACHE PATH
"URL from where to download fftw (use an absolute path when offline, adjust GMX_BUILD_OWN_FFTW_MD5 if downloading other version than ${EXTERNAL_FFTW_VERSION})")
-set(GMX_BUILD_OWN_FFTW_MD5 0d5915d7d39b3253c1cc05030d79ac47 CACHE STRING
+set(GMX_BUILD_OWN_FFTW_MD5 8aac833c943d8e90d51b697b27d4384d CACHE STRING
"Expected MD5 hash for the file at GMX_BUILD_OWN_FFTW_URL")
mark_as_advanced(GMX_BUILD_OWN_FFTW_URL GMX_BUILD_OWN_FFTW_MD5)
if (NOT GMX_BUILD_MDRUN_ONLY)
file(RELATIVE_PATH _dest ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_LIST_DIR})
install(FILES ${ARGN}
- DESTINATION "${INCL_INSTALL_DIR}/${_dest}"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_dest}"
COMPONENT development)
endif()
_gmx_add_files_to_property(GMX_INSTALLED_HEADERS ${ARGN})
endif()
set_source_files_properties(selection/scanner.cpp PROPERTIES COMPILE_FLAGS "${_scanner_cpp_compiler_flags}")
-if(SIMD_AVX_512_CXX_SUPPORTED)
- # Since we might be overriding -march=core-avx2, add a flag so we don't warn for this specific file
+if(SIMD_AVX_512_CXX_SUPPORTED AND NOT ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512_KNL"))
+ # Since we might be overriding -march=core-avx2, add a flag so we don't warn for this specific file.
+ # On KNL this can cause illegal instruction because the compiler might use non KNL AVX instructions
+ # with the SIMD_AVX_512_CXX_FLAGS flags.
set_source_files_properties(hardware/identifyavx512fmaunits.cpp PROPERTIES COMPILE_FLAGS "${SIMD_AVX_512_CXX_FLAGS} ${CXX_NO_UNUSED_OPTION_WARNING_FLAGS}")
endif()
if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
install(TARGETS libgromacs
EXPORT libgromacs
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- RUNTIME DESTINATION ${BIN_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT libraries)
endif()
#install also name-links (linker uses those)
file(GLOB CUDA_LIBS ${CUDA_LIB}*)
install(FILES ${CUDA_LIBS} DESTINATION
- ${LIB_INSTALL_DIR} COMPONENT libraries)
+ ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()
endforeach()
else()
set(OPENCL_KERNELS ${MDLIB_OPENCL_KERNELS})
install(FILES ${OPENCL_KERNELS} DESTINATION
- ${OCL_INSTALL_DIR} COMPONENT libraries)
+ ${GMX_INSTALL_OCLDIR} COMPONENT libraries)
endif()
if (BUILD_TESTING)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014,2016, by the GROMACS development team, led by
+# Copyright (c) 2014,2016,2018, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
configure_file(libgromacs.pc.cmakein
libgromacs.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgromacs.pc
- DESTINATION ${PKGCONFIG_INSTALL_DIR}
+ DESTINATION ${GMX_INSTALL_PKGCONFIGDIR}
RENAME "libgromacs${GMX_LIBS_SUFFIX}.pc"
COMPONENT development)
endfunction()
# Install everything into a subdirectory, because
# 1. CMake expects things to be there for CMAKE_PREFIX_PATH to work, and
# 2. This nicely isolates files for different suffixes from each other.
- set(CMAKE_PACKAGE_DIR ${CMAKE_INSTALL_DIR}/gromacs${GMX_LIBS_SUFFIX})
+ set(GMX_INSTALL_CMAKEPKGDIR ${GMX_INSTALL_CMAKEDIR}/gromacs${GMX_LIBS_SUFFIX})
# Install import definitions that take care of the library locations and
# library dependencies.
endif()
install(EXPORT libgromacs
FILE ${EXPORT_FILE_NAME}
- DESTINATION ${CMAKE_PACKAGE_DIR}
+ DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
COMPONENT libraries)
get_filename_component(GROMACS_CXX_COMPILER ${CMAKE_CXX_COMPILER} REALPATH)
# find_package(GROMACS NAMES gromacs_d) to find them, without also
# specifying CONFIGS.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gromacs-config.cmake
- DESTINATION ${CMAKE_PACKAGE_DIR}
+ DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
RENAME "gromacs${GMX_LIBS_SUFFIX}-config.cmake"
COMPONENT development)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gromacs-config-version.cmake
- DESTINATION ${CMAKE_PACKAGE_DIR}
+ DESTINATION ${GMX_INSTALL_CMAKEPKGDIR}
RENAME "gromacs${GMX_LIBS_SUFFIX}-config-version.cmake"
COMPONENT development)
endfunction()
const int maxNumWarningsInRun = 10; /* The maximum number of warnings to print in a run */
if (fplog == nullptr || numWarningsIssued_ >= maxNumWarningsInRun || state_.inInitialStage() ||
- !params_.isCheckStep(state_.points().size(), step))
+ !params_.isCheckHistogramForAnomaliesStep(step))
{
return;
}
return biasForce_;
}
+/*! \brief
+ * Count the total number of samples / sample weight over all grid points.
+ *
+ * \param[in] pointState The state of the points in a bias.
+ * \returns the total sample count.
+ */
+static gmx_int64_t countSamples(const std::vector<PointState> &pointState)
+{
+ double numSamples = 0;
+ for (const PointState &point : pointState)
+ {
+ numSamples += point.weightSumTot();
+ }
+
+ return static_cast<gmx_int64_t>(numSamples + 0.5);
+}
+
+/*! \brief
+ * Check if the state (loaded from checkpoint) and the run are consistent.
+ *
+ * When the state and the run setup are inconsistent, an exception is thrown.
+ *
+ * \param[in] params The parameters of the bias.
+ * \param[in] state The state of the bias.
+ */
+static void ensureStateAndRunConsistency(const BiasParams ¶ms,
+ const BiasState &state)
+{
+ gmx_int64_t numSamples = countSamples(state.points());
+ gmx_int64_t numUpdatesFromSamples = numSamples/(params.numSamplesUpdateFreeEnergy_*params.numSharedUpdate);
+ gmx_int64_t numUpdatesExpected = state.histogramSize().numUpdates();
+ if (numUpdatesFromSamples != numUpdatesExpected)
+ {
+ std::string mesg = gmx::formatString("The number of AWH updates in the checkpoint file (%ld) does not match the total number of AWH samples divided by the number of samples per update for %ld sharing AWH bias(es) (%ld/%ld=%ld)",
+ numUpdatesExpected,
+ params.numSharedUpdate,
+ numSamples,
+ params.numSamplesUpdateFreeEnergy_*params.numSharedUpdate,
+ numUpdatesFromSamples);
+ mesg += " Maybe you changed AWH parameters.";
+ /* Unfortunately we currently do not store the number of simulations
+ * sharing the bias or the state to checkpoint. But we can hint at
+ * a mismatch in the number of sharing simulations.
+ */
+ if (numUpdatesFromSamples % state.histogramSize().numUpdates() == 0)
+ {
+ mesg += gmx::formatString(" Or the run you continued from used %ld sharing simulations, whereas you now specified %d sharing simulations.",
+ numUpdatesFromSamples/state.histogramSize().numUpdates(),
+ params.numSharedUpdate);
+ }
+ GMX_THROW(InvalidInputError(mesg));
+ }
+}
+
void Bias::restoreStateFromHistory(const AwhBiasHistory *biasHistory,
const t_commrec *cr)
{
GMX_RELEASE_ASSERT(biasHistory != nullptr, "On the master rank we need a valid history object to restore from");
state_.restoreFromHistory(*biasHistory, grid_);
+ /* Ensure that the state is consistent with our current run setup,
+ * since the user can have changed AWH parameters or the number
+ * of simulations sharing the bias.
+ */
+ ensureStateAndRunConsistency(params_, state_);
+
if (forceCorrelationGrid_ != nullptr)
{
forceCorrelationGrid_->restoreStateFromHistory(biasHistory->forceCorrelationGrid);
namespace gmx
{
-bool BiasParams::isCheckStep(std::size_t numPointsInHistogram,
- gmx_int64_t step) const
-{
- int numStepsUpdateFreeEnergy = numSamplesUpdateFreeEnergy_*numStepsSampleCoord_;
- int numStepsCheck = (1 + numPointsInHistogram/numSamplesUpdateFreeEnergy_)*numStepsUpdateFreeEnergy;
-
- if (step > 0 && step % numStepsCheck == 0)
- {
- GMX_ASSERT(isUpdateFreeEnergyStep(step), "We should only check at free-energy update steps");
-
- return true;
- }
- else
- {
- return false;
- }
-}
-
namespace
{
return numStepsUpdateTarget;
}
+/*! \brief Determines the step interval for checking for covering.
+ *
+ * \param[in] awhParams AWH parameters.
+ * \param[in] dimParams Parameters for the dimensions of the coordinate.
+ * \param[in] gridAxis The Grid axes.
+ * \returns the check interval in steps.
+ */
+gmx_int64_t calcCheckCoveringInterval(const AwhParams &awhParams,
+ const std::vector<DimParams> &dimParams,
+ const std::vector<GridAxis> &gridAxis)
+{
+ /* Each sample will have a width of sigma. To cover the axis a
+ minimum number of samples of width sigma is required. */
+ int minNumSamplesCover = 0;
+ for (size_t d = 0; d < gridAxis.size(); d++)
+ {
+ GMX_RELEASE_ASSERT(dimParams[d].betak > 0, "Inverse temperature (beta) and force constant (k) should be positive.");
+ double sigma = 1.0/std::sqrt(dimParams[d].betak);
+
+ /* The additional sample is here because to cover a discretized
+ axis of length sigma one needs two samples, one for each
+ end point. */
+ GMX_RELEASE_ASSERT(gridAxis[d].length()/sigma < std::numeric_limits<int>::max(), "The axis length in units of sigma should fit in an int");
+ int numSamplesCover = static_cast<int>(std::ceil(gridAxis[d].length()/sigma)) + 1;
+
+ /* The minimum number of samples needed for simultaneously
+ covering all axes is limited by the axis requiring most
+ samples. */
+ minNumSamplesCover = std::max(minNumSamplesCover, numSamplesCover);
+ }
+
+ /* Convert to number of steps using the sampling frequency. The
+ check interval should be a multiple of the update step
+ interval. */
+ int numStepsUpdate = awhParams.numSamplesUpdateFreeEnergy*awhParams.nstSampleCoord;
+ GMX_RELEASE_ASSERT(awhParams.numSamplesUpdateFreeEnergy > 0, "When checking for AWH coverings, the number of samples per AWH update need to be > 0.");
+ int numUpdatesCheck = std::max(1, minNumSamplesCover/awhParams.numSamplesUpdateFreeEnergy);
+ int numStepsCheck = numUpdatesCheck*numStepsUpdate;
+
+ GMX_RELEASE_ASSERT(numStepsCheck % numStepsUpdate == 0, "Only check covering at free energy update steps");
+
+ return numStepsCheck;
+}
+
/*! \brief
* Returns an approximation of the geometry factor used for initializing the AWH update size.
*
numStepsSampleCoord_(awhParams.nstSampleCoord),
numSamplesUpdateFreeEnergy_(awhParams.numSamplesUpdateFreeEnergy),
numStepsUpdateTarget_(calcTargetUpdateInterval(awhParams, awhBiasParams)),
+ numStepsCheckCovering_(calcCheckCoveringInterval(awhParams, dimParams, gridAxis)),
eTarget(awhBiasParams.eTarget),
freeEnergyCutoffInKT(beta*awhBiasParams.targetCutoff),
temperatureScaleFactor(awhBiasParams.targetBetaScaling),
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
/*! \brief
- * Returns if to do checks, only returns true at free-energy update steps.
+ * Returns if to do checks for covering in the initial stage.
*
- * To avoid overhead due to expensive checks, we only do checks when we
- * have taken at least as many samples as we have points.
+ * To avoid overhead due to expensive checks, we do not check
+ * at every free energy update. However, if checks are
+ * performed too rarely the detection of coverings will be
+ * delayed, ultimately affecting free energy convergence.
*
- * \param[in] numPointsInHistogram The total number of points in the bias histogram.
* \param[in] step Time step.
* \returns true at steps where checks should be performed.
+ * \note Only returns true at free energy update steps.
*/
- bool isCheckStep(std::size_t numPointsInHistogram,
- gmx_int64_t step) const;
+ bool isCheckCoveringStep(gmx_int64_t step) const
+ {
+ return step % numStepsCheckCovering_ == 0;
+ }
+
+ /*! \brief
+ * Returns if to perform checks for anomalies in the histogram.
+ *
+ * To avoid overhead due to expensive checks, we do not check
+ * at every free energy update. These checks are only used for
+ * warning the user and can be made as infrequently as
+ * neccessary without affecting the algorithm itself.
+ *
+ * \param[in] step Time step.
+ * \returns true at steps where checks should be performed.
+ * \note Only returns true at free energy update steps.
+ * \todo Currently this function just calls isCheckCoveringStep but the checks could be done less frequently.
+ */
+ bool isCheckHistogramForAnomaliesStep(gmx_int64_t step) const
+ {
+ return isCheckCoveringStep(step);
+ }
/*! \brief Constructor.
*
const double invBeta; /**< 1/beta = kT in kJ/mol */
private:
const gmx_int64_t numStepsSampleCoord_; /**< Number of steps per coordinate value sample. */
+ public:
const int numSamplesUpdateFreeEnergy_; /**< Number of samples per free energy update. */
+ private:
const gmx_int64_t numStepsUpdateTarget_; /**< Number of steps per updating the target distribution. */
+ const gmx_int64_t numStepsCheckCovering_; /**< Number of steps per checking for covering. */
public:
const int eTarget; /**< Type of target distribution. */
const double freeEnergyCutoffInKT; /**< Free energy cut-off in kT for cut-off target distribution. */
bool detectedCovering = false;
if (inInitialStage())
{
- detectedCovering = (params.isCheckStep(points_.size(), step) &&
+ detectedCovering = (params.isCheckCoveringStep(step) &&
isSamplingRegionCovered(params, dimParams, grid,
commRecord, multiSimComm));
}
if (targetDistributionIsZero)
{
std::string mesg = gmx::formatString("The target weights given in column %d in %s are all 0",
- filename.c_str(), columnIndexTarget);
+ columnIndexTarget, filename.c_str());
GMX_THROW(InvalidInputError(mesg));
}
}
else
{
- double lengthInPoints = length_*pointDensity;
-
- numPoints_ = 1 + static_cast<int>(std::ceil(lengthInPoints));
+ /* An extra point is added here to account for the endpoints. The
+ minimum number of points for a non-zero interval is 2. */
+ numPoints_ = 1 + static_cast<int>(std::ceil(length_*pointDensity));
}
/* Set point spacing based on the number of points */
printStringNoNewline(inp, "Free energy and bias update interval in number of samples");
sprintf(opt, "%s-nsamples-update", prefix);
awhParams->numSamplesUpdateFreeEnergy = get_eint(inp, opt, 10, wi);
+ if (awhParams->numSamplesUpdateFreeEnergy <= 0)
+ {
+ char buf[STRLEN];
+ sprintf(buf, "%s needs to be an integer > 0", opt);
+ warning_error(wi, buf);
+ }
printStringNoNewline(inp, "When true, biases with share-group>0 are shared between multiple simulations");
sprintf(opt, "%s-share-multisim", prefix);
*/
bool isAcceptableLibraryPathPrefix(const std::string &path)
{
- std::string testPath = Path::join(path, DATA_INSTALL_DIR, "top");
+ std::string testPath = Path::join(path, GMX_INSTALL_GMXDATADIR, "top");
return isAcceptableLibraryPath(testPath);
}
case efENT:
case efPQR:
out = gmx_fio_fopen(outfile, "w");
- write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE);
+ write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE, TRUE);
gmx_fio_fclose(out);
break;
case efESP:
}
}
+static int
+gmx_fprintf_pqr_atomline(FILE * fp,
+ enum PDB_record record,
+ int atom_seq_number,
+ const char * atom_name,
+ const char * res_name,
+ char chain_id,
+ int res_seq_number,
+ real x,
+ real y,
+ real z,
+ real occupancy,
+ real b_factor)
+{
+ GMX_RELEASE_ASSERT(record == epdbATOM || record == epdbHETATM,
+ "Can only print PQR atom lines as ATOM or HETATM records");
+
+ /* Check atom name */
+ GMX_RELEASE_ASSERT(atom_name != nullptr,
+ "Need atom information to print pqr");
+
+ /* Check residue name */
+ GMX_RELEASE_ASSERT(res_name != nullptr,
+ "Need residue information to print pqr");
+
+ /* Truncate integers so they fit */
+ atom_seq_number = atom_seq_number % 100000;
+ res_seq_number = res_seq_number % 10000;
+
+ int n = fprintf(fp,
+ "%s %d %s %s %c %d %8.3f %8.3f %8.3f %6.2f %6.2f\n",
+ pdbtp[record],
+ atom_seq_number,
+ atom_name,
+ res_name,
+ chain_id,
+ res_seq_number,
+ x, y, z,
+ occupancy,
+ b_factor);
+
+ return n;
+}
+
void write_pdbfile_indexed(FILE *out, const char *title,
const t_atoms *atoms, const rvec x[],
int ePBC, const matrix box, char chainid,
int model_nr, int nindex, const int index[],
- gmx_conect conect, gmx_bool bTerSepChains)
+ gmx_conect conect, gmx_bool bTerSepChains,
+ bool usePqrFormat)
{
gmx_conect_t *gc = (gmx_conect_t *)conect;
char resnm[6], nm[6];
}
occup = bOccup ? 1.0 : pdbinfo.occup;
bfac = pdbinfo.bfac;
-
- gmx_fprintf_pdb_atomline(out,
- type,
- i+1,
- nm,
- altloc,
- resnm,
- ch,
- resnr,
- resic,
- 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ],
- occup,
- bfac,
- atoms->atom[i].elem);
-
- if (atoms->pdbinfo && atoms->pdbinfo[i].bAnisotropic)
+ if (!usePqrFormat)
+ {
+ gmx_fprintf_pdb_atomline(out,
+ type,
+ i+1,
+ nm,
+ altloc,
+ resnm,
+ ch,
+ resnr,
+ resic,
+ 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ],
+ occup,
+ bfac,
+ atoms->atom[i].elem);
+
+ if (atoms->pdbinfo && atoms->pdbinfo[i].bAnisotropic)
+ {
+ fprintf(out, "ANISOU%5d %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
+ (i+1)%100000, nm, resnm, ch, resnr,
+ (resic == '\0') ? ' ' : resic,
+ atoms->pdbinfo[i].uij[0], atoms->pdbinfo[i].uij[1],
+ atoms->pdbinfo[i].uij[2], atoms->pdbinfo[i].uij[3],
+ atoms->pdbinfo[i].uij[4], atoms->pdbinfo[i].uij[5]);
+ }
+ }
+ else
{
- fprintf(out, "ANISOU%5d %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
- (i+1)%100000, nm, resnm, ch, resnr,
- (resic == '\0') ? ' ' : resic,
- atoms->pdbinfo[i].uij[0], atoms->pdbinfo[i].uij[1],
- atoms->pdbinfo[i].uij[2], atoms->pdbinfo[i].uij[3],
- atoms->pdbinfo[i].uij[4], atoms->pdbinfo[i].uij[5]);
+ gmx_fprintf_pqr_atomline(out,
+ type,
+ i+1,
+ nm,
+ resnm,
+ ch,
+ resnr,
+ 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ],
+ occup,
+ bfac);
}
}
index[i] = i;
}
write_pdbfile_indexed(out, title, atoms, x, ePBC, box, chainid, model_nr,
- atoms->nr, index, conect, bTerSepChains);
+ atoms->nr, index, conect, bTerSepChains, false);
sfree(index);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void write_pdbfile_indexed(FILE *out, const char *title, const t_atoms *atoms,
const rvec x[], int ePBC, const matrix box, char chain,
int model_nr, int nindex, const int index[],
- gmx_conect conect, gmx_bool bTerSepChains);
+ gmx_conect conect, gmx_bool bTerSepChains,
+ bool usePqrFormat);
/* REALLY low level */
void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms,
else
{
write_pdbfile_indexed(gmx_fio_getfp(status->fio), title, fr->atoms,
- fr->x, -1, fr->box, ' ', fr->step, nind, ind, gc, TRUE);
+ fr->x, -1, fr->box, ' ', fr->step, nind, ind, gc, TRUE, FALSE);
}
break;
case efG96:
}
gmx_rmpbc(gpbc, natoms, box, x);
tapein = gmx_ffopen(pdbfile, "w");
- write_pdbfile_indexed(tapein, nullptr, atoms, x, ePBC, box, ' ', -1, gnx, index, nullptr, TRUE);
+ write_pdbfile_indexed(tapein, nullptr, atoms, x, ePBC, box, ' ', -1, gnx, index, nullptr, TRUE, FALSE);
gmx_ffclose(tapein);
if (0 != system(dssp))
if (outftp == efPDB)
{
out = gmx_ffopen(outfile, "w");
- write_pdbfile_indexed(out, *top_tmp->name, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, TRUE);
+ write_pdbfile_indexed(out, *top_tmp->name, &atoms, x, ePBC, box, ' ', 1, isize, index, conect, TRUE, FALSE);
gmx_ffclose(out);
}
else
atoms.resinfo[atoms.atom[i].resind].chainid = label[0];
}
}
- write_pdbfile(out, *top_tmp->name, &atoms, x, ePBC, box, ' ', -1, conect, TRUE);
+ /* Need to bypass the regular write_pdbfile because I don't want to change
+ * all instances to include the boolean flag for writing out PQR files.
+ */
+ int *index;
+ snew(index, atoms.nr);
+ for (int i = 0; i < atoms.nr; i++)
+ {
+ index[i] = i;
+ }
+ write_pdbfile_indexed(out, *top_tmp->name, &atoms, x, ePBC, box, ' ', -1, atoms.nr, index, conect,
+ TRUE, outftp == efPQR);
+ sfree(index);
if (bLegend)
{
pdb_legend(out, atoms.nr, atoms.nres, &atoms, x);
gmx_bool bCont, bRef;
gmx_bool bCutmax, bCutmin;
real **eneset, *time = nullptr;
- int *set, i, j, k, prevk, m = 0, n, nre, nset, nenergy;
+ int *set, i, j, prevk, k, m = 0, n, nre, nset, nenergy;
char **groups = nullptr;
char groupname[255], fn[255];
int ngroups;
prevk = 0;
for (i = 0; (i < ngroups); i++)
{
- fprintf(stderr, "\rgroup %d", i);
- fflush(stderr);
for (j = i; (j < ngroups); j++)
{
for (m = 0; (m < egNR); m++)
if (egrp_use[m])
{
sprintf(groupname, "%s:%s-%s", egrp_nm[m], groups[i], groups[j]);
-#ifdef DEBUG
- fprintf(stderr, "\r%-15s %5d", groupname, n);
- fflush(stderr);
-#endif
+ bool foundMatch = false;
for (k = prevk; (k < prevk+nre); k++)
{
- if (std::strcmp(enm[k%nre].name, groupname) == 0)
+ if (std::strcmp(enm[k % nre].name, groupname) == 0)
{
- set[n++] = k;
+ set[n++] = k;
+ foundMatch = true;
break;
}
}
- if (k == prevk+nre)
+ if (!foundMatch)
{
- fprintf(stderr, "WARNING! could not find group %s (%d,%d)"
+ fprintf(stderr, "WARNING! could not find group %s (%d,%d) "
"in energy file\n", groupname, i, j);
}
else
}
}
fprintf(stderr, "\n");
+ if (n == 0)
+ {
+ // Return an error, can't do what the user asked for
+ fprintf(stderr,
+ "None of the specified energy groups were found in this .edr file.\n"
+ "Perhaps you used the wrong groups, the wrong files, or didn't use a .tpr\n"
+ "that was made from an .mdp file that specified these energy groups.\n");
+ return 1;
+ }
nset = n;
snew(eneset, nset+1);
fprintf(stderr, "Will select half-matrix of energies with %d elements\n", n);
"With option [TT]-pi[tt] the minimum distance of a group to its",
"periodic image is plotted. This is useful for checking if a protein",
"has seen its periodic image during a simulation. Only one shift in",
- "each direction is considered, giving a total of 26 shifts.",
+ "each direction is considered, giving a total of 26 shifts. Note",
+ "that periodicity information is required from the file supplied with",
+ "with [TT]-s[tt], either as a .tpr file or a .pdb file with CRYST1 fields.",
"It also plots the maximum distance within the group and the lengths",
"of the three box vectors.[PAR]",
"Also [gmx-distance] and [gmx-pairdist] calculate distances."
}
/* put them back into the original arrays and throw away temporary arrays */
- sfree(atoms->atomname);
- sfree(atoms->resinfo);
- sfree(atoms->atom);
- sfree(atoms);
+ done_atom(atoms);
*atoms_solvt = newatoms;
std::swap(*x, newx);
std::swap(*v, newv);
snew(top_solvt, 1);
readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : nullptr,
&ePBC_solvt, box_solvt, "solvent");
+ if (gmx::boxIsZero(box_solvt))
+ {
+ gmx_fatal(FARGS, "No box information for solvent in %s, please use a properly formatted file\n",
+ filename);
+ }
t_atoms *atoms_solvt = &top_solvt->atoms;
if (0 == atoms_solvt->nr)
{
* something wrong with the machine: driver-runtime
* mismatch, all GPUs being busy in exclusive mode,
* invalid CUDA_VISIBLE_DEVICES, or some other condition
- * which should result in GROMACS issuing a warning a
- * falling back to CPUs. */
+ * which should result in GROMACS issuing at least a
+ * warning. */
errorMessage->assign(cudaGetErrorString(stat));
}
* Returns true when this is a build of \Gromacs configured to support
* GPU usage, and a valid device driver, ICD, and/or runtime was detected.
*
- * \param[out] errorMessage When returning false and non-nullptr was passed,
+ * This function is not intended to be called from build
+ * configurations that do not support GPUs, and there will be no
+ * descriptive message in that case.
+ *
+ * \param[out] errorMessage When returning false on a build configured with
+ * GPU support and non-nullptr was passed,
* the string contains a descriptive message about
* why GPUs cannot be detected.
*
InstallationPrefixInfo info = getProgramContext().installationPrefix();
std::string dataPathSuffix = (info.bSourceLayout ?
sourceRelativePath :
- OCL_INSTALL_DIR);
+ GMX_INSTALL_OCLDIR);
sourceRootPath = Path::join(info.path, dataPathSuffix);
}
else
if (!gpusCanBeDetected)
{
GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
- "NOTE: GPUs cannot be detected:\n"
- " %s\n"
- " Can not use GPU acceleration, will fall back to CPU kernels.",
+ "NOTE: Detection of GPUs failed. The API reported:\n"
+ " %s\n",
+ " GROMACS cannot run tasks on a GPU.",
errorMessage.c_str());
}
}
-libdir=@CMAKE_INSTALL_PREFIX@/@LIB_INSTALL_DIR@
+libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
Name: libgromacs@GMX_LIBS_SUFFIX@
Description: Gromacs library
}
wallcycle_stop(wcycle, ewcCONSTR);
+ if (v != nullptr && md.cFREEZE)
+ {
+ /* Set the velocities of frozen dimensions to zero */
+
+ // cppcheck-suppress unreadVariable
+ int gmx_unused numThreads = gmx_omp_nthreads_get(emntUpdate);
+
+#pragma omp parallel for num_threads(numThreads) schedule(static)
+ for (int i = 0; i < md.homenr; i++)
+ {
+ int freezeGroup = md.cFREEZE[i];
+
+ for (int d = 0; d < DIM; d++)
+ {
+ if (ir.opts.nFreeze[freezeGroup][d])
+ {
+ v[i][d] = 0;
+ }
+ }
+ }
+ }
+
return bOK;
}
gmx_omp_nthreads_set(m, nth);
}
-void gmx_omp_nthreads_read_env(int *nthreads_omp,
- gmx_bool bIsSimMaster)
+void gmx_omp_nthreads_read_env(const gmx::MDLogger &mdlog,
+ int *nthreads_omp)
{
char *env;
gmx_bool bCommandLineSetNthreadsOMP = *nthreads_omp > 0;
/* Output the results */
sprintf(buffer,
- "The number of OpenMP threads was set by environment variable OMP_NUM_THREADS to %d%s\n",
+ "\nThe number of OpenMP threads was set by environment variable OMP_NUM_THREADS to %d%s\n\n",
nt_omp,
bCommandLineSetNthreadsOMP ? " (and the command-line setting agreed with that)" : "");
- if (bIsSimMaster)
- {
- /* This prints once per simulation for multi-simulations,
- * which might help diagnose issues with inhomogenous
- * cluster setups. */
- fputs(buffer, stderr);
- }
+
+ /* This prints once per simulation for multi-simulations,
+ * which might help diagnose issues with inhomogenous
+ * cluster setups. */
+ GMX_LOG(mdlog.info).appendTextFormatted(buffer);
if (debug)
{
/* This prints once per process for real MPI (i.e. once
/*! \brief
* Read the OMP_NUM_THREADS env. var. and check against the value set on the
* command line. */
-void gmx_omp_nthreads_read_env(int *nthreads_omp,
- gmx_bool bIsSimMaster);
+void gmx_omp_nthreads_read_env(const gmx::MDLogger &mdlog,
+ int *nthreads_omp);
#endif
{
xPtr = as_rvec_array(state->x.data());
}
- do_stopcm_grp(mdatoms->homenr, mdatoms->cVCM,
+ do_stopcm_grp(*mdatoms,
xPtr, as_rvec_array(state->v.data()), *vcm);
inc_nrnb(nrnb, eNR_STOPCM, mdatoms->homenr);
}
t->nb_k[iloc].closeTimingRegion(stream);
}
-#if (defined(WIN32) || defined( _WIN32 ))
- /* Windows: force flushing WDDM queue */
- stat = cudaStreamQuery(stream);
-#endif
+ if (GMX_NATIVE_WINDOWS)
+ {
+ /* Windows: force flushing WDDM queue */
+ cudaStreamQuery(stream);
+ }
}
/*! Calculates the amount of shared memory required by the CUDA kernel in use. */
timer->closeTimingRegion(stream);
}
-#if (defined(WIN32) || defined( _WIN32 ))
- /* Windows: force flushing WDDM queue */
- stat = cudaStreamQuery(stream);
-#endif
+ if (GMX_NATIVE_WINDOWS)
+ {
+ /* Windows: force flushing WDDM queue */
+ cudaStreamQuery(stream);
+ }
}
void nbnxn_gpu_launch_cpyback(gmx_nbnxn_cuda_t *nb,
snew(vcm->thread_vcm, gmx_omp_nthreads_get(emntDefault) * vcm->stride);
}
+ vcm->nFreeze = ir->opts.nFreeze;
+
return vcm;
}
* \note This routine should be called from within an OpenMP parallel region.
*
* \tparam numDimensions Correct dimensions 0 to \p numDimensions-1
- * \param[in] homenr The number of atoms to correct
- * \param[in] group_id List of VCM group ids, when nullptr is passed all atoms are assumed to be in group 0
+ * \param[in] mdatoms The atom property and group information
* \param[in,out] v The velocities to correct
* \param[in] vcm VCM data
*/
template<int numDimensions>
static void
-doStopComMotionLinear(int homenr,
- const unsigned short *group_id,
+doStopComMotionLinear(const t_mdatoms &mdatoms,
rvec *v,
const t_vcm &vcm)
{
- if (group_id == nullptr)
+ const int homenr = mdatoms.homenr;
+ const unsigned short *group_id = mdatoms.cVCM;
+
+ if (mdatoms.cFREEZE != nullptr)
+ {
+ GMX_RELEASE_ASSERT(vcm.nFreeze != nullptr, "Need freeze dimension info with freeze groups");
+
+#pragma omp for schedule(static)
+ for (int i = 0; i < homenr; i++)
+ {
+ unsigned short vcmGroup = (group_id == nullptr ? 0 : group_id[i]);
+ unsigned short freezeGroup = mdatoms.cFREEZE[i];
+ for (int d = 0; d < numDimensions; d++)
+ {
+ if (vcm.nFreeze[freezeGroup][d] == 0)
+ {
+ v[i][d] -= vcm.group_v[vcmGroup][d];
+ }
+ }
+ }
+ }
+ else if (group_id == nullptr)
{
#pragma omp for schedule(static)
for (int i = 0; i < homenr; i++)
}
}
-void do_stopcm_grp(int homenr, const unsigned short *group_id,
+void do_stopcm_grp(const t_mdatoms &mdatoms,
rvec x[], rvec v[], const t_vcm &vcm)
{
if (vcm.mode != ecmNO)
{
+ const int homenr = mdatoms.homenr;
+ const unsigned short *group_id = mdatoms.cVCM;
+
// cppcheck-suppress unreadVariable
int gmx_unused nth = gmx_omp_nthreads_get(emntDefault);
#pragma omp parallel num_threads(nth)
switch (vcm.ndim)
{
case 1:
- doStopComMotionLinear<1>(homenr, group_id, v, vcm);
+ doStopComMotionLinear<1>(mdatoms, v, vcm);
break;
case 2:
- doStopComMotionLinear<2>(homenr, group_id, v, vcm);
+ doStopComMotionLinear<2>(mdatoms, v, vcm);
break;
case 3:
- doStopComMotionLinear<3>(homenr, group_id, v, vcm);
+ doStopComMotionLinear<3>(mdatoms, v, vcm);
break;
}
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
struct gmx_groups_t;
struct t_inputrec;
+struct t_mdatoms;
typedef struct {
rvec p; /* Linear momentum */
tensor *group_i; /* Moment of inertia per group */
real *group_mass; /* Mass per group */
char **group_name; /* These two are copies to pointers in */
+ ivec *nFreeze; /* Tells whether dimensions are frozen per freeze group */
t_vcm_thread *thread_vcm; /* Temporary data per thread and group */
} t_vcm;
*
* With linear modes nullptr can be passed for x.
*/
-void do_stopcm_grp(int homenr,
- const unsigned short *group_id,
+void do_stopcm_grp(const t_mdatoms &mdatoms,
rvec x[], rvec v[], const t_vcm &vcm);
void check_cm_grp(FILE *fp, t_vcm *vcm, t_inputrec *ir, real Temp_Max);
s2->lambda[efptBONDED], &dvdl_constr,
nullptr, nullptr, gmx::ConstraintVariable::Positions);
+ if (cr->nnodes > 1)
+ {
+ /* This global reduction will affect performance at high
+ * parallelization, but we can not really avoid it.
+ * But usually EM is not run at high parallelization.
+ */
+ int reductionBuffer = !validStep;
+ gmx_sumi(1, &reductionBuffer, cr);
+ validStep = (reductionBuffer == 0);
+ }
+
// We should move this check to the different minimizers
if (!validStep && ir->eI != eiSteep)
{
}
/* Check and update the hardware options for internal consistency */
- check_and_update_hw_opt_1(&hw_opt, cr, domdecOptions.numPmeRanks);
+ check_and_update_hw_opt_1(mdlog, &hw_opt, cr, domdecOptions.numPmeRanks);
/* Early check for externally set process affinity. */
gmx_check_thread_affinity_set(mdlog, cr,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
&& boxElementEqual(box1[ZZ][ZZ], box2[ZZ][ZZ]);
}
+bool boxIsZero(const matrix box)
+{
+ return boxElementEqual(box[XX][XX], 0.0)
+ && boxElementEqual(box[YY][XX], 0.0)
+ && boxElementEqual(box[YY][YY], 0.0)
+ && boxElementEqual(box[ZZ][XX], 0.0)
+ && boxElementEqual(box[ZZ][YY], 0.0)
+ && boxElementEqual(box[ZZ][ZZ], 0.0);
+}
+
} // namespace gmx
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
bool boxesAreEqual(const matrix box1, const matrix box2);
+/*! \brief
+ * Returns whether a box is only initialised to zero or not.
+ */
+bool boxIsZero(const matrix box);
+
} // namespace gmx
#endif
#include "gromacs/topology/ifunc.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
/************************************************************
*
}
}
-static void mk_igraph(t_graph *g, int ftype, const t_ilist *il,
+/* Make the actual graph for an ilist, returns whether an edge was added.
+ *
+ * When a non-null part array is supplied with part indices for each atom,
+ * edges are only added when atoms have a different part index.
+ */
+static bool mk_igraph(t_graph *g, int ftype, const t_ilist *il,
int at_start, int at_end,
const int *part)
{
t_iatom *ia;
int i, j, np;
int end;
+ bool addedEdge = false;
end = il->nr;
ia = il->iatoms;
{
np = interaction_function[ftype].nratoms;
- if (ia[1] >= at_start && ia[1] < at_end)
+ if (np > 1 && ia[1] >= at_start && ia[1] < at_end)
{
if (ia[np] >= at_end)
{
/* Bond all the atoms in the settle */
add_gbond(g, ia[1], ia[2]);
add_gbond(g, ia[1], ia[3]);
+ addedEdge = true;
}
else if (part == nullptr)
{
{
add_gbond(g, ia[j], ia[j+1]);
}
+ addedEdge = true;
}
else
{
if (part[ia[j]] != part[ia[j+1]])
{
add_gbond(g, ia[j], ia[j+1]);
+ addedEdge = true;
}
}
}
ia += np+1;
i += np+1;
}
+
+ return addedEdge;
}
gmx_noreturn static void g_error(int line, const char *file)
* some atoms are not connected by the graph, which runs from
* g->at_start (>= g->at0) to g->at_end (<= g->at1).
*/
- g->at0 = at_start;
- g->at1 = at_end;
+ g->at0 = at_start;
+ g->at1 = at_end;
+ g->parts = t_graph::BondedParts::Single;
snew(nbond, at_end);
nbtot = calc_start_end(fplog, g, ilist, at_start, at_end, nbond);
* but only when they connect parts of the graph
* that are not connected through IF_CHEMBOND interactions.
*/
+ bool addedEdge = false;
for (i = 0; (i < F_NRE); i++)
{
if (!(interaction_function[i].flags & IF_CHEMBOND))
{
- mk_igraph(g, i, &(ilist[i]), at_start, at_end, nbond);
+ bool addedEdgeForType =
+ mk_igraph(g, i, &(ilist[i]), at_start, at_end, nbond);
+ addedEdge = (addedEdge || addedEdgeForType);
}
}
+
+ if (addedEdge)
+ {
+ g->parts = t_graph::BondedParts::MultipleConnected;
+ }
+ else
+ {
+ g->parts = t_graph::BondedParts::MultipleDisconnected;
+ }
}
/* Removed all the unused space from the edge array */
return -1;
}
+/* Returns the maximum length of the graph edges for coordinates x */
+static real maxEdgeLength(const t_graph g,
+ int ePBC,
+ const matrix box,
+ const rvec x[])
+{
+ t_pbc pbc;
+
+ set_pbc(&pbc, ePBC, box);
+
+ real maxEdgeLength2 = 0;
+
+ for (int node = 0; node < g.nnodes; node++)
+ {
+ for (int edge = 0; edge < g.nedge[node]; edge++)
+ {
+ int nodeJ = g.edge[node][edge];
+ rvec dx;
+ pbc_dx(&pbc, x[g.at0 + node], x[g.at0 + nodeJ], dx);
+ maxEdgeLength2 = std::max(maxEdgeLength2, norm2(dx));
+ }
+ }
+
+ return std::sqrt(maxEdgeLength2);
+}
+
void mk_mshift(FILE *log, t_graph *g, int ePBC,
const matrix box, const rvec x[])
{
}
if (nerror > 0)
{
+ /* We use a threshold of 0.25*boxSize for generating a fatal error
+ * to allow removing PBC for systems with periodic molecules.
+ *
+ * TODO: Consider a better solution for systems with periodic
+ * molecules. Ideally analysis tools should only ask to make
+ * non-periodic molecules whole in a system with periodic mols.
+ */
+ constexpr real c_relativeDistanceThreshold = 0.25;
+
+ int numPbcDimensions = ePBC2npbcdim(ePBC);
+ GMX_RELEASE_ASSERT(numPbcDimensions > 0, "Expect PBC with graph");
+ real minBoxSize = norm(box[XX]);
+ for (int d = 1; d < numPbcDimensions; d++)
+ {
+ minBoxSize = std::min(minBoxSize, norm(box[d]));
+ }
+ real maxDistance = maxEdgeLength(*g, ePBC, box, x);
+ if (maxDistance >= c_relativeDistanceThreshold*minBoxSize)
+ {
+ std::string mesg = gmx::formatString("There are inconsistent shifts over periodic boundaries in a molecule type consisting of %d atoms. The longest distance involved in such interactions is %.3f nm which is %s half the box length.",
+ g->at1 - g->at0, maxDistance,
+ maxDistance >= 0.5*minBoxSize ? "above" : "close to");
+
+ switch (g->parts)
+ {
+ case t_graph::BondedParts::MultipleConnected:
+ /* Ideally we should check if the long distances are
+ * actually between the parts, but that would require
+ * a lot of extra code.
+ */
+ mesg += " This molecule type consists of muliple parts, e.g. monomers, that are connected by interactions that are not chemical bonds, e.g. restraints. Such systems can not be treated. The only solution is increasing the box size.";
+ break;
+ default:
+ mesg += " Either you have excessively large distances between atoms in bonded interactions or your system is exploding.";
+ }
+ gmx_fatal(FARGS, mesg.c_str());
+ }
+
+ /* The most likely reason for arriving here is a periodic molecule. */
+
nerror_tot++;
if (nerror_tot <= 100)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
egcolWhite, egcolGrey, egcolBlack, egcolNR
} egCol;
-typedef struct t_graph {
+struct t_graph
+{
+ /* Described the connectivity between, potentially, multiple parts of
+ * the ilist that are internally chemically bonded together.
+ */
+ enum class BondedParts
+ {
+ Single, /* All atoms are connected through chemical bonds */
+ MultipleDisconnected, /* There are multiple parts, e.g. monomers, that are all disconnected */
+ MultipleConnected /* There are multiple parts, e.g. monomers, that are partially or fully connected between each other by interactions other than chemical bonds */
+ };
+
int at0; /* The first atom the graph was constructed for */
int at1; /* The last atom the graph was constructed for */
int nnodes; /* The number of nodes, nnodes=at_end-at_start */
ivec *ishift; /* Shift for each particle */
int negc;
egCol *egc; /* color of each node */
-} t_graph;
+ BondedParts parts; /* How chemically bonded parts are connected */
+};
#define SHIFT_IVEC(g, i) ((g)->ishift[i])
simdLoad(const double *m, SimdDoubleTag = {})
{
return {
+#if defined(__ibmxl__)
+ vec_ld(0, m)
+#else
+# if __GNUC__ < 7
*reinterpret_cast<const __vector double *>(m)
+# else
+ vec_vsx_ld(0, m)
+# endif
+#endif
};
}
static inline void gmx_simdcall
store(double *m, SimdDouble a)
{
+#if defined(__ibmxl__)
+ vec_st(a.simdInternal_, 0, m);
+#else
+# if __GNUC__ < 7
*reinterpret_cast<__vector double *>(m) = a.simdInternal_;
+# else
+ vec_vsx_st(a.simdInternal_, 0, m);
+# endif
+#endif
}
static inline SimdDouble gmx_simdcall
simdLoadU(const double *m, SimdDoubleTag = {})
{
return {
-#if __GNUC__ < 7
- *reinterpret_cast<const __vector double *>(m)
-#else
+#if defined(__ibmxl__)
vec_xl(0, m)
+#else
+# if __GNUC__ < 7
+ *reinterpret_cast<const __vector double *>(m)
+# else
+ vec_vsx_ld(0, m)
+# endif
#endif
};
}
static inline void gmx_simdcall
storeU(double *m, SimdDouble a)
{
-#if __GNUC__ < 7
- *reinterpret_cast<__vector double *>(m) = a.simdInternal_;
-#else
+#if defined(__ibmxl__)
vec_xst(a.simdInternal_, 0, m);
+#else
+# if __GNUC__ < 7
+ *reinterpret_cast<__vector double *>(m) = a.simdInternal_;
+# else
+ vec_vsx_st(a.simdInternal_, 0, m);
+# endif
#endif
}
{
alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_DINT32_WIDTH];
- store(ioffset, offset );
- gatherLoadTranspose<align>(base, ioffset, v0, v1);
+ store(ioffset, offset);
+
+ SimdDouble t1 = simdLoadU(base + align * ioffset[0]);
+ SimdDouble t2 = simdLoadU(base + align * ioffset[1]);
+ v0->simdInternal_ = vec_mergeh(t1.simdInternal_, t2.simdInternal_);
+ v1->simdInternal_ = vec_mergel(t1.simdInternal_, t2.simdInternal_);
}
static inline double gmx_simdcall
hw_opt->userGpuTaskAssignment.c_str());
}
-void check_and_update_hw_opt_1(gmx_hw_opt_t *hw_opt,
- const t_commrec *cr,
- int nPmeRanks)
+void check_and_update_hw_opt_1(const gmx::MDLogger &mdlog,
+ gmx_hw_opt_t *hw_opt,
+ const t_commrec *cr,
+ int nPmeRanks)
{
/* Currently hw_opt only contains default settings or settings supplied
* by the user on the command line.
/* Check for OpenMP settings stored in environment variables, which can
* potentially be different on different MPI ranks.
*/
- gmx_omp_nthreads_read_env(&hw_opt->nthreads_omp, SIMMASTER(cr));
+ gmx_omp_nthreads_read_env(mdlog, &hw_opt->nthreads_omp);
/* Check restrictions on the user supplied options before modifying them.
* TODO: Put the user values in a const struct and preserve them.
const gmx::MDLogger &mdlog);
/*! \brief Checks we can do when we don't (yet) know the cut-off scheme */
-void check_and_update_hw_opt_1(gmx_hw_opt_t *hw_opt,
- const t_commrec *cr,
- int nPmeRanks);
+void check_and_update_hw_opt_1(const gmx::MDLogger &mdlog,
+ gmx_hw_opt_t *hw_opt,
+ const t_commrec *cr,
+ int nPmeRanks);
/*! \brief Checks we can do when we know the cut-off scheme */
void check_and_update_hw_opt_2(gmx_hw_opt_t *hw_opt,
if (!isNullOrEmpty(installPrefix.path))
{
const char *const dataPath
- = installPrefix.bSourceLayout ? "share" : DATA_INSTALL_DIR;
+ = installPrefix.bSourceLayout ? "share" : GMX_INSTALL_GMXDATADIR;
return Path::join(installPrefix.path, dataPath, "top");
}
return std::string();
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
set_target_properties(mdrun PROPERTIES
OUTPUT_NAME "${BINARY_NAME}"
COMPILE_FLAGS "${OpenMP_C_FLAGS}")
- install(TARGETS mdrun DESTINATION ${BIN_INSTALL_DIR} COMPONENT mdrun)
+ install(TARGETS mdrun DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT mdrun)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
"complete -o nospace -F _gmx_mdrun_compl ${BINARY_NAME}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
- DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
else()
file(GLOB GMX_MAIN_SOURCES gmx.cpp legacymodules.cpp)
if(GMX_X11)
OUTPUT_NAME "${BINARY_NAME}"
COMPILE_FLAGS "${OpenMP_C_FLAGS}")
install(TARGETS gmx
- RUNTIME DESTINATION ${BIN_INSTALL_DIR})
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
########################
# Completion generation
endif()
if (SOURCE_IS_SOURCE_DISTRIBUTION OR GMX_BUILD_HELP)
install(DIRECTORY ${COMPLETION_DIR}/
- DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime OPTIONAL)
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime OPTIONAL)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
"complete -o nospace -F _gmx_compl ${BINARY_NAME}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gmx-completion-${BINARY_NAME}.bash
- DESTINATION ${BIN_INSTALL_DIR} COMPONENT runtime)
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime)
endif()
gmx_cpack_add_generated_source_directory(completion)