Merge branch 'origin/release-2020' into master
authorPaul Bauer <paul.bauer.q@gmail.com>
Wed, 6 May 2020 12:31:38 +0000 (14:31 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Wed, 6 May 2020 12:31:38 +0000 (14:31 +0200)
Resolved Conflicts:
admin/clang-tidy.sh
admin/containers/buildall.sh
admin/containers/utility.py
admin/dockerfiles/buildall.sh
admin/dockerfiles/ci-clang/Dockerfile
admin/dockerfiles/ci-docs-clang/Dockerfile
admin/dockerfiles/ci-docs-gcc/Dockerfile
admin/dockerfiles/ci-gcc/Dockerfile
admin/gitlab-ci/archive.gitlab-ci.yml
admin/gitlab-ci/documentation.gitlab-ci.yml
admin/gitlab-ci/global.gitlab-ci.yml
admin/gitlab-ci/gromacs.gitlab-ci.yml
admin/gitlab-ci/lint.gitlab-ci.yml
cmake/gmxManageSimd.cmake
cmake/gmxVersionInfo.cmake
docs/dev-manual/containers.rst
src/CMakeLists.txt
src/api/cpp/tests/testingconfiguration.h
src/buildinfo.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/ewald/pme_only.cpp
src/gromacs/fileio/matio.cpp
src/gromacs/fileio/oenv.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/listed_forces/bonded.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdtypes/interaction_const.h
src/gromacs/nbnxm/pairlist.h
src/gromacs/selection/CMakeLists.txt
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_double.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h
src/gromacs/simd/simd.h
src/gromacs/utility/basedefinitions.h
src/gromacs/utility/binaryinformation.cpp
src/testutils/CMakeLists.txt
src/testutils/TestMacros.cmake
src/testutils/testasserts.h

Change-Id: Ie157786299ca8f2d8c77a148b3bf1b1061f44b8a

48 files changed:
.gitignore
admin/containers/buildall.sh
admin/containers/utility.py
cmake/gmxGenerateVersionInfoRelease.cmake
cmake/gmxManageSimd.cmake
cmake/gmxVersionInfo.cmake
docs/CMakeLists.txt
docs/dev-manual/containers.rst
docs/release-notes/2020/2020.2.rst
docs/release-notes/2020/2020.3.rst [new file with mode: 0644]
docs/release-notes/index.rst
src/CMakeLists.txt
src/api/cpp/CMakeLists.txt
src/api/cpp/tests/testingconfiguration.h
src/buildinfo.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/compat/tests/pointers.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/fileio/matio.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/gmxpreprocess/tests/readir.cpp
src/gromacs/listed_forces/bonded.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdrun/isimulator.h
src/gromacs/mdrun/md.cpp
src/gromacs/mdtypes/interaction_const.h
src/gromacs/nbnxm/grid.h
src/gromacs/nbnxm/nbnxm_setup.cpp
src/gromacs/nbnxm/pairlist.h
src/gromacs/options/optionstoragetemplate.h
src/gromacs/selection/CMakeLists.txt
src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_float.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd4_double.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd4_float.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_double.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd_float.h
src/gromacs/simd/simd.h
src/gromacs/taskassignment/reportgpuusage.cpp
src/gromacs/topology/block.h
src/gromacs/utility/basedefinitions.h
src/gromacs/utility/binaryinformation.cpp
src/gromacs/utility/tests/enumerationhelpers.cpp
src/programs/mdrun/tests/densityfittingmodule.cpp
src/testutils/CMakeLists.txt
src/testutils/TestMacros.cmake

index 61f53ea1c291b7e119a09334ebb35b8f0f670c72..1769456783851593d9871e1f2923d154b9d5a661 100644 (file)
@@ -26,3 +26,5 @@ _build
 CMakeLists.txt.user
 /VersionInfo*.cmake
 Testing
+/.vs
+/CMakeSettings.json
index ee38d782a71950ca42985e2ad074cd0dd0d38209..afc2b7166234401ea24badb5becb570f581124eb 100644 (file)
@@ -17,6 +17,10 @@ tag="gromacs/cmake-3.9.6-gcc-6-cuda-10.1-nvidiaopencl-clfft-openmpi:2020"
 tags[${#tags[@]}]=$tag
 python3 $SCRIPT --cmake 3.9.6 --gcc 6 --cuda 10.1 --opencl --clfft --mpi openmpi | docker build -t $tag -
 
+tag="gromacs/cmake-3.9.6-gcc-7-amdopencl-clfft-openmpi:2020"
+tags[${#tags[@]}]=$tag
+python3 $SCRIPT --cmake 3.9.6 --gcc 7 --opencl amd --clfft --mpi openmpi | docker build -t $tag -
+
 tag="gromacs/cmake-3.15.7-gcc-8-cuda-10.1-openmpi:2020"
 tags[${#tags[@]}]=$tag
 python3 $SCRIPT --cmake 3.15.7 --gcc 8 --cuda 10.1 --mpi openmpi | docker build -t $tag -
@@ -88,5 +92,6 @@ python3 $SCRIPT --gcc --doxygen | docker build -t $tag -
 
 docker login
 for tag in "${tags[@]}"; do
-  docker push $tag
+  echo "Pushing $tag"
+  #docker push $tag
 done
index b556f85292c91d461502b808a24496954e9df45c..6652b8edfde5e0de142b255af6af00c9985cf926 100644 (file)
@@ -66,8 +66,8 @@ compiler_group.add_argument('--gcc', type=int, nargs='?', const=7, default=7,
                             choices=[5, 6, 7, 8, 9],
                             help='Select GNU compiler tool chain. (Default) '
                                  'Some checking is implemented to avoid incompatible combinations')
-compiler_group.add_argument('--llvm', type=int, nargs='?', const=7, default=None,
-                            choices=[3, 6, 7, 8, 9],
+compiler_group.add_argument('--llvm', type=str, nargs='?', const='7', default=None,
+                            choices=['3.6', '6', '7', '8'],
                             help='Select LLVM compiler tool chain. '
                                  'Some checking is implemented to avoid incompatible combinations')
 compiler_group.add_argument('--icc', type=int, nargs='?', const=19, default=None,
index 98107481e899260451e76809219beed7e73441ff..2e3997ff0a80778f08875c9567dbad016878baaa 100644 (file)
@@ -88,6 +88,12 @@ set(GMX_VERSION_STRING_FULL          ${PROJECT_VERSION})
 # We had to pass the directory list as a string, so now we convert it back to a list
 string(REPLACE ":" ";" DIRECTORIES_TO_CHECKSUM_LIST ${DIRECTORIES_TO_CHECKSUM})
 
+# We need the full path to the directories after passing it through
+set(FULL_PATH_DIRECTORIES "")
+foreach(DIR ${DIRECTORIES_TO_CHECKSUM_LIST})
+    list(APPEND FULL_PATH_DIRECTORIES "${PROJECT_SOURCE_DIR}/${DIR}")
+endforeach()
+
 # Prepare for checking source tree file hashes.
 # To notify the user during compilation and at runtime that the build source
 # has not been modified after unpacking the source tarball, the contents are hashed
@@ -108,7 +114,7 @@ if(NOT VERSION_STRING_OF_FORK OR "${VERSION_STRING_OF_FORK}" STREQUAL "")
         set(CHECKSUM_RESULT_FILE "${CMAKE_CURRENT_BINARY_DIR}/computed_checksum")
         execute_process(COMMAND ${PYTHON_EXECUTABLE}
                                 ${PROJECT_SOURCE_DIR}/admin/createFileHash.py
-                                -s ${DIRECTORIES_TO_CHECKSUM_LIST}
+                                -s ${FULL_PATH_DIRECTORIES}
                                 -o ${CHECKSUM_RESULT_FILE}
                         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                         OUTPUT_QUIET)
index 6f0c6343eb7e49549e3a69d6e3a3afac4e3d4c00..55c49b921f19c1a21ea8b327d7cb55c9c9edf169 100644 (file)
@@ -264,6 +264,13 @@ elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VMX")
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VSX")
 
+    # IBM_VSX and gcc > 9 do not work together, so we need to prevent people from
+    # choosing a combination that might fail. Issue #3380.
+    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9")
+        message(FATAL_ERROR "IBM_VSX does not work together with gcc > 9. Disable SIMD support (slower), or use an older version of the GNU compiler")
+    endif()
+
+
     gmx_find_simd_ibm_vsx_flags(SIMD_IBM_VSX_C_SUPPORTED SIMD_IBM_VSX_CXX_SUPPORTED
                                 SIMD_IBM_VSX_C_FLAGS SIMD_IBM_VSX_CXX_FLAGS)
 
index 136b8893c8fbfb82df19c3762ac59fdb9a62a5e5..58f3ff6efc8389ca82ee090cc010f03057a7e155 100644 (file)
@@ -262,7 +262,7 @@ set(REGRESSIONTEST_BRANCH "master")
 # 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 "b032e4517195b1f8cd9db87cee1b30df" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
+set(REGRESSIONTEST_MD5SUM "b75c3b1bac0e4114e236f049fc7f1f1c" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
 
 math(EXPR GMX_VERSION_NUMERIC
      "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
@@ -333,8 +333,8 @@ set(VERSION_INFO_DEPS         ${VERSION_INFO_CMAKE_FILE})
 set(VERSION_INFO_CMAKEIN_FILE     ${CMAKE_CURRENT_LIST_DIR}/VersionInfo.cmake.cmakein)
 set(VERSION_INFO_CONFIGURE_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/gmxConfigureVersionInfo.cmake)
 # A set of directories to scan for calculating the hash of source files.
-set(SET_OF_DIRECTORIES_TO_CHECKSUM  "${PROJECT_SOURCE_DIR}/src")
-list(APPEND SET_OF_DIRECTORIES_TO_CHECKSUM "${PROJECT_SOURCE_DIR}/python_packaging")
+set(SET_OF_DIRECTORIES_TO_CHECKSUM  "src")
+list(APPEND SET_OF_DIRECTORIES_TO_CHECKSUM "python_packaging")
 # Due to the limitations for passing a list as arguments, we make the directories a string here
 string(REPLACE ";" ":" DIRECTORIES_TO_CHECKSUM_STRING "${SET_OF_DIRECTORIES_TO_CHECKSUM}")
 
@@ -434,12 +434,17 @@ set(CHECKSUM_FILE "${PROJECT_SOURCE_DIR}/src/reference_checksum")
 # not been tampered with.
 # Note: The RUN_ALWAYS here is to regenerate the hash file only, it does not
 # mean that the target is run in all builds
-if (PYTHON_EXECUTABLE)
+if (PYTHONINTERP_FOUND)
+    # We need the full path to the directories after passing it through
+    set(FULL_PATH_DIRECTORIES "")
+    foreach(DIR ${SET_OF_DIRECTORIES_TO_CHECKSUM})
+        list(APPEND FULL_PATH_DIRECTORIES "${PROJECT_SOURCE_DIR}/${DIR}")
+    endforeach()
     gmx_add_custom_output_target(reference_checksum RUN_ALWAYS
         OUTPUT ${CHECKSUM_FILE}
         COMMAND ${PYTHON_EXECUTABLE}
             ${PROJECT_SOURCE_DIR}/admin/createFileHash.py
-            -s ${SET_OF_DIRECTORIES_TO_CHECKSUM}
+            -s ${FULL_PATH_DIRECTORIES}
             -o ${CHECKSUM_FILE}
         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
         COMMENT "Generating reference checksum of source files")
index 3d8ce9b2e0dea083010a4501d2473abaced3c19d..f5503ad2b0f3e50fc5e427d19ebdce3a81e8c779 100644 (file)
@@ -374,6 +374,7 @@ if (SPHINX_FOUND)
         release-notes/2021/major/miscellaneous.rst
         release-notes/2020/2020.1.rst
         release-notes/2020/2020.2.rst
+        release-notes/2020/2020.3.rst
         release-notes/2020/major/highlights.rst
         release-notes/2020/major/features.rst
         release-notes/2020/major/performance.rst
index f338d0867c831cee069445980a227139a72be028..82b3c9faa1dbc48ed0bcf33dbe3485106c57c993 100644 (file)
@@ -24,4 +24,5 @@ We use the `NVidia HPC Container Maker <https://github.com/NVIDIA/hpc-container-
 package for scripted Dockerfile generation.
 See :file:`admin/containers/scripted_gmx_docker_builds.py`.
 
-.. automodule:: scripted_gmx_docker_builds
+.. todo:: :issue:`3272` Insert tool documentation.
+    E.g. ``.. automodule:: scripted_gmx_docker_builds``
index d10999d4e9838a856eec1ce0e53ccd3422bc882d..0ef68802565ab2d303fca4810ccad4a8fe553b1e 100644 (file)
@@ -1,7 +1,7 @@
 GROMACS 2020.2 release notes
 ----------------------------
 
-This version was released on TODO, 2020. These release notes
+This version was released on April 30th, 2020. These release notes
 document the changes that have taken place in GROMACS since the
 previous 2020.1 version, to fix known issues. It also incorporates all
 fixes made in version 2019.6 and earlier, which you can find described
@@ -16,12 +16,85 @@ in the :ref:`release-notes`.
 Fixes where mdrun could behave incorrectly
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+Ewald dipole correction incorrect without domain decomposition
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Ewald dipole correction (epsilon-surface != 0) is now disabled when not
+using domain decomposition. With domain decomposition, it only works
+when each molecule consists of a single update group (e.g. water).
+This will be fixed in release-2021.
+
+:issue:`3441`
+
+Expanded ensemble simulations restarted from checkpoints
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+When restarting expanded ensemble simulations from checkpoints, expanded
+ensemble would silently refuse to run, and simulations would remain in
+their original lambda state.
+
+:issue:`3465`
+
+Fixed free energy calculations with LJ PME
+""""""""""""""""""""""""""""""""""""""""""
+
+Fixed an issue that calculated wrong long-range corrections when using
+free energy perturbation with ``vdwtype = pme``. This affected forces,
+energies, lambda derivatives and foreign lambdas.
+
+:issue:`3470`
+
+The velocities of the center of mass are now removed correctly in case of -update gpu
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+When the center of mass motion is removed, the velocities are updated in the CPU memory.
+In case of GPU update, they should be copied back to the GPU memory after they were updated
+on the CPU. This affected most runs where the velocity of the center of mass has to be removed,
+in particular these where this velocity is large in the beginning of the run.
+
+:issue:`3508`
+
+Fix checkpoint restart with non-zero initial step
+"""""""""""""""""""""""""""""""""""""""""""""""""
+
+When restarting from the checkpoint, the init-step mdp parameter was ignored while
+checking if the simulation is already finished. As a result, this check only worked
+properly when init-step was 0 or was not specified.
+
+:issue:`3489`
+
 Fixes for ``gmx`` tools
 ^^^^^^^^^^^^^^^^^^^^^^^
 
+Time output unit fixes
+^^^^^^^^^^^^^^^^^^^^^^
+
+When selecting a time unit of microseconds or larger,
+``gmx tool -tu`` now produces the correct string in .xvg and
+particularly .xvgr plots
+
+Fix do_dssp
+^^^^^^^^^^^
+
+The tool would fail with a segmentation fault.
+
+:issue:`3444`
+
 Fixes that affect portability
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+Give clearer message about not detecting IBM_VSX support in gcc > 9
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CMake would fail with a confusing error message.
+
+:issue:`3380`
+
 Miscellaneous
 ^^^^^^^^^^^^^
 
+Fixed initial DLB state reporting
+"""""""""""""""""""""""""""""""""
+
+The initial DLB state was reported incorrectly in the log file when
+the either "on" or "auto" value was the chosen at mdrun startup.
diff --git a/docs/release-notes/2020/2020.3.rst b/docs/release-notes/2020/2020.3.rst
new file mode 100644 (file)
index 0000000..858c35a
--- /dev/null
@@ -0,0 +1,31 @@
+GROMACS 2020.3 release notes
+----------------------------
+
+This version was released on TODO, 2020. These release notes
+document the changes that have taken place in GROMACS since the
+previous 2020.2 version, to fix known issues. It also incorporates all
+fixes made in version 2019.6 and earlier, which you can find described
+in the :ref:`release-notes`.
+
+.. Note to developers!
+   Please use """"""" to underline the individual entries for fixed issues in the subfolders,
+   otherwise the formatting on the webpage is messed up.
+   Also, please use the syntax :issue:`number` to reference issues on redmine, without the
+   a space between the colon and number!
+
+Fixes where mdrun could behave incorrectly
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Fixes for ``gmx`` tools
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Fixes that affect portability
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Fix error with tinyxml2 linking
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The signature for linking the external library was wrong.
+
+Miscellaneous
+^^^^^^^^^^^^^
+
index e1796a0c9642fe50213b81add38d13c6a915747c..1b30704e5787b298f21fdd9b8de48bdae708ee3d 100644 (file)
@@ -53,6 +53,7 @@ Patch releases
 
    2020/2020.1
    2020/2020.2
+   2020/2020.3
 
 Major release
 ^^^^^^^^^^^^^
index 820e83c108255f1aa002ddb45bca9b0940c2d069..4d75aabea445d73d8c4af593adbd60761d3ffe73 100644 (file)
@@ -48,10 +48,6 @@ if(GMX_USE_CUDA)
     get_cuda_compiler_info(CUDA_COMPILER_INFO CUDA_DEVICE_COMPILER_FLAGS CUDA_HOST_COMPILER_FLAGS)
 endif()
 
-string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
-configure_file(config.h.cmakein config.h)
-configure_file(gmxpre-config.h.cmakein gmxpre-config.h)
-configure_file(buildinfo.h.cmakein buildinfo.h ESCAPE_QUOTES)
 # Make a file with compiler flags used for libgromacs for each
 # langauge and build configuration.  The one that corresponds to
 # CMAKE_BUILD_TYPE is #included into buildinfo.h and populates the
@@ -155,3 +151,21 @@ if (GMXAPI)
    endif()
    add_subdirectory(api)
 endif()
+
+# Configure header files with configuration-specific values. This step
+# should follow all introspection e.g. looking for headers and
+# libraries. If not, cmake will need to change the contents of the
+# file upon subsequent runs of cmake. This can mean that
+#
+#  cmake $src && make && make test
+#
+# requires building all the source files that depend on the changed
+# header file in both of the make stages. That's slow, and is useless
+# busy work for ccache, too.
+string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
+configure_file(config.h.cmakein config.h)
+configure_file(gmxpre-config.h.cmakein gmxpre-config.h)
+
+set(CMAKE_BUILD_CONFIGURATION_C_FLAGS   ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}})
+set(CMAKE_BUILD_CONFIGURATION_CXX_FLAGS ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}})
+configure_file(buildinfo.h.cmakein buildinfo.h ESCAPE_QUOTES)
index 394e80b04507506dfbb22fe31cd41a28a5be4120..748cdcce09d3b9bfefc142c251ed86f90931f2ba 100644 (file)
@@ -106,6 +106,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
 endif()
 
 set_target_properties(gmxapi PROPERTIES
+                      OUTPUT_NAME "gmxapi${GMX_LIBS_SUFFIX}"
                       SOVERSION ${GMXAPI_MAJOR}
                       VERSION ${GMXAPI_RELEASE}
                       )
index 4e050d75b3e3e871ad30509a62d301d65fe66c09..3d160d7e1419e267e16f44da833fd62a7331546b 100644 (file)
@@ -41,6 +41,8 @@
 #include <string>
 #include <vector>
 
+#include "config.h"
+
 #include <gtest/gtest.h>
 
 #include "gromacs/gmxpreprocess/grompp.h"
index c2c48ece3aee1a4e6516f25362d57afd53767aee..ba5f3658b67f8352f588e1a463d504499e4754a6 100644 (file)
 /** C compiler used to build */
 #define BUILD_C_COMPILER        "@BUILD_C_COMPILER@"
 
+/** C compiler flags for this build configuration */
+#define CMAKE_BUILD_CONFIGURATION_C_FLAGS "@CMAKE_BUILD_CONFIGURATION_C_FLAGS@"
+
 #include "compilerflaginfo-@CMAKE_BUILD_TYPE@-C.h"
 
-/** C++ compiler flags used to build, or empty string if no C++ */
+/** C++ compiler used to build */
 #define BUILD_CXX_COMPILER      "@BUILD_CXX_COMPILER@"
 
+/** C++ compiler flags for this build configuration */
+#define CMAKE_BUILD_CONFIGURATION_CXX_FLAGS "@CMAKE_BUILD_CONFIGURATION_CXX_FLAGS@"
+
 #include "compilerflaginfo-@CMAKE_BUILD_TYPE@-CXX.h"
 
 /** Installation prefix (default location of data files) */
index a549ddd9154598ed4e97b2ca421bfb4f82bcb37b..0b369bde85feaaa8e3a180699bd07d8cedd18469 100644 (file)
@@ -274,11 +274,6 @@ endif()
 # TODO Perhaps generalize this for all headers from src/external
 target_include_directories(libgromacs SYSTEM PRIVATE ${PROJECT_SOURCE_DIR}/src/external)
 
-# Temporary fix to allow external access to restraintpotentail
-target_include_directories(libgromacs PUBLIC
-                           $<INSTALL_INTERFACE:include>
-                           )
-
 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
@@ -350,6 +345,13 @@ if (GMX_CLANG_TIDY)
        "${CLANG_TIDY_EXE};-warnings-as-errors=*")
 endif()
 
+# clang-3.6 warns about a number of issues that are not reported by more modern compilers
+# and we know they are not real issues. So we only check that it can compile without error
+# but ignore all warnings.
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^3\.6")
+    target_compile_options(libgromacs PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-w>)
+endif()
+
 # Only install the library in mdrun-only mode if it is actually necessary
 # for the binary
 if (NOT GMX_BUILD_MDRUN_ONLY OR BUILD_SHARED_LIBS)
index 4131ed28993f2bbb484b3f7844ca11bc2f03177e..991f9a31725e689a28a4897956fec54717f26c3e 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "gromacs/compat/pointers.h"
 
+#include "config.h"
+
 #include <memory>
 #include <vector>
 
index bbd5d8a213a89898aff833d094edbb213ede4174..3f355f71a835a42ada515934ccf1a0594c98d79e 100644 (file)
@@ -120,7 +120,7 @@ using gmx::DdRankOrder;
 using gmx::DlbOption;
 using gmx::DomdecOptions;
 
-static const char* edlbs_names[int(DlbState::nr)] = { "off", "auto", "locked", "on", "on" };
+static const char* edlbs_names[int(DlbState::nr)] = { "off", "off", "auto", "locked", "on", "on" };
 
 /* The size per atom group of the cggl_flag buffer in gmx_domdec_comm_t */
 #define DD_CGIBS 2
index cf91196e0ef5440f8a8ab82a60ebbe3b3ff41ad5..8e1873867cb62076882fbcc7718957e8f7e4d93b 100644 (file)
@@ -293,7 +293,7 @@ static t_matrix read_xpm_entry(FILE* in)
         findLabelInLine(lineString, "type"); // discard the returned string
     }
 
-    if (!line || strncmp(line, "static", 6) != 0)
+    if (!line_buf || strncmp(line_buf, "static", 6) != 0)
     {
         gmx_input("Invalid XPixMap");
     }
@@ -433,6 +433,7 @@ static t_matrix read_xpm_entry(FILE* in)
             line = line_buf;
         }
         bSetLine = TRUE;
+        GMX_RELEASE_ASSERT(line, "Need to have valid line to parse");
         if (strstr(line, "x-axis"))
         {
             line = std::strstr(line, "x-axis");
index 5dda614a9c2ec42ee0399d250ffae987df053ab1..a5a5f82267cf7f775ef620840718251a4a57b300 100644 (file)
@@ -189,7 +189,7 @@ static int strip_dssp(FILE*                   tapeout,
         mat->axis_y.resize(nr);
         std::iota(mat->axis_y.begin(), mat->axis_y.end(), 1);
         mat->axis_x.resize(0);
-        mat->matrix.resize(0, 0);
+        mat->matrix.resize(1, 1);
         bFirst = false;
     }
     mat->axis_x.push_back(t);
index 1c92c76e1fd2497bb8d8cad4390b135db99457a6..f1bf5bb89e71b700572f09f3e23a1278da75e964 100644 (file)
@@ -121,7 +121,7 @@ static void add_xr(t_xrama* xr, const int ff[5], const t_atoms* atoms)
     char buf[12];
     int  i;
 
-    srenew(xr->dih, xr->ndih + 2);
+    srenew(xr->dih, xr->ndih + 2LL);
     for (i = 0; (i < 4); i++)
     {
         xr->dih[xr->ndih].ai[i] = ff[i];
@@ -132,7 +132,7 @@ static void add_xr(t_xrama* xr, const int ff[5], const t_atoms* atoms)
     }
     xr->ndih += 2;
 
-    srenew(xr->pp, xr->npp + 1);
+    srenew(xr->pp, xr->npp + 1LL);
     xr->pp[xr->npp].iphi  = xr->ndih - 2;
     xr->pp[xr->npp].ipsi  = xr->ndih - 1;
     xr->pp[xr->npp].bShow = FALSE;
@@ -179,7 +179,9 @@ static void min_max(t_xrama* xr)
     {
         for (j = 0; (j < 4); j++)
         {
+            MSVC_DIAGNOSTIC_IGNORE(28182) // false positive in 2019 (16.5.4)
             ai = xr->dih[i].ai[j];
+            MSVC_DIAGNOSTIC_RESET
             if (ai < xr->amin)
             {
                 xr->amin = ai;
@@ -220,7 +222,7 @@ static void get_dih_props(t_xrama* xr, const t_idef* idef, int mult)
         }
 
         i += nra + 1;
-        ia += nra + 1;
+        ia += nra + 1LL;
     }
     /* Fill in defaults for values not in the topology */
     for (i = 0; (i < xr->ndih); i++)
index 592c73ffa33f434847904de59051da6de5c14ca6..e23eef5bacac81b46820d97095190cd3f8cfbf02 100644 (file)
@@ -299,21 +299,32 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
     real rcutoff_max2 = std::max(ic->rcoulomb, ic->rvdw);
     rcutoff_max2      = rcutoff_max2 * rcutoff_max2;
 
-    const real* tab_ewald_F_lj = nullptr;
-    const real* tab_ewald_V_lj = nullptr;
-    const real* ewtab          = nullptr;
-    real        ewtabscale     = 0;
-    real        ewtabhalfspace = 0;
-    real        sh_ewald       = 0;
+    const real* tab_ewald_F_lj           = nullptr;
+    const real* tab_ewald_V_lj           = nullptr;
+    const real* ewtab                    = nullptr;
+    real        coulombTableScale        = 0;
+    real        coulombTableScaleInvHalf = 0;
+    real        vdwTableScale            = 0;
+    real        vdwTableScaleInvHalf     = 0;
+    real        sh_ewald                 = 0;
     if (elecInteractionTypeIsEwald || vdwInteractionTypeIsEwald)
     {
-        const auto& tables = *ic->coulombEwaldTables;
-        sh_ewald           = ic->sh_ewald;
-        ewtab              = tables.tableFDV0.data();
-        ewtabscale         = tables.scale;
-        ewtabhalfspace     = half / ewtabscale;
-        tab_ewald_F_lj     = tables.tableF.data();
-        tab_ewald_V_lj     = tables.tableV.data();
+        sh_ewald = ic->sh_ewald;
+    }
+    if (elecInteractionTypeIsEwald)
+    {
+        const auto& coulombTables = *ic->coulombEwaldTables;
+        ewtab                     = coulombTables.tableFDV0.data();
+        coulombTableScale         = coulombTables.scale;
+        coulombTableScaleInvHalf  = half / coulombTableScale;
+    }
+    if (vdwInteractionTypeIsEwald)
+    {
+        const auto& vdwTables = *ic->vdwEwaldTables;
+        tab_ewald_F_lj        = vdwTables.tableF.data();
+        tab_ewald_V_lj        = vdwTables.tableV.data();
+        vdwTableScale         = vdwTables.scale;
+        vdwTableScaleInvHalf  = half / vdwTableScale;
     }
 
     /* For Ewald/PME interactions we cannot easily apply the soft-core component to
@@ -680,12 +691,12 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
                  */
                 real v_lr, f_lr;
 
-                const RealType ewrt   = r * ewtabscale;
+                const RealType ewrt   = r * coulombTableScale;
                 IntType        ewitab = static_cast<IntType>(ewrt);
                 const RealType eweps  = ewrt - ewitab;
                 ewitab                = 4 * ewitab;
                 f_lr                  = ewtab[ewitab] + eweps * ewtab[ewitab + 1];
-                v_lr = (ewtab[ewitab + 2] - ewtabhalfspace * eweps * (ewtab[ewitab] + f_lr));
+                v_lr = (ewtab[ewitab + 2] - coulombTableScaleInvHalf * eweps * (ewtab[ewitab] + f_lr));
                 f_lr *= rinv;
 
                 /* Note that any possible Ewald shift has already been applied in
@@ -725,7 +736,7 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
                  * r close to 0 for non-interacting pairs.
                  */
 
-                const RealType rs   = rsq * rinv * ewtabscale;
+                const RealType rs   = rsq * rinv * vdwTableScale;
                 const IntType  ri   = static_cast<IntType>(rs);
                 const RealType frac = rs - ri;
                 const RealType f_lr = (1 - frac) * tab_ewald_F_lj[ri] + frac * tab_ewald_F_lj[ri + 1];
@@ -734,7 +745,8 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
                  */
                 const RealType FF = f_lr * rinv / six;
                 RealType       VV =
-                        (tab_ewald_V_lj[ri] - ewtabhalfspace * frac * (tab_ewald_F_lj[ri] + f_lr)) / six;
+                        (tab_ewald_V_lj[ri] - vdwTableScaleInvHalf * frac * (tab_ewald_F_lj[ri] + f_lr))
+                        / six;
 
                 if (ii == jnr)
                 {
index 71771bcccb91c79a7cf599aaf7ca6b265e3a6c36..80e407451b48b9619c57df2afe6942f6606a6d1c 100644 (file)
@@ -47,6 +47,8 @@
 
 #include "gromacs/gmxpreprocess/readir.h"
 
+#include "config.h"
+
 #include <string>
 
 #include <gtest/gtest.h>
index 443008c374e9d76f67a9fd75c14b42a96b453a12..75fd2c8e8fbc0f03dc9eb4e21d802e3d2d16a0d1 100644 (file)
@@ -3752,11 +3752,18 @@ struct BondedInteractions
     int            nrnbIndex;
 };
 
+// Bug in old clang versions prevents constexpr. constexpr is needed for MSVC.
+#if defined(__clang__) && __clang_major__ < 6
+#    define CONSTEXPR_EXCL_OLD_CLANG const
+#else
+#    define CONSTEXPR_EXCL_OLD_CLANG constexpr
+#endif
+
 /*! \brief Lookup table of bonded interaction functions
  *
  * This must have as many entries as interaction_function in ifunc.cpp */
 template<BondedKernelFlavor flavor>
-const std::array<BondedInteractions, F_NRE> c_bondedInteractionFunctions = {
+CONSTEXPR_EXCL_OLD_CLANG std::array<BondedInteractions, F_NRE> c_bondedInteractionFunctions = {
     BondedInteractions{ bonds<flavor>, eNR_BONDS },                       // F_BONDS
     BondedInteractions{ g96bonds<flavor>, eNR_BONDS },                    // F_G96BONDS
     BondedInteractions{ morse_bonds<flavor>, eNR_MORSE },                 // F_MORSE
@@ -3852,7 +3859,8 @@ const std::array<BondedInteractions, F_NRE> c_bondedInteractionFunctions = {
 };
 
 /*! \brief List of instantiated BondedInteractions list */
-const gmx::EnumerationArray<BondedKernelFlavor, std::array<BondedInteractions, F_NRE>> c_bondedInteractionFunctionsPerFlavor = {
+CONSTEXPR_EXCL_OLD_CLANG
+gmx::EnumerationArray<BondedKernelFlavor, std::array<BondedInteractions, F_NRE>> c_bondedInteractionFunctionsPerFlavor = {
     c_bondedInteractionFunctions<BondedKernelFlavor::ForcesSimdWhenAvailable>,
     c_bondedInteractionFunctions<BondedKernelFlavor::ForcesNoSimd>,
     c_bondedInteractionFunctions<BondedKernelFlavor::ForcesAndVirialAndEnergy>,
index c8725816b3814318f76b905cd49b5e480971d2c4..3cb7e40a93c6e173f20f7a9fd45c712063f55d92 100644 (file)
@@ -751,12 +751,13 @@ static void init_ewald_f_table(const interaction_const_t& ic,
 
 void init_interaction_const_tables(FILE* fp, interaction_const_t* ic, const real tableExtensionLength)
 {
-    if (EEL_PME_EWALD(ic->eeltype))
+    if (EEL_PME_EWALD(ic->eeltype) || EVDW_PME(ic->vdwtype))
     {
-        init_ewald_f_table(*ic, tableExtensionLength, ic->coulombEwaldTables.get(), nullptr);
+        init_ewald_f_table(*ic, tableExtensionLength, ic->coulombEwaldTables.get(),
+                           ic->vdwEwaldTables.get());
         if (fp != nullptr)
         {
-            fprintf(fp, "Initialized non-bonded Coulomb Ewald tables, spacing: %.2e size: %zu\n\n",
+            fprintf(fp, "Initialized non-bonded Ewald tables, spacing: %.2e size: %zu\n\n",
                     1 / ic->coulombEwaldTables->scale, ic->coulombEwaldTables->tableF.size());
         }
     }
@@ -817,6 +818,7 @@ static void init_interaction_const(FILE*                 fp,
     ic->cutoff_scheme = ir->cutoff_scheme;
 
     ic->coulombEwaldTables = std::make_unique<EwaldCorrectionTables>();
+    ic->vdwEwaldTables     = std::make_unique<EwaldCorrectionTables>();
 
     /* Lennard-Jones */
     ic->vdwtype         = ir->vdwtype;
index 5ff92d9e19401a2ee8f26246cd52f18c96521275..179e3116e525860395178d1cd60ebde5df26bead 100644 (file)
@@ -1101,7 +1101,7 @@ void do_force(FILE*                               fplog,
 
     // If coordinates are to be sent to PME task from GPU memory, perform that send here.
     // Otherwise the send will occur before the H2D coordinate transfer.
-    if (pmeSendCoordinatesFromGpu)
+    if (!thisRankHasDuty(cr, DUTY_PME) && pmeSendCoordinatesFromGpu)
     {
         /* Send particle coordinates to the pme nodes */
         gmx_pme_send_coordinates(fr, cr, box, as_rvec_array(x.unpaddedArrayRef().data()), lambda[efptCOUL],
index 946399c92f27d73ea106090c587e97194ead1b87..8f7ee114832d4791962941c2da7c3289fbb0a9b8 100644 (file)
@@ -190,7 +190,7 @@ protected:
     //! Contains command-line options to mdrun.
     const MdrunOptions& mdrunOptions;
     //! Whether the simulation will start afresh, or restart with/without appending.
-    StartingBehavior startingBehavior;
+    const StartingBehavior startingBehavior;
     //! Handles virtual sites.
     gmx_vsite_t* vsite;
     //! Handles constraints.
index 3971786b001ca7c082da7781b3fd5dda046bba86..10b76df3778955f5a83038e18ce2edd367911be7 100644 (file)
@@ -787,7 +787,7 @@ void gmx::LegacySimulator::do_md()
             bDoDHDL     = do_per_step(step, ir->fepvals->nstdhdl);
             bDoFEP      = ((ir->efep != efepNO) && do_per_step(step, nstfep));
             bDoExpanded = (do_per_step(step, ir->expandedvals->nstexpanded) && (ir->bExpanded)
-                           && (step > 0) && (startingBehavior == StartingBehavior::NewSimulation));
+                           && (!bFirstStep));
         }
 
         bDoReplEx = (useReplicaExchange && (step > 0) && !bLastStep
@@ -1193,7 +1193,7 @@ void gmx::LegacySimulator::do_md()
         bInteractiveMDstep = imdSession->run(step, bNS, state->box, state->x.rvec_array(), t);
 
         /* kludge -- virial is lost with restart for MTTK NPT control. Must reload (saved earlier). */
-        if (startingBehavior != StartingBehavior::NewSimulation
+        if (startingBehavior != StartingBehavior::NewSimulation && bFirstStep
             && (inputrecNptTrotter(ir) || inputrecNphTrotter(ir)))
         {
             copy_mat(state->svir_prev, shake_vir);
@@ -1452,6 +1452,11 @@ void gmx::LegacySimulator::do_md()
                         // force kernels that use the coordinates on the next steps is not implemented
                         // (not because of a race on state->x being modified on the CPU while H2D is in progress).
                         stateGpu->waitCoordinatesCopiedToDevice(AtomLocality::Local);
+                        // If the COM removal changed the velocities on the CPU, this has to be accounted for.
+                        if (vcm.mode != ecmNO)
+                        {
+                            stateGpu->copyVelocitiesToGpu(state->v, AtomLocality::Local);
+                        }
                     }
                 }
             }
index bc09f47c92a6e129702e5af842f3197cdf4a3acf..e9378fe8336e9277d1a04352b33bd7d4a5bedb58 100644 (file)
@@ -144,9 +144,8 @@ struct interaction_const_t
 
     // Coulomb Ewald correction table
     std::unique_ptr<EwaldCorrectionTables> coulombEwaldTables;
-    /* Note that a Van der Waals Ewald correction table
-     * of type EwaldCorrectionTables can be added here if wanted.
-     */
+    // Van der Waals Ewald correction table
+    std::unique_ptr<EwaldCorrectionTables> vdwEwaldTables;
 };
 
 #endif
index b55f83d22256cc2546d016f00ba355bf15ad5f95..806ee91f2bdb8826801f7d4816e6081197a7ee53 100644 (file)
@@ -256,7 +256,7 @@ public:
     //! Returns the number of cells in the column
     int numCellsInColumn(int columnIndex) const
     {
-        return cxy_ind_[columnIndex + 1] - cxy_ind_[columnIndex];
+        return cxy_ind_[columnIndex + 1LL] - cxy_ind_[columnIndex];
     }
 
     //! Returns the index of the first atom in the column
index ea90c12b0c7e713c16777d492c0a0409a554a0e3..e7994d84bac46560035ffc9b5e3d746a0dbd0cdc 100644 (file)
@@ -186,6 +186,7 @@ static KernelSetup pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused* ir,
          * On AMD Zen, tabulated Ewald kernels are faster on all 4 combinations
          * of single or double precision and 128 or 256-bit AVX2.
          */
+        MSVC_DIAGNOSTIC_IGNORE(6285) // Always zero because compile time constant
         if (
 #if GMX_SIMD
                 (GMX_SIMD_REAL_WIDTH >= 8 || (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE)) &&
@@ -194,10 +195,8 @@ static KernelSetup pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused* ir,
         {
             kernelSetup.ewaldExclusionType = EwaldExclusionType::Analytical;
         }
-        else
-        {
-            kernelSetup.ewaldExclusionType = EwaldExclusionType::Table;
-        }
+        MSVC_DIAGNOSTIC_RESET
+        else { kernelSetup.ewaldExclusionType = EwaldExclusionType::Table; }
         if (getenv("GMX_NBNXN_EWALD_TABLE") != nullptr)
         {
             kernelSetup.ewaldExclusionType = EwaldExclusionType::Table;
index 97805f7f1b5a615ab051922d41a9851858b35d16..04f33159905bdc48ef3400306e01ba907f826352 100644 (file)
@@ -208,6 +208,7 @@ typedef struct
 struct nbnxn_excl_t
 {
     //! Constructor, sets no exclusions, so all atom pairs interacting
+    MSVC_DIAGNOSTIC_IGNORE(26495) // pair is not being initialized!
     nbnxn_excl_t()
     {
         for (unsigned int& pairEntry : pair)
@@ -215,6 +216,7 @@ struct nbnxn_excl_t
             pairEntry = NBNXN_INTERACTION_MASK_ALL;
         }
     }
+    MSVC_DIAGNOSTIC_RESET
 
     //! Topology exclusion interaction bits per warp
     unsigned int pair[c_nbnxnGpuExclSize];
index 482ba62f59832bdf05de75d363c8756668c30c72..0ec97a877cd36ced66847a4d3f98229c446c88bd 100644 (file)
@@ -560,7 +560,7 @@ void OptionStorageTemplate<T>::commitValues()
     {
         store_->append(value);
     }
-    DIAGNOSTIC_RESET;
+    CLANG_DIAGNOSTIC_RESET;
     clearSet();
 }
 
index 78b34060afbcdd20b27c665d58b4ae826f8f0ca3..349092cc80bd74581d20293ae4747a12f21ffc07 100644 (file)
@@ -54,6 +54,7 @@ else()
     gmx_target_warning_suppression(scanner -Wno-unused HAS_NO_UNUSED)
     gmx_target_warning_suppression(scanner -Wno-unused-parameter HAS_NO_UNUSED_PARAMETER)
     gmx_target_warning_suppression(scanner -Wno-missing-declarations HAS_NO_MISSING_DECLARATIONS)
+    gmx_target_warning_suppression(scanner -Wno-null-conversion HAS_NO_NULL_CONVERSIONS)
     gmx_target_warning_suppression(scanner -wd1419 HAS_DECL_IN_SOURCE)
 endif()
 list(APPEND libgromacs_object_library_dependencies scanner)
index b514aa0f94d3f015c1241eedabce48b6bcc1dccb..76ecda428577cb6c48008a0afd807710ddeca708 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019,2020, 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.
@@ -49,8 +49,9 @@ namespace gmx
 class SimdFIBool
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdFIBool() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdFIBool(bool b) : simdInternal_(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0)) {}
 
     // Internal utility constructor to simplify return statements
index fbdbf9819e214eca5ed6aa373a04944f618b9fca..9969e03e1d8fccd0115052ae603d8adc5402797c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019,2020, 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.
@@ -49,7 +49,9 @@ namespace gmx
 class Simd4Double
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     Simd4Double() {}
+    MSVC_DIAGNOSTIC_RESET
 
     Simd4Double(double d) : simdInternal_(_mm256_set1_pd(d)) {}
 
@@ -62,7 +64,9 @@ public:
 class Simd4DBool
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     Simd4DBool() {}
+    MSVC_DIAGNOSTIC_RESET
 
     //! \brief Construct from scalar bool
     Simd4DBool(bool b) : simdInternal_(_mm256_castsi256_pd(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0)))
index f3b3a776d7558a776209b726429fcef8ec8fb4e2..e1b902794864c4313af9f56f3b57df8f64fc6567 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019,2020, 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.
@@ -49,8 +49,9 @@ namespace gmx
 class Simd4Float
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     Simd4Float() {}
-
+    MSVC_DIAGNOSTIC_RESET
     Simd4Float(float f) : simdInternal_(_mm_set1_ps(f)) {}
 
     // Internal utility constructor to simplify return statements
@@ -62,8 +63,9 @@ public:
 class Simd4FBool
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     Simd4FBool() {}
-
+    MSVC_DIAGNOSTIC_RESET
     //! \brief Construct from scalar bool
     Simd4FBool(bool b) : simdInternal_(_mm_castsi128_ps(_mm_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
 
index d6feeba60bb20e32d3233a34ea025b272ee37e11..e0984d0d05d4fc2ee0d2506ee2db05fa6cceb1a1 100644 (file)
@@ -56,8 +56,9 @@ namespace gmx
 class SimdDouble
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdDouble() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdDouble(double d) : simdInternal_(_mm256_set1_pd(d)) {}
 
     // Internal utility constructor to simplify return statements
@@ -69,8 +70,9 @@ public:
 class SimdDInt32
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdDInt32() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdDInt32(std::int32_t i) : simdInternal_(_mm_set1_epi32(i)) {}
 
     // Internal utility constructor to simplify return statements
@@ -82,8 +84,9 @@ public:
 class SimdDBool
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdDBool() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdDBool(bool b) : simdInternal_(_mm256_castsi256_pd(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
 
     // Internal utility constructor to simplify return statements
@@ -95,8 +98,9 @@ public:
 class SimdDIBool
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdDIBool() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdDIBool(bool b) : simdInternal_(_mm_set1_epi32(b ? 0xFFFFFFFF : 0)) {}
 
     // Internal utility constructor to simplify return statements
index 76c42d2331c0e3df7f3b638efc85dcc7c73dcae1..7f219d9937fc967e07ab5e4f45ed4fda6f6cad92 100644 (file)
@@ -53,8 +53,9 @@ namespace gmx
 class SimdFloat
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdFloat() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdFloat(float f) : simdInternal_(_mm256_set1_ps(f)) {}
 
     // Internal utility constructor to simplify return statements
@@ -66,8 +67,9 @@ public:
 class SimdFInt32
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdFInt32() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdFInt32(std::int32_t i) : simdInternal_(_mm256_set1_epi32(i)) {}
 
     // Internal utility constructor to simplify return statements
@@ -79,8 +81,9 @@ public:
 class SimdFBool
 {
 public:
+    MSVC_DIAGNOSTIC_IGNORE(26495) // simdInternal_ is not being initialized!
     SimdFBool() {}
-
+    MSVC_DIAGNOSTIC_RESET
     SimdFBool(bool b) : simdInternal_(_mm256_castsi256_ps(_mm256_set1_epi32(b ? 0xFFFFFFFF : 0))) {}
 
     // Internal utility constructor to simplify return statements
index ffc5a6cce53defd72424d3cdba1c6bd20aa8f741..537046645a9b2080ae4024bfc6dcadb9e7e794c4 100644 (file)
@@ -79,6 +79,7 @@
 #include <array>
 #include <type_traits>
 
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/real.h"
 
index 48d825f282aa0ed4752f24cef1ef65df7f919cd2..bdcde8beb18ea8cc4512930edf7fb42a09915f6b 100644 (file)
@@ -138,7 +138,7 @@ void reportGpuUsage(const MDLogger&                   mdlog,
         output += gmx::formatString(
                 "PP tasks will do (non-perturbed) short-ranged%s interactions on the GPU\n",
                 useGpuForBonded ? " and most bonded" : "");
-        output += gmx::formatString("PP task will update and constrain coordinates on the %s",
+        output += gmx::formatString("PP task will update and constrain coordinates on the %s\n",
                                     useGpuForUpdate ? "GPU" : "CPU");
         if (pmeRunMode == PmeRunMode::Mixed)
         {
index fe0a30a56a15661f993bb13d56e711c90b85925a..10fee47a24b40f31275487be8f752c85de506af9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019,2020, 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.
@@ -67,7 +67,10 @@ public:
     int numBlocks() const { return static_cast<int>(index_.size()) - 1; }
 
     /*! \brief Returns the size of the block with index \p blockIndex */
-    Block block(int blockIndex) const { return Block(index_[blockIndex], index_[blockIndex + 1]); }
+    Block block(int blockIndex) const
+    {
+        return Block(index_[blockIndex], index_[blockIndex + 1LL]);
+    }
 
     /*! \brief Returns the full range */
     Block fullRange() const { return Block(index_.front(), index_.back()); }
@@ -101,7 +104,7 @@ public:
     void reduceNumBlocks(int newNumBlocks)
     {
         GMX_ASSERT(newNumBlocks <= numBlocks(), "Can only shrink to fewer blocks");
-        index_.resize(newNumBlocks + 1);
+        index_.resize(newNumBlocks + 1LL);
     }
 
     /*! \brief Sets the partitioning to \p numBlocks blocks each of size 1 */
index aa7b5f5dbc8dd2e912f85031ce7f302dfff0e652..a6a83112cac309de11cc7b6f78658b3e18180248 100644 (file)
@@ -152,12 +152,22 @@ index ssize(const T& t)
 #    define DO_PRAGMA(x) _Pragma(#    x)
 #    define CLANG_DIAGNOSTIC_IGNORE(warning) \
         _Pragma("clang diagnostic push") DO_PRAGMA(clang diagnostic ignored #warning)
-#    define DIAGNOSTIC_RESET _Pragma("clang diagnostic pop")
+#    define CLANG_DIAGNOSTIC_RESET _Pragma("clang diagnostic pop")
 #else
-//! Ignore specified clang warning until DIAGNOSTIC_RESET
+//! Ignore specified clang warning until CLANG_DIAGNOSTIC_RESET
 #    define CLANG_DIAGNOSTIC_IGNORE(warning)
 //! Reset all diagnostics to default
-#    define DIAGNOSTIC_RESET
+#    define CLANG_DIAGNOSTIC_RESET
+#endif
+
+#ifdef _MSC_VER
+#    define MSVC_DIAGNOSTIC_IGNORE(id) __pragma(warning(push)) __pragma(warning(disable : id))
+#    define MSVC_DIAGNOSTIC_RESET __pragma(warning(pop))
+#else
+//! Ignore specified MSVC warning until MSVC_DIAGNOSTIC_RESET
+#    define MSVC_DIAGNOSTIC_IGNORE(warning)
+//! Reset all diagnostics to default
+#    define MSVC_DIAGNOSTIC_RESET
 #endif
 
 namespace gmx
index e081ed4b5e2d76baa2ff3777d767eb4ee8e399a7..a81e582b02fedaa80c1ca53ba36cc013feab6065 100644 (file)
@@ -296,9 +296,11 @@ void gmx_print_version_info(gmx::TextWriter* writer)
      * them. Can wait for later, as the master branch has ready code to do all
      * that. */
     writer->writeLine(formatString("C compiler:         %s", BUILD_C_COMPILER));
-    writer->writeLine(formatString("C compiler flags:   %s", BUILD_CFLAGS));
+    writer->writeLine(formatString("C compiler flags:   %s %s", BUILD_CFLAGS,
+                                   CMAKE_BUILD_CONFIGURATION_C_FLAGS));
     writer->writeLine(formatString("C++ compiler:       %s", BUILD_CXX_COMPILER));
-    writer->writeLine(formatString("C++ compiler flags: %s", BUILD_CXXFLAGS));
+    writer->writeLine(formatString("C++ compiler flags: %s %s", BUILD_CXXFLAGS,
+                                   CMAKE_BUILD_CONFIGURATION_CXX_FLAGS));
 #ifdef HAVE_LIBMKL
     /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
     writer->writeLine(formatString("Linked with Intel MKL version %d.%d.%d.", __INTEL_MKL__,
@@ -311,7 +313,8 @@ void gmx_print_version_info(gmx::TextWriter* writer)
 #endif
 #if GMX_GPU == GMX_GPU_CUDA
     writer->writeLine(formatString("CUDA compiler:      %s", CUDA_COMPILER_INFO));
-    writer->writeLine(formatString("CUDA compiler flags:%s", CUDA_COMPILER_FLAGS));
+    writer->writeLine(formatString("CUDA compiler flags:%s %s", CUDA_COMPILER_FLAGS,
+                                   CMAKE_BUILD_CONFIGURATION_CXX_FLAGS));
     writer->writeLine("CUDA driver:        " + gmx::getCudaDriverVersionString());
     writer->writeLine("CUDA runtime:       " + gmx::getCudaRuntimeVersionString());
 #endif
index 9f7da6257d29fe71765529e54c46c3c15522a247..9d27cc96ac576972f4c90dba2c293503ae9d22d4 100644 (file)
@@ -42,6 +42,8 @@
 
 #include "gromacs/utility/enumerationhelpers.h"
 
+#include "config.h"
+
 #include <iostream>
 
 #include <gtest/gtest.h>
index ab7cc8798f04c283d435349198830bcaeef0314f..7149eee08b3d87a291fdd7143e6900c34bcc08a2 100644 (file)
@@ -42,6 +42,8 @@
  */
 #include "gmxpre.h"
 
+#include "config.h"
+
 #include <string>
 
 #include <gmock/gmock.h>
index d0f77c29137d6a05336fc04c9a529614778b100f..6ac9aacbe4b3fd66d4194c9e64a9cdf82e4aa526 100644 (file)
@@ -74,7 +74,7 @@ target_link_libraries(testutils PRIVATE libgromacs ${GMX_COMMON_LIBRARIES} gmock
 
 if(HAVE_TINYXML2)
     include_directories(SYSTEM ${TinyXML2_INCLUDE_DIR})
-    target_link_libraries(testutils ${TinyXML2_LIBRARIES})
+    target_link_libraries(testutils PRIVATE ${TinyXML2_LIBRARIES})
 else()
     include_directories(BEFORE SYSTEM "../external/tinyxml2")
 endif()
index c17ce34641794eb71f4aa37eb87bc2122674eecf..d668cb5d9c92e091fea6daa099d8cf130aee9de1 100644 (file)
@@ -169,6 +169,12 @@ function (gmx_add_gtest_executable EXENAME)
         if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7")
             target_compile_options(${EXENAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Weverything ${IGNORED_CLANG_ALL_WARNINGS} -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-as-null-pointer-constant -Wno-missing-variable-declarations>)
         endif()
+        # clang-3.6 warns about a number of issues that are not reported by more modern compilers
+        # and we know they are not real issues. So we only check that it can compile without error
+        # but ignore all warnings.
+        if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION MATCHES "^3\.6")
+            target_compile_options(${EXENAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-w>)
+        endif()
     endif()
 endfunction()