Merge "Fixing handling of perturbation mass changes." into release-4-6
authorSander Pronk <sndr.sndr@gmail.com>
Fri, 10 May 2013 13:17:11 +0000 (15:17 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 10 May 2013 13:17:11 +0000 (15:17 +0200)
51 files changed:
CMakeLists.txt
COPYING
README
admin/gromacs-mpi.spec
admin/gromacs.spec
admin/installguide/installguide.tex
cmake/FindFFTW.cmake
cmake/FindMKL.cmake [deleted file]
cmake/FindVMD.cmake
cmake/TestMKL.c [deleted file]
include/domdec.h
include/gmx_simd_macros.h
include/gmx_system_xdr.h
include/pme.h
share/template/template.c
share/template/template_doc.c
src/contrib/BuildMdrunOpenMM.cmake
src/contrib/CMakeLists.txt
src/contrib/mdrun_openmm.c
src/contrib/openmm_wrapper.cpp
src/gmxlib/bondfree.c
src/gmxlib/copyrite.c
src/gmxlib/gmx_blas/blas_copyright
src/gmxlib/gmx_lapack/lapack_copyright
src/gmxlib/gmx_system_xdr.c
src/gmxlib/topsort.c
src/gmxlib/trxio.c
src/kernel/CMakeLists.txt
src/kernel/pme_loadbal.c
src/mdlib/domdec.c
src/mdlib/nbnxn_atomdata.c
src/mdlib/nbnxn_internal.h
src/mdlib/pme.c
src/mdlib/sim_util.c
src/ngmx/alert.bm
src/ngmx/ff.bm
src/ngmx/gromacs.bm
src/ngmx/info.bm
src/ngmx/play.bm
src/ngmx/rama.bm
src/ngmx/rewind.bm
src/ngmx/stop.bm
src/ngmx/stop_ani.bm
src/tools/gmx_anadock.c
src/tools/gmx_do_dssp.c
src/tools/gmx_hydorder.c
src/tools/gmx_make_edi.c
src/tools/gmx_make_ndx.c
src/tools/gmx_mk_angndx.c
src/tools/gmx_sigeps.c
src/tools/make_edi.c

index df12172a9a74370c7bfcaa51507c9db3d1b19a74..187fc992ab07a1bccb6afdbe2257621a1fcd9544 100644 (file)
@@ -153,7 +153,7 @@ mark_as_advanced(GMX_FORCE_CXX)
 option(GMX_COOL_QUOTES "Enable Gromacs cool quotes" ON)
 mark_as_advanced(GMX_COOL_QUOTES)
 
-if(GMX_GPU OR GMX_FORCE_CXX)
+if(GMX_GPU OR GMX_FORCE_CXX OR GMX_OPENMM)
     enable_language(CXX)
 endif()
 set(CMAKE_PREFIX_PATH "" CACHE STRING "Extra locations to search for external libraries and tools (give directory without lib, bin, or include)")
@@ -901,6 +901,11 @@ endif(${GMX_QMMM_PROGRAM} STREQUAL "GAUSSIAN")
 string(TOUPPER ${GMX_FFT_LIBRARY} GMX_FFT_LIBRARY)
 set(PKG_FFT "")
 set(PKG_FFT_LIBS "")
+set(MKL_LIBRARIES_FORMAT_DESCRIPTION "Use full paths to library files, in the right order, and separated by semicolons.")
+set(MKL_LIBRARIES "" CACHE STRING "List of libraries for linking to MKL. Only used with GMX_FFT_LIBRARY=mkl. ${MKL_LIBRARIES_FORMAT_DESCRIPTION}")
+set(MKL_INCLUDE_DIR "" CACHE PATH "Path to mkl.h (non-inclusive). Only used with GMX_FFT_LIBRARY=mkl.")
+mark_as_advanced(FORCE MKL_LIBRARIES)
+mark_as_advanced(FORCE MKL_INCLUDE_DIR)
 if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
     if(GMX_DOUBLE)
         set(FFTW fftw)
@@ -934,14 +939,58 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
     endif()
 
 elseif(${GMX_FFT_LIBRARY} STREQUAL "MKL")
-#    MESSAGE(STATUS "Using external FFT library - Intel MKL")
-    find_package(MKL REQUIRED)
-    include_directories(${MKL_INCLUDE_DIR})
-    set(FFT_LIBRARIES ${MKL_LIBRARIES})
-    set(PKG_FFT_LIBS ${MKL_LIBRARIES})
+    MESSAGE(STATUS "Using external FFT library - Intel MKL")
+
+    # Intel 11 and up makes life somewhat easy if you just want to use
+    # all their stuff. It's not easy if you only want some of their
+    # stuff...
+    if (CMAKE_C_COMPILER_ID MATCHES "Intel" AND C_COMPILER_VERSION VERSION_GREATER "11")
+        # The next line takes care of everything for MKL
+        if (WIN32)
+            set(FFT_LINKER_FLAGS "/Qmkl=sequential")
+        else()
+            set(FFT_LINKER_FLAGS "-mkl=sequential")
+        endif()
+        set(MKL_ERROR_MESSAGE "Make sure you have configured your compiler so that ${FFT_LINKER_FLAGS} will work.")
+    else()
+        # The user will have to provide the set of magic libraries in
+        # MKL_LIBRARIES, which we cache (non-advanced), so that they
+        # don't have to keep specifying it, and can easily see that
+        # CMake is still using that information.
+        set(MKL_LIBRARIES "${MKL_LIBRARIES}" CACHE STRING "User-specified libraries for linking to MKL")
+        mark_as_advanced(CLEAR MKL_LIBRARIES)
+        include_directories(${MKL_INCLUDE_DIR})
+        mark_as_advanced(CLEAR MKL_INCLUDE_DIR)
+        set(FFT_LIBRARIES "${MKL_LIBRARIES}")
+        set(MKL_ERROR_MESSAGE "The include path to mkl.h in MKL_INCLUDE_DIR, and the link libraries in MKL_LIBRARIES=${MKL_LIBRARIES} need to match what the MKL documentation says you need for your system. ${MKL_LIBRARIES_FORMAT_DESCRIPTION}")
+        # Convert the semi-colon separated list to a list of
+        # command-line linker arguments so that code using our
+        # pkgconfig setup can use it.
+        string(REGEX REPLACE ";" " " PKG_FFT_LIBS "${MKL_LIBRARIES}")
+    endif()
+
+    # Check MKL works. If we were in a non-global scope, we wouldn't
+    # have to play nicely.
+    set(old_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+    set(CMAKE_REQUIRED_FLAGS "${FFT_LINKER_FLAGS}")
+    set(old_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+    set(CMAKE_REQUIRED_LIBRARIES "${FFT_LIBRARIES}")
+
+    check_function_exists(DftiCreateDescriptor TEST_MKL)
+
+    set(CMAKE_REQUIRED_FLAGS "${old_CMAKE_REQUIRED_FLAGS}")
+    set(CMAKE_REQUIRED_LIBRARIES "${old_CMAKE_REQUIRED_LIBRARIES}")
+
+    if(NOT TEST_MKL)
+        # Hack to help the user vary MKL settings until they work.
+        # TODO Make this logic more useful.
+        unset(TEST_MKL CACHE)
+        message(FATAL_ERROR "Linking with MKL was requested, but was not successful. ${MKL_ERROR_MESSAGE}")
+    endif()
 
+    # Set variables to signal that we have MKL available and should use it for FFTs.
     set(GMX_FFT_MKL 1)
-    set(HAVE_MKL 1)
+    set(HAVE_LIBMKL 1)
 
 #elseif(${GMX_FFT_LIBRARY} STREQUAL "ACML")
 #    MESSAGE(STATUS "Using external FFT library - AMD core math library")
@@ -961,7 +1010,7 @@ endif()
 set(GMX_EXTERNAL_BLAS TRUE CACHE BOOL "Use external BLAS instead of built-in")
 set(GMX_EXTERNAL_LAPACK TRUE CACHE BOOL "Use external LAPACK instead of built-in")
 # MKL has BLAS/LAPACK routines
-if(NOT HAVE_MKL AND NOT ACCELERATE_FRAMEWORK)
+if(NOT HAVE_LIBMKL AND NOT ACCELERATE_FRAMEWORK)
   if(GMX_EXTERNAL_BLAS)
     if (GMX_BLAS_USER)
         list(APPEND GMX_EXTRA_LIBRARIES ${GMX_BLAS_USER})
@@ -1056,7 +1105,7 @@ endif(GMX_FAHCORE)
 if (NOT GMX_SKIP_DEFAULT_CFLAGS)
     set(CMAKE_C_FLAGS "${ACCELERATION_C_FLAGS} ${MPI_COMPILE_FLAGS} ${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "${ACCELERATION_CXX_FLAGS} ${MPI_COMPILE_FLAGS} ${CMAKE_CXX_FLAGS}")
-    set(CMAKE_EXE_LINKER_FLAGS "${MPI_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
+    set(CMAKE_EXE_LINKER_FLAGS "${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
     set(CMAKE_SHARED_LINKER_FLAGS "${MPI_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
 else()
     message("Recommended flags which are not added because GMX_SKIP_DEFAULT_CFLAGS=yes:")
@@ -1068,7 +1117,7 @@ else()
         message("CMAKE_CXX_FLAGS_RELEASE: ${GMXC_CXXFLAGS_RELEASE}")
         message("CMAKE_CXX_FLAGS_DEBUG: ${GMXC_CXXFLAGS_DEBUG}")
     endif()
-    message("CMAKE_EXE_LINKER_FLAGS: ${MPI_LINKER_FLAGS}")
+    message("CMAKE_EXE_LINKER_FLAGS: ${FFT_LINKER_FLAGS} ${MPI_LINKER_FLAGS}")
     message("CMAKE_SHARED_LINKER_FLAGS: ${MPI_LINKER_FLAGS}")
 endif()
 
diff --git a/COPYING b/COPYING
index 43c15989e4edd30cb685f8b5500ae209203c93e2..58175ae4b97521cc13378d4217763ff714482cb1 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1038,7 +1038,7 @@ BLAS does not come with a formal named "license", but a general statement that
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is GPL, we think it's only fair to give you the same rights to
+While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
 our modified BLAS files as the original netlib versions, so do what you want with them.
 However, be warned that we have only tested that they to the right thing in the cases used
 in Gromacs (primarily full & sparse matrix diagonalization), so in most cases it is a much
@@ -1062,7 +1062,7 @@ LAPACK does not come with a formal named "license", but a general statement sayi
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is GPL, we think it's only fair to give you the same rights to
+While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
 our modified LAPACK files as the original netlib versions, so do what you want with them.
 
 However, be warned that we have only tested that they to the right thing in the cases used
diff --git a/README b/README
index 84e5347fa88851ba3539f5ceaa21c6efff09626a..b09fdc4b58d1015443f8cee4a89836db5319ef7f 100644 (file)
--- a/README
+++ b/README
@@ -17,13 +17,14 @@ out http://www.gromacs.org/Developer_Zone.
 
                                * * * * *
 
-GROMACS is free software, distributed under the GNU General Public License. 
-However, scientific software is a little special compared to most other 
-programs. Both you, we, and all other GROMACS users depend on the quality
-of the code, and when we find bugs (every piece of software has them) it
-is crucial that we can correct it and say that it was fixed in version X of 
-the file or package release. For the same reason, it is important that you
-can reproduce other people's result from a certain GROMACS version. 
+GROMACS is free software, distributed under the GNU Lesser General
+Public License, version 2.1 However, scientific software is a little
+special compared to most other programs. Both you, we, and all other
+GROMACS users depend on the quality of the code, and when we find bugs
+(every piece of software has them) it is crucial that we can correct
+it and say that it was fixed in version X of the file or package
+release. For the same reason, it is important that you can reproduce
+other people's result from a certain GROMACS version.
 
 The easiest way to avoid this kind of problems is to get your modifications
 included in the main distribution. We'll be happy to consider any decent 
index dafcb22ba0df5838b5257857430007ee8b4574c9..2bcb73bd4e30aa428d41e39421e069953a5b44fb 100644 (file)
@@ -9,7 +9,7 @@ Summary: Molecular dynamics package (parallel)
 Name: gromacs-mpi
 Version: 4.5
 Release: 1
-Copyright: GPL
+Copyright: LGPLv2.1
 Group: Applications/Science
 Prefix: /usr/local
 Buildroot: %{_topdir}/buildroot
index 24681975c3faa6b5482a6a15536cdb9d75ac6367..f1521fb5fbf71c06ce708bd0fd2efbec9cb44df4 100644 (file)
@@ -3,7 +3,7 @@ Version:        4.5
 Release:       7%{?dist}
 Summary:       GROMACS binaries
 Group:         Applications/Engineering
-License:       GPLv2+
+License:       LGPLv2.1
 URL:           http://www.gromacs.org
 Source0:       ftp://ftp.gromacs.org/pub/gromacs/gromacs-%{version}.tar.gz
 Source1:       ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf
index cb7e272b998dc4fb7cfcb1c63c287361621503ce..3f3bd4d060e22b4c8cb3170fabbf86f9d5dd811b 100644 (file)
@@ -148,13 +148,13 @@ capability 2.0 are required, e.g. Fermi or Kepler cards.
 The GPU support from \gromacs{} version 4.5 using \openmm{}
 \url{https://simtk.org/home/openmm} is still contained in the code,
 but in the ``user contributions'' section (\verb+src/contrib+). You
-will need to edit \verb+src/contrib/CMakeLists.txt+ to enable it. It
-also requires \cuda{}, and remains the only hardware-based
-acceleration available for implicit solvent simulations in
-\gromacs{} at the moment. However, the long-term plan is to enable 
-this functionality in core Gromacs, and not have the OpenMM
-interface supported by the \gromacs team. Right now there are
-some build issues for OpenMM.
+will need to set
+\verb+-DGMX_OPENMM=on -DGMX_GPU=off -DGMX_MPI=off
+-DGMX_THREAD_MPI=off\+ in order to build it. It also requires \cuda{},
+and remains the only hardware-based acceleration available for
+implicit solvent simulations in \gromacs{} at the moment. However, the
+long-term plan is to enable this functionality in core Gromacs, and
+not have the OpenMM interface supported by the \gromacs team.
 
 If you wish to run in parallel on multiple machines across a network,
 you will need to have
@@ -255,11 +255,19 @@ support has been compiled into \fftw{}, so you need to set this at compile time.
 
 \subsubsection{\mkl{}}
 
-Using \mkl{} requires a set of linker flags that \gromacs{} is not
-able to detect for you, so setting up optimal linking is tricky at the
-moment. You will need to consult your compiler documentation and
-use \verb+CMAKE_C_FLAGS+ and \verb+-DCMAKE_EXE_LINKER_FLAGS+
-accordingly.
+Using \mkl{} with \icc{} 11 or higher is very simple. Set up your
+compiler environment correctly, perhaps with a command like
+\verb+source /path/to/compilervars.sh intel64+ (or consult your local
+documentation). Then set \verb+-DGMX_FFT_LIBRARY=mkl+ when you run
+\cmake{}. In this case, \gromacs{} will also use \mkl{} for \blas{}
+and \lapack{} (see \hyperref{linear-algebra}{here}).
+
+Otherwise, you can configure \mkl{} by setting
+\verb+-DGMX_FFT_LIBRARY=mkl
+-DMKL_LIBRARIES="/full/path/to/libone.so;/full/path/to/libtwo.so"
+-DMKL_INCLUDE_DIR="/full/path/to/mkl/include"+,
+where the full list (and order!) of libraries you require are found in
+Intel's \mkl{} documentation for your system.
 
 \subsection{Optional build components}
 
@@ -437,6 +445,9 @@ back on internal versions provided in the \gromacs{} source. These are
 fine for normal use. If you need to specify a non-standard path to
 search, use \verb+-DCMAKE_PREFIX_PATH=/path/to/search+.
 
+If you are using Intel's \mkl{} for \fft{}, then the \blas{} and
+\lapack{} it provides are used automatically.
+
 On Apple platforms where the Accelerate Framework is available, these
 will be automatically used for \blas{} and \lapack{}.
 
index 63957fb19ea0e2e9147c28bbd74d03adcbf1bbe9..78b726c58b4e0886d3db1aee1bf0e14486ff911a 100644 (file)
 #
 #  This file is part of Gromacs        Copyright (c) 2012
 
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-
-#  To help us fund GROMACS development, we humbly ask that you cite
-#  the research papers on the package. Check out http://www.gromacs.org
-
 list(LENGTH FFTW_FIND_COMPONENTS FFTW_NUM_COMPONENTS_WANTED)
 if(${FFTW_NUM_COMPONENTS_WANTED} LESS 1)
   message(FATAL_ERROR "No FFTW component to search given")
diff --git a/cmake/FindMKL.cmake b/cmake/FindMKL.cmake
deleted file mode 100644 (file)
index f240bbc..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2012,2013, by the GROMACS development team, led by
-# David van der Spoel, Berk Hess, Erik Lindahl, and including many
-# others, as listed in the AUTHORS file in the top-level source
-# directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-#
-# - Find Intel MKL
-# Find the Intel Math Kernel Library, version 6.0 or later
-#
-#  MKL_INCLUDE_DIR - where to find mkl_dfti.h
-#  MKL_LIBRARIES   - List of libraries when using MKL
-#  MKL_FOUND       - True if MKL was found
-
-if (MKL_INCLUDE_DIR)
-  # Already in cache, be silent
-  set (MKL_FIND_QUIETLY TRUE)
-endif (MKL_INCLUDE_DIR)
-
-find_path (MKL_INCLUDE_DIR mkl_dfti.h)
-find_library (MKL_LIBRARIES mkl_core)
-
-# handle the QUIETLY and REQUIRED arguments and set MKL_FOUND to TRUE if
-# all listed variables are TRUE
-include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (MKL DEFAULT_MSG MKL_LIBRARIES MKL_INCLUDE_DIR)
-
-# MKL Libraries change name ALL the time, so the user will have to set these...
-# mark_as_advanced (MKL_LIBRARIES MKL_INCLUDE_DIR)
-
-
index ecf5f23b46d820118d33e0034ccdd37c32d805e1..5c0e186d27bfcd6665875c09f606b5825aec72ef 100644 (file)
 #  This file is part of Gromacs        Copyright (c) 1991-2008
 #  David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
 
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-
-#  To help us fund GROMACS development, we humbly ask that you cite
-#  the research papers on the package. Check out http://www.gromacs.org
-
-
 # The module defines the following variables:
 #   VMD_EXECUTABLE - path to vmd command
 #   GMX_VMD_PLUGIN_PATH - path to vmd plugins
diff --git a/cmake/TestMKL.c b/cmake/TestMKL.c
deleted file mode 100644 (file)
index 0998363..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <mkl_dfti.h>
-
-int
-main()
-{
-  DFTI_DESCRIPTOR *desc;
-  MKL_LONG nx = 10;
-
-  DftiCreateDescriptor(&desc,DFTI_SINGLE,DFTI_COMPLEX,1,nx);
-}
index eff1f302393602e92b053a3f09c6d9363d848937..19a3a78e44baa17c9d0da7f4101e17526f3660f0 100644 (file)
@@ -79,6 +79,11 @@ real dd_cutoff_mbody(gmx_domdec_t *dd);
 
 real dd_cutoff_twobody(gmx_domdec_t *dd);
 
+GMX_LIBMD_EXPORT
+void get_pme_nnodes(const gmx_domdec_t *dd,
+                    int *npmenodes_x, int *npmenodes_y);
+/* Get the number of PME nodes along x and y, can be called with dd=NULL */
+
 gmx_bool gmx_pmeonlynode(t_commrec *cr, int nodeid);
 /* Return if nodeid in cr->mpi_comm_mysim is a PME-only node */
 
index ca18c240366bc5f5bfc9f604f0ddbaeace8b2dc7..d64e43d3e94da5bf9100fd2da84257b63fe16f83 100644 (file)
 #undef gmx_add_pr
 #undef gmx_sub_pr
 #undef gmx_mul_pr
+/* For the FMA macros below, aim for c=d in code, so FMA3 uses 1 instruction */
+/* d = gmx_madd_pr(a,b,c): d = a*b + c, could use FMA3 or FMA4 */
+#undef gmx_madd_pr
+/* d = gmx_nmsub_pr(a,b,c): d = -a*b + c, could use FMA3 or FMA4 */
+#undef gmx_nmsub_pr
 #undef gmx_max_pr
 #undef gmx_cmplt_pr
 /* gmx_blendzero_pr(real a, boolean b) does: (b ? a : 0) */
 #undef gmx_or_pr
 #undef gmx_andnot_pr
 
+/* Only used for PBC in bonded interactions, can be avoided */
+#undef gmx_round_pr
 /* Not required, only used to speed up the nbnxn tabulated PME kernels */
 #undef GMX_HAVE_SIMD_FLOOR
 #undef gmx_floor_pr
-/* Not required, only used with when blendv is faster than comparison */
+
+/* Not required, only used when blendv is faster than comparison */
 #undef GMX_HAVE_SIMD_BLENDV
 #undef gmx_blendv_pr
 /* Not required, gmx_anytrue(x) returns if any of the boolean is x is True.
 #undef gmx_cvtepi32_pr
 
 #undef gmx_invsqrt_pr
+/* sqrt+inv+sin+cos+acos+atan2 are only used for bonded potentials */
+#undef gmx_sqrt_pr
+#undef gmx_inv_pr
+#undef gmx_sincos_pr
+#undef gmx_acos_pr
+#undef gmx_atan_pr
+
 #undef gmx_calc_rsq_pr
 #undef gmx_sum4_pr
 
 #undef gmx_pmecorrV_pr
 
 
-/* The same SIMD macros, can be translated to SIMD intrinsics, and compiled
- * to instructions for, different SIMD width and float precision.
- * On x86, the gmx_ prefix is replaced by _mm_ or _mm256_ (SSE or AVX).
- * The _pr suffix is replaced by _ps or _pd (single or double precision).
- * Note that compiler settings will decide if 128-bit intrinsics will
+/* Half SIMD-width types and operations only for nbnxn 2xnn search+kernels */
+#undef gmx_mm_hpr
+
+#undef gmx_load_hpr
+#undef gmx_load1_hpr
+#undef gmx_store_hpr
+#undef gmx_add_hpr
+#undef gmx_sub_hpr
+
+#undef gmx_sum4_hpr
+
+#undef gmx_2hpr_to_pr
+
+
+/* The same SIMD macros can be translated to SIMD intrinsics (and compiled
+ * to instructions for) different SIMD width and float precision.
+ *
+ * On x86: The gmx_ prefix is replaced by _mm_ or _mm256_ (SSE or AVX).
+ * The _pr suffix is replaced by _ps or _pd (for single or double precision).
+ * Compiler settings will decide if 128-bit intrinsics will
  * be translated into SSE or AVX instructions.
  */
 
 #define gmx_add_pr        _mm_add_ps
 #define gmx_sub_pr        _mm_sub_ps
 #define gmx_mul_pr        _mm_mul_ps
+#ifdef GMX_X86_AVX_128_FMA
+#define gmx_madd_pr(a, b, c)   _mm_macc_ps(a, b, c)
+#define gmx_nmsub_pr(a, b, c)  _mm_nmacc_ps(a, b, c)
+#else
+#define gmx_madd_pr(a, b, c)   _mm_add_ps(c, _mm_mul_ps(a, b))
+#define gmx_nmsub_pr(a, b, c)  _mm_sub_ps(c, _mm_mul_ps(a, b))
+#endif
 #define gmx_max_pr        _mm_max_ps
 #define gmx_cmplt_pr      _mm_cmplt_ps
 #define gmx_blendzero_pr  _mm_and_ps
 #define gmx_andnot_pr     _mm_andnot_ps
 
 #ifdef GMX_X86_SSE4_1
+#define gmx_round_pr(x)   _mm_round_ps(x, 0x0)
 #define GMX_HAVE_SIMD_FLOOR
 #define gmx_floor_pr      _mm_floor_ps
+#else
+#define gmx_round_pr(x)   _mm_cvtepi32_ps(_mm_cvtps_epi32(x))
+#endif
+
+#ifdef GMX_X86_SSE4_1
 #define GMX_HAVE_SIMD_BLENDV
 #define gmx_blendv_pr     _mm_blendv_ps
 #endif
 #define gmx_cvtepi32_pr   _mm_cvtepi32_ps
 
 #define gmx_invsqrt_pr    gmx_mm_invsqrt_ps
+#define gmx_sqrt_pr       gmx_mm_sqrt_ps
+#define gmx_inv_pr        gmx_mm_inv_ps
+#define gmx_sincos_pr     gmx_mm_sincos_ps
+#define gmx_acos_pr       gmx_mm_acos_ps
+#define gmx_atan2_pr      gmx_mm_atan2_ps
+
 #define gmx_calc_rsq_pr   gmx_mm_calc_rsq_ps
 #define gmx_sum4_pr       gmx_mm_sum4_ps
 
 #define gmx_add_pr        _mm_add_pd
 #define gmx_sub_pr        _mm_sub_pd
 #define gmx_mul_pr        _mm_mul_pd
+#ifdef GMX_X86_AVX_128_FMA
+#define gmx_madd_pr(a, b, c)   _mm_macc_pd(a, b, c)
+#define gmx_nmsub_pr(a, b, c)  _mm_nmacc_pd(a, b, c)
+#else
+#define gmx_madd_pr(a, b, c)   _mm_add_pd(c, _mm_mul_pd(a, b))
+#define gmx_nmsub_pr(a, b, c)  _mm_sub_pd(c, _mm_mul_pd(a, b))
+#endif
 #define gmx_max_pr        _mm_max_pd
 #define gmx_cmplt_pr      _mm_cmplt_pd
 #define gmx_blendzero_pr  _mm_and_pd
 #define gmx_andnot_pr     _mm_andnot_pd
 
 #ifdef GMX_X86_SSE4_1
+#define gmx_round_pr(x)   _mm_round_pd(x, 0x0)
 #define GMX_HAVE_SIMD_FLOOR
 #define gmx_floor_pr      _mm_floor_pd
+#else
+#define gmx_round_pr(x)   _mm_cvtepi32_pd(_mm_cvtpd_epi32(x))
+/* gmx_floor_pr is not used in code for pre-SSE4_1 hardware */
+#endif
+
+#ifdef GMX_X86_SSE4_1
 #define GMX_HAVE_SIMD_BLENDV
 #define gmx_blendv_pr     _mm_blendv_pd
 #endif
 #define gmx_cvtepi32_pr   _mm_cvtepi32_pd
 
 #define gmx_invsqrt_pr    gmx_mm_invsqrt_pd
+#define gmx_sqrt_pr       gmx_mm_sqrt_pd
+#define gmx_inv_pr        gmx_mm_inv_pd
+#define gmx_sincos_pr     gmx_mm_sincos_pd
+#define gmx_acos_pr       gmx_mm_acos_pd
+#define gmx_atan2_pr      gmx_mm_atan2_pd
+
 #define gmx_calc_rsq_pr   gmx_mm_calc_rsq_pd
 #define gmx_sum4_pr       gmx_mm_sum4_pd
 
 #define gmx_add_pr        _mm256_add_ps
 #define gmx_sub_pr        _mm256_sub_ps
 #define gmx_mul_pr        _mm256_mul_ps
+#define gmx_madd_pr(a, b, c)   _mm256_add_ps(c, _mm256_mul_ps(a, b))
+#define gmx_nmsub_pr(a, b, c)  _mm256_sub_ps(c, _mm256_mul_ps(a, b))
 #define gmx_max_pr        _mm256_max_ps
 /* Less-than (we use ordered, non-signaling, but that's not required) */
 #define gmx_cmplt_pr(x, y) _mm256_cmp_ps(x, y, 0x11)
 #define gmx_or_pr         _mm256_or_ps
 #define gmx_andnot_pr     _mm256_andnot_ps
 
+#define gmx_round_pr(x)   _mm256_round_ps(x, 0x0)
 #define GMX_HAVE_SIMD_FLOOR
 #define gmx_floor_pr      _mm256_floor_ps
+
 #define GMX_HAVE_SIMD_BLENDV
 #define gmx_blendv_pr     _mm256_blendv_ps
 
 #define gmx_cvttpr_epi32  _mm256_cvttps_epi32
 
 #define gmx_invsqrt_pr    gmx_mm256_invsqrt_ps
+#define gmx_sqrt_pr       gmx_mm256_sqrt_ps
+#define gmx_inv_pr        gmx_mm256_inv_ps
+#define gmx_sincos_pr     gmx_mm256_sincos_ps
+#define gmx_acos_pr       gmx_mm256_acos_ps
+#define gmx_atan2_pr      gmx_mm256_atan2_ps
+
 #define gmx_calc_rsq_pr   gmx_mm256_calc_rsq_ps
 #define gmx_sum4_pr       gmx_mm256_sum4_ps
 
 #define gmx_add_pr        _mm256_add_pd
 #define gmx_sub_pr        _mm256_sub_pd
 #define gmx_mul_pr        _mm256_mul_pd
+#define gmx_madd_pr(a, b, c)   _mm256_add_pd(c, _mm256_mul_pd(a, b))
+#define gmx_nmsub_pr(a, b, c)  _mm256_sub_pd(c, _mm256_mul_pd(a, b))
 #define gmx_max_pr        _mm256_max_pd
 /* Less-than (we use ordered, non-signaling, but that's not required) */
 #define gmx_cmplt_pr(x, y) _mm256_cmp_pd(x, y, 0x11)
 #define gmx_or_pr         _mm256_or_pd
 #define gmx_andnot_pr     _mm256_andnot_pd
 
+#define gmx_round_pr(x)   _mm256_round_pd(x, 0x0)
 #define GMX_HAVE_SIMD_FLOOR
 #define gmx_floor_pr      _mm256_floor_pd
+
 #define GMX_HAVE_SIMD_BLENDV
 #define gmx_blendv_pr     _mm256_blendv_pd
 
 #define gmx_cvttpr_epi32  _mm256_cvttpd_epi32
 
 #define gmx_invsqrt_pr    gmx_mm256_invsqrt_pd
+#define gmx_sqrt_pr       gmx_mm256_sqrt_pd
+#define gmx_inv_pr        gmx_mm256_inv_pd
+#define gmx_sincos_pr     gmx_mm256_sincos_pd
+#define gmx_acos_pr       gmx_mm256_acos_pd
+#define gmx_atan2_pr      gmx_mm256_atan2_pd
+
 #define gmx_calc_rsq_pr   gmx_mm256_calc_rsq_pd
 #define gmx_sum4_pr       gmx_mm256_sum4_pd
 
index e08c8db5b38fe35afa2e259473feff5faa13ff0c..9ca8823a612531e4df0065ced67cde6c3f6187e3 100644 (file)
@@ -58,7 +58,7 @@
  * platforms like Microsoft Windows we have created a private version
  * of the necessary routines and distribute them with the Gromacs source.
  *
- * Although the rest of Gromacs is GPL, you can copy and use the XDR
+ * Although the rest of Gromacs is LGPL, you can copy and use the XDR
  * routines in any way you want as long as you obey Sun's license:
  *
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
index 59e5874c532199389c95e46af784d54b69fe8bf1..352118bfdf4ea14c5bfbf2c395b445c32bb6ab5b 100644 (file)
@@ -122,6 +122,23 @@ void gmx_pme_calc_energy(gmx_pme_t pme, int n, rvec *x, real *q, real *V);
 /* Abstract type for PME <-> PP communication */
 typedef struct gmx_pme_pp *gmx_pme_pp_t;
 
+GMX_LIBMD_EXPORT
+void gmx_pme_check_restrictions(int pme_order,
+                                int nkx, int nky, int nkz,
+                                int nnodes_major,
+                                int nnodes_minor,
+                                gmx_bool bUseThreads,
+                                gmx_bool bFatal,
+                                gmx_bool *bValidSettings);
+/* Check restrictions on pme_order and the PME grid nkx,nky,nkz.
+ * With bFatal=TRUE, a fatal error is generated on violation,
+ * bValidSettings=NULL can be passed.
+ * With bFatal=FALSE, *bValidSettings reports the validity of the settings.
+ * bUseThreads tells if any MPI rank doing PME uses more than 1 threads.
+ * If at calling you bUseThreads is unknown, pass TRUE for conservative
+ * checking.
+ */
+
 gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr);
 /* Initialize the PME-only side of the PME <-> PP communication */
 
index decd7dad65657042dc3da4d66a49b15c5ed61f15..69e993ba773d23a1da231a432df1e984ece8a848 100644 (file)
@@ -1,32 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS development team,
+ * Copyright (c) 2001-2009,2010,2012, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #include <gromacs/copyrite.h>
 #include <gromacs/filenm.h>
index c7dd970317561f02ae5dcae59217a91612ed8152..3be1cfdd18511a850e7ee4abd45fd7fa59a1109d 100644 (file)
@@ -1,32 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2009, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * For more info, check our website at http://www.gromacs.org
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 /*! \dir share/template
  * \brief Template code for writing analysis programs.
index bc954d60e7d0de2a43db8978b2c84f4279f3a2ad..097f4b80a197640acce9b9a9bf7fe7939553d363 100644 (file)
@@ -39,14 +39,15 @@ link_directories(${OpenMM_LIBRARY_DIR})
 # if the same OpenMM installation is used for running and building 
 add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" ) 
 file(TO_CMAKE_PATH ${OpenMM_PLUGIN_DIR} _path)
-add_library(openmm_api_wrapper STATIC openmm_wrapper.cpp)
+add_library(openmm_api_wrapper STATIC ${CMAKE_SOURCE_DIR}/src/contrib/openmm_wrapper.cpp)
 target_link_libraries(openmm_api_wrapper ${OpenMM_LIBRARIES})
-list(APPEND GMX_EXTRA_LIBRARIES openmm_api_wrapper ${OpenMM_LIBRARIES})   
 
-list(REMOVE_ITEM MDRUN_SOURCES mdrun.c)
+list(REMOVE_ITEM MDRUN_SOURCES mdrun.c runner.c)
 list(APPEND MDRUN_SOURCES
-    ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/md_openmm.c
-    ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib/mdrun_openmm.c)
+    ${CMAKE_SOURCE_DIR}/src/contrib/md_openmm.c
+    ${CMAKE_SOURCE_DIR}/src/contrib/mdrun_openmm.c
+    ${CMAKE_SOURCE_DIR}/src/contrib/runner_openmm.c
+    )
 
 # this is to circumvent the following MSVC error: 
 # warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs
index 7c5bb8318e9ec881544859774665594cbd43a6b4..1382ee10c18eaa200d3c6c512ccaabb8be711cf7 100644 (file)
@@ -49,9 +49,11 @@ if(GMX_OPENMM)
         message(FATAL_ERROR "The OpenMM build is not compatible with the native GPU build")
     endif()
 
-    enable_language(CXX)
-    set (GMX_BINARY_SUFFIX "-openmm")
-    set (GMX_LIBS_SUFFIX "_openmm")
+    # These won't actually do anything unless they precede the
+    # definition of these options elsewhere. However, they can't be
+    # FORCE-d either.
+    set(GMX_BINARY_SUFFIX "-openmm" CACHE STRING "Suffix to distinguish OpenMM build from normal")
+    set(GMX_LIBS_SUFFIX "_openmm" CACHE STRING "Suffix to distinguish OpenMM build from normal")
 
 #######################################################################
 # Check for options incompatible with OpenMM build                    #
@@ -99,8 +101,6 @@ if(GMX_OPENMM)
     if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")    
         set(CUDA_VERBOSE_BUILD ON)
     endif()
-    list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/contrib)
-    find_package(OpenMM) 
 
     # mark as advanced the unused variables
     mark_as_advanced(FORCE GMX_CPU_ACCELERATION GMX_MPI GMX_FFT_LIBRARY 
index 7771dcd35f079f597feca7084bbc882d857fa623..aeedeb4a75c3d9c71dabec2ed77f93403c892b1e 100644 (file)
@@ -153,7 +153,7 @@ int cmain(int argc,char *argv[])
     { efXVG, "-tpi",    "tpi",      ffOPTWR },
     { efXVG, "-tpid",   "tpidist",  ffOPTWR },
     { efEDI, "-ei",     "sam",      ffOPTRD },
-    { efEDO, "-eo",     "sam",      ffOPTWR },
+    { efXVG, "-eo",     "sam",      ffOPTWR },
     { efGCT, "-j",      "wham",     ffOPTRD },
     { efGCT, "-jo",     "bam",      ffOPTWR },
     { efXVG, "-ffout",  "gct",      ffOPTWR },
@@ -205,6 +205,8 @@ int cmain(int argc,char *argv[])
     { NULL, "interleave", "pp_pme", "cartesian", NULL };
   const char *dddlb_opt[] =
     { NULL, "auto", "no", "yes", NULL };
+  const char   *thread_aff_opt[threadaffNR+1] =
+    { NULL, "auto", "no", "yes", NULL };
   const char *nbpu_opt[] =
     { NULL, "auto", "cpu", "gpu", "gpu_cpu", NULL };
   real rdd=0.0,rconstr=0.0,dlb_scale=0.8,pforce=-1;
@@ -236,12 +238,12 @@ int cmain(int argc,char *argv[])
       "Number of OpenMP threads per MPI process/thread to start (0 is guess)" },
     { "-ntomp_pme", FALSE, etINT, {&hw_opt.nthreads_omp_pme},
       "Number of OpenMP threads per MPI process/thread to start (0 is -ntomp)" },
-    { "-pin",     FALSE, etBOOL, {&hw_opt.bThreadPinning},
+    { "-pin",     FALSE, etBOOL, {thread_aff_opt},
       "Pin OpenMP threads to cores" },
-    { "-pinht",   FALSE, etBOOL, {&hw_opt.bPinHyperthreading},
-      "Always pin threads to Hyper-Threading cores" },
     { "-pinoffset", FALSE, etINT, {&hw_opt.core_pinning_offset},
       "Core offset for pinning (for running multiple mdrun processes on a single physical node)" },
+    { "-pinstride", FALSE, etINT, {&hw_opt.core_pinning_stride},
+      "Pinning distance in logical cores for threads, use 0 to minimize the number of threads per physical core" },
     { "-gpu_id",  FALSE, etSTR, {&hw_opt.gpu_id},
       "List of GPU id's to use" },
     { "-ddcheck", FALSE, etBOOL, {&bDDBondCheck},
@@ -413,7 +415,7 @@ int cmain(int argc,char *argv[])
 
       if (MULTISIM(cr) && MASTER(cr))
       {
-          check_multi_int(stdout,cr->ms,sim_part,"simulation part");
+          check_multi_int(stdout,cr->ms,sim_part,"simulation part", TRUE);
       }
   } 
   else
index 07f0ecaccee38b501aca88e200d92dde9ed10cda..3343aba94fa07f606d151be8bcbf5fbff0be54ac 100644 (file)
@@ -9,11 +9,11 @@
  * 
  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2010, The GROMACS development team,
+ * Copyright (c) 2001-2010, 2013, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
 
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
+ * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
  * 
@@ -63,6 +63,7 @@ using namespace std;
 #include "mdrun.h"
 #include "physics.h"
 #include "string2.h"
+#include "openmm_gpu_utils.h"
 #include "gpu_utils.h"
 #include "mtop_util.h"
 
index 8d001790031ef7a54aa2782e23c2d609d7588ce6..7bd769e4e3099c04bd3eac532c7dfa35fc3fe76a 100644 (file)
 #include "force.h"
 #include "nonbonded.h"
 
-#if !defined GMX_DOUBLE && defined GMX_X86_SSE2
-#include "gmx_x86_simd_single.h"
-#define SSE_PROPER_DIHEDRALS
+#ifdef GMX_X86_SSE2
+#define SIMD_BONDEDS
+
+#include "gmx_simd_macros.h"
 #endif
 
 /* Find a better place for this? */
@@ -114,6 +115,131 @@ static int pbc_rvec_sub(const t_pbc *pbc, const rvec xi, const rvec xj, rvec dx)
     }
 }
 
+#ifdef SIMD_BONDEDS
+
+/* Below are 3 SIMD vector operations.
+ * Currently these are only used here, but they should be moved to
+ * a general SIMD include file when used elsewhere.
+ */
+
+/* SIMD inner-product of multiple vectors */
+static gmx_inline gmx_mm_pr
+gmx_iprod_pr(gmx_mm_pr ax, gmx_mm_pr ay, gmx_mm_pr az,
+             gmx_mm_pr bx, gmx_mm_pr by, gmx_mm_pr bz)
+{
+    gmx_mm_pr ret;
+
+    ret = gmx_mul_pr(ax, bx);
+    ret = gmx_madd_pr(ay, by, ret);
+    ret = gmx_madd_pr(az, bz, ret);
+
+    return ret;
+}
+
+/* SIMD norm squared of multiple vectors */
+static gmx_inline gmx_mm_pr
+gmx_norm2_pr(gmx_mm_pr ax, gmx_mm_pr ay, gmx_mm_pr az)
+{
+    gmx_mm_pr ret;
+
+    ret = gmx_mul_pr(ax, ax);
+    ret = gmx_madd_pr(ay, ay, ret);
+    ret = gmx_madd_pr(az, az, ret);
+
+    return ret;
+}
+
+/* SIMD cross-product of multiple vectors */
+static gmx_inline void
+gmx_cprod_pr(gmx_mm_pr ax, gmx_mm_pr ay, gmx_mm_pr az,
+             gmx_mm_pr bx, gmx_mm_pr by, gmx_mm_pr bz,
+             gmx_mm_pr *cx, gmx_mm_pr *cy, gmx_mm_pr *cz)
+{
+    *cx = gmx_mul_pr(ay, bz);
+    *cx = gmx_nmsub_pr(az, by, *cx);
+
+    *cy = gmx_mul_pr(az, bx);
+    *cy = gmx_nmsub_pr(ax, bz, *cy);
+
+    *cz = gmx_mul_pr(ax, by);
+    *cz = gmx_nmsub_pr(ay, bx, *cz);
+}
+
+/* SIMD PBC data structure, containing 1/boxdiag and the box vectors */
+typedef struct {
+    gmx_mm_pr inv_bzz;
+    gmx_mm_pr inv_byy;
+    gmx_mm_pr inv_bxx;
+    gmx_mm_pr bzx;
+    gmx_mm_pr bzy;
+    gmx_mm_pr bzz;
+    gmx_mm_pr byx;
+    gmx_mm_pr byy;
+    gmx_mm_pr bxx;
+} pbc_simd_t;
+
+/* Set the SIMD pbc data from a normal t_pbc struct */
+static void set_pbc_simd(const t_pbc *pbc, pbc_simd_t *pbc_simd)
+{
+    rvec inv_bdiag;
+    int  d;
+
+    /* Setting inv_bdiag to 0 effectively turns off PBC */
+    clear_rvec(inv_bdiag);
+    if (pbc != NULL)
+    {
+        for (d = 0; d < pbc->ndim_ePBC; d++)
+        {
+            inv_bdiag[d] = 1.0/pbc->box[d][d];
+        }
+    }
+
+    pbc_simd->inv_bzz = gmx_set1_pr(inv_bdiag[ZZ]);
+    pbc_simd->inv_byy = gmx_set1_pr(inv_bdiag[YY]);
+    pbc_simd->inv_bxx = gmx_set1_pr(inv_bdiag[XX]);
+
+    if (pbc != NULL)
+    {
+        pbc_simd->bzx = gmx_set1_pr(pbc->box[ZZ][XX]);
+        pbc_simd->bzy = gmx_set1_pr(pbc->box[ZZ][YY]);
+        pbc_simd->bzz = gmx_set1_pr(pbc->box[ZZ][ZZ]);
+        pbc_simd->byx = gmx_set1_pr(pbc->box[YY][XX]);
+        pbc_simd->byy = gmx_set1_pr(pbc->box[YY][YY]);
+        pbc_simd->bxx = gmx_set1_pr(pbc->box[XX][XX]);
+    }
+    else
+    {
+        pbc_simd->bzx = gmx_setzero_pr();
+        pbc_simd->bzy = gmx_setzero_pr();
+        pbc_simd->bzz = gmx_setzero_pr();
+        pbc_simd->byx = gmx_setzero_pr();
+        pbc_simd->byy = gmx_setzero_pr();
+        pbc_simd->bxx = gmx_setzero_pr();
+    }
+}
+
+/* Correct distance vector *dx,*dy,*dz for PBC using SIMD */
+static gmx_inline void
+pbc_dx_simd(gmx_mm_pr *dx, gmx_mm_pr *dy, gmx_mm_pr *dz,
+            const pbc_simd_t *pbc)
+{
+    gmx_mm_pr sh;
+
+    sh  = gmx_round_pr(gmx_mul_pr(*dz, pbc->inv_bzz));
+    *dx = gmx_nmsub_pr(sh, pbc->bzx, *dx);
+    *dy = gmx_nmsub_pr(sh, pbc->bzy, *dy);
+    *dz = gmx_nmsub_pr(sh, pbc->bzz, *dz);
+
+    sh  = gmx_round_pr(gmx_mul_pr(*dy, pbc->inv_byy));
+    *dx = gmx_nmsub_pr(sh, pbc->byx, *dx);
+    *dy = gmx_nmsub_pr(sh, pbc->byy, *dy);
+
+    sh  = gmx_round_pr(gmx_mul_pr(*dx, pbc->inv_bxx));
+    *dx = gmx_nmsub_pr(sh, pbc->bxx, *dx);
+}
+
+#endif /* SIMD_BONDEDS */
+
 /*
  * Morse potential bond by Frank Everdij
  *
@@ -958,6 +1084,161 @@ real angles(int nbonds,
     return vtot;
 }
 
+#ifdef SIMD_BONDEDS
+
+/* As angles, but using SIMD to calculate many dihedrals at once.
+ * This routines does not calculate energies and shift forces.
+ */
+static gmx_inline void
+angles_noener_simd(int nbonds,
+                   const t_iatom forceatoms[], const t_iparams forceparams[],
+                   const rvec x[], rvec f[],
+                   const t_pbc *pbc, const t_graph *g,
+                   real lambda,
+                   const t_mdatoms *md, t_fcdata *fcd,
+                   int *global_atom_index)
+{
+#define UNROLL GMX_SIMD_WIDTH_HERE
+    const int      nfa1 = 4;
+    int            i, iu, s, m;
+    int            type, ai[UNROLL], aj[UNROLL], ak[UNROLL];
+    real           coeff_array[2*UNROLL+UNROLL], *coeff;
+    real           dr_array[2*DIM*UNROLL+UNROLL], *dr;
+    real           f_buf_array[6*UNROLL+UNROLL], *f_buf;
+    gmx_mm_pr      k_S, theta0_S;
+    gmx_mm_pr      rijx_S, rijy_S, rijz_S;
+    gmx_mm_pr      rkjx_S, rkjy_S, rkjz_S;
+    gmx_mm_pr      one_S;
+    gmx_mm_pr      rij_rkj_S;
+    gmx_mm_pr      nrij2_S, nrij_1_S;
+    gmx_mm_pr      nrkj2_S, nrkj_1_S;
+    gmx_mm_pr      cos_S, sin_S;
+    gmx_mm_pr      theta_S;
+    gmx_mm_pr      st_S, sth_S;
+    gmx_mm_pr      cik_S, cii_S, ckk_S;
+    gmx_mm_pr      f_ix_S, f_iy_S, f_iz_S;
+    gmx_mm_pr      f_kx_S, f_ky_S, f_kz_S;
+    pbc_simd_t     pbc_simd;
+
+    /* Ensure register memory alignment */
+    coeff = gmx_simd_align_real(coeff_array);
+    dr    = gmx_simd_align_real(dr_array);
+    f_buf = gmx_simd_align_real(f_buf_array);
+
+    set_pbc_simd(pbc,&pbc_simd);
+
+    one_S = gmx_set1_pr(1.0);
+
+    /* nbonds is the number of angles times nfa1, here we step UNROLL angles */
+    for (i = 0; (i < nbonds); i += UNROLL*nfa1)
+    {
+        /* Collect atoms for UNROLL angles.
+         * iu indexes into forceatoms, we should not let iu go beyond nbonds.
+         */
+        iu = i;
+        for (s = 0; s < UNROLL; s++)
+        {
+            type  = forceatoms[iu];
+            ai[s] = forceatoms[iu+1];
+            aj[s] = forceatoms[iu+2];
+            ak[s] = forceatoms[iu+3];
+
+            coeff[s]        = forceparams[type].harmonic.krA;
+            coeff[UNROLL+s] = forceparams[type].harmonic.rA*DEG2RAD;
+
+            /* If you can't use pbc_dx_simd below for PBC, e.g. because
+             * you can't round in SIMD, use pbc_rvec_sub here.
+             */
+            /* Store the non PBC corrected distances packed and aligned */
+            for (m = 0; m < DIM; m++)
+            {
+                dr[s +      m *UNROLL] = x[ai[s]][m] - x[aj[s]][m];
+                dr[s + (DIM+m)*UNROLL] = x[ak[s]][m] - x[aj[s]][m];
+            }
+
+            /* At the end fill the arrays with identical entries */
+            if (iu + nfa1 < nbonds)
+            {
+                iu += nfa1;
+            }
+        }
+
+        k_S       = gmx_load_pr(coeff);
+        theta0_S  = gmx_load_pr(coeff+UNROLL);
+
+        rijx_S    = gmx_load_pr(dr + 0*UNROLL);
+        rijy_S    = gmx_load_pr(dr + 1*UNROLL);
+        rijz_S    = gmx_load_pr(dr + 2*UNROLL);
+        rkjx_S    = gmx_load_pr(dr + 3*UNROLL);
+        rkjy_S    = gmx_load_pr(dr + 4*UNROLL);
+        rkjz_S    = gmx_load_pr(dr + 5*UNROLL);
+
+        pbc_dx_simd(&rijx_S, &rijy_S, &rijz_S, &pbc_simd);
+        pbc_dx_simd(&rkjx_S, &rkjy_S, &rkjz_S, &pbc_simd);
+
+        rij_rkj_S = gmx_iprod_pr(rijx_S, rijy_S, rijz_S,
+                                 rkjx_S, rkjy_S, rkjz_S);
+
+        nrij2_S   = gmx_norm2_pr(rijx_S, rijy_S, rijz_S);
+        nrkj2_S   = gmx_norm2_pr(rkjx_S, rkjy_S, rkjz_S);
+
+        nrij_1_S  = gmx_invsqrt_pr(nrij2_S);
+        nrkj_1_S  = gmx_invsqrt_pr(nrkj2_S);
+
+        cos_S     = gmx_mul_pr(rij_rkj_S, gmx_mul_pr(nrij_1_S, nrkj_1_S));
+
+        theta_S   = gmx_acos_pr(cos_S);
+
+        sin_S     = gmx_invsqrt_pr(gmx_max_pr(gmx_sub_pr(one_S, gmx_mul_pr(cos_S, cos_S)),
+                                              gmx_setzero_pr()));
+        st_S      = gmx_mul_pr(gmx_mul_pr(k_S, gmx_sub_pr(theta0_S, theta_S)),
+                               sin_S);
+        sth_S     = gmx_mul_pr(st_S, cos_S);
+
+        cik_S     = gmx_mul_pr(st_S,  gmx_mul_pr(nrij_1_S, nrkj_1_S));
+        cii_S     = gmx_mul_pr(sth_S, gmx_mul_pr(nrij_1_S, nrij_1_S));
+        ckk_S     = gmx_mul_pr(sth_S, gmx_mul_pr(nrkj_1_S, nrkj_1_S));
+
+        f_ix_S    = gmx_mul_pr(cii_S, rijx_S);
+        f_ix_S    = gmx_nmsub_pr(cik_S, rkjx_S, f_ix_S);
+        f_iy_S    = gmx_mul_pr(cii_S, rijy_S);
+        f_iy_S    = gmx_nmsub_pr(cik_S, rkjy_S, f_iy_S);
+        f_iz_S    = gmx_mul_pr(cii_S, rijz_S);
+        f_iz_S    = gmx_nmsub_pr(cik_S, rkjz_S, f_iz_S);
+        f_kx_S    = gmx_mul_pr(ckk_S, rkjx_S);
+        f_kx_S    = gmx_nmsub_pr(cik_S, rijx_S, f_kx_S);
+        f_ky_S    = gmx_mul_pr(ckk_S, rkjy_S);
+        f_ky_S    = gmx_nmsub_pr(cik_S, rijy_S, f_ky_S);
+        f_kz_S    = gmx_mul_pr(ckk_S, rkjz_S);
+        f_kz_S    = gmx_nmsub_pr(cik_S, rijz_S, f_kz_S);
+
+        gmx_store_pr(f_buf + 0*UNROLL, f_ix_S);
+        gmx_store_pr(f_buf + 1*UNROLL, f_iy_S);
+        gmx_store_pr(f_buf + 2*UNROLL, f_iz_S);
+        gmx_store_pr(f_buf + 3*UNROLL, f_kx_S);
+        gmx_store_pr(f_buf + 4*UNROLL, f_ky_S);
+        gmx_store_pr(f_buf + 5*UNROLL, f_kz_S);
+
+        iu = i;
+        s  = 0;
+        do
+        {
+            for (m = 0; m < DIM; m++)
+            {
+                f[ai[s]][m] += f_buf[s + m*UNROLL];
+                f[aj[s]][m] -= f_buf[s + m*UNROLL] + f_buf[s + (DIM+m)*UNROLL];
+                f[ak[s]][m] += f_buf[s + (DIM+m)*UNROLL];
+            }
+            s++;
+            iu += nfa1;
+        }
+        while (s < UNROLL && iu < nbonds);
+    }
+#undef UNROLL
+}
+
+#endif /* SIMD_BONDEDS */
+
 real linear_angles(int nbonds,
                    const t_iatom forceatoms[], const t_iparams forceparams[],
                    const rvec x[], rvec f[], rvec fshift[],
@@ -1256,161 +1537,127 @@ real dih_angle(const rvec xi, const rvec xj, const rvec xk, const rvec xl,
 }
 
 
-#ifdef SSE_PROPER_DIHEDRALS
-
-/* x86 SIMD inner-product of 4 float vectors */
-#define GMX_MM_IPROD_PS(ax, ay, az, bx, by, bz)                 \
-    _mm_add_ps(_mm_add_ps(_mm_mul_ps(ax, bx), _mm_mul_ps(ay, by)), _mm_mul_ps(az, bz))
-
-/* x86 SIMD norm^2 of 4 float vectors */
-#define GMX_MM_NORM2_PS(ax, ay, az) GMX_MM_IPROD_PS(ax, ay, az, ax, ay, az)
+#ifdef SIMD_BONDEDS
 
-/* x86 SIMD cross-product of 4 float vectors */
-#define GMX_MM_CPROD_PS(ax, ay, az, bx, by, bz, cx, cy, cz)        \
-    {                                                          \
-        cx = _mm_sub_ps(_mm_mul_ps(ay, bz), _mm_mul_ps(az, by));  \
-        cy = _mm_sub_ps(_mm_mul_ps(az, bx), _mm_mul_ps(ax, bz));  \
-        cz = _mm_sub_ps(_mm_mul_ps(ax, by), _mm_mul_ps(ay, bx));  \
-    }
-
-/* load 4 rvec's into 3 x86 SIMD float registers */
-#define load_rvec4(r0, r1, r2, r3, rx_SSE, ry_SSE, rz_SSE)          \
-    {                                                             \
-        __m128 tmp;                                               \
-        rx_SSE = _mm_load_ps(r0);                                 \
-        ry_SSE = _mm_load_ps(r1);                                 \
-        rz_SSE = _mm_load_ps(r2);                                 \
-        tmp    = _mm_load_ps(r3);                                 \
-        _MM_TRANSPOSE4_PS(rx_SSE, ry_SSE, rz_SSE, tmp);              \
-    }
-
-#define store_rvec4(rx_SSE, ry_SSE, rz_SSE, r0, r1, r2, r3)         \
-    {                                                             \
-        __m128 tmp = _mm_setzero_ps();                              \
-        _MM_TRANSPOSE4_PS(rx_SSE, ry_SSE, rz_SSE, tmp);              \
-        _mm_store_ps(r0, rx_SSE);                                  \
-        _mm_store_ps(r1, ry_SSE);                                  \
-        _mm_store_ps(r2, rz_SSE);                                  \
-        _mm_store_ps(r3, tmp   );                                  \
-    }
-
-/* An rvec in a structure which can be allocated 16-byte aligned */
-typedef struct {
-    rvec  v;
-    float f;
-} rvec_sse_t;
-
-/* As dih_angle above, but calculates 4 dihedral angles at once using SSE,
+/* As dih_angle above, but calculates 4 dihedral angles at once using SIMD,
  * also calculates the pre-factor required for the dihedral force update.
- * Note that bv and buf should be 16-byte aligned.
+ * Note that bv and buf should be register aligned.
  */
-static void
-dih_angle_sse(const rvec *x,
-              int ai[4], int aj[4], int ak[4], int al[4],
-              const t_pbc *pbc,
-              int t1[4], int t2[4], int t3[4],
-              rvec_sse_t *bv,
-              real *buf)
+static gmx_inline void
+dih_angle_simd(const rvec *x,
+               const int *ai, const int *aj, const int *ak, const int *al,
+               const pbc_simd_t *pbc,
+               real *dr,
+               gmx_mm_pr *phi_S,
+               gmx_mm_pr *mx_S, gmx_mm_pr *my_S, gmx_mm_pr *mz_S,
+               gmx_mm_pr *nx_S, gmx_mm_pr *ny_S, gmx_mm_pr *nz_S,
+               gmx_mm_pr *nrkj_m2_S,
+               gmx_mm_pr *nrkj_n2_S,
+               real *p,
+               real *q)
 {
-    int    s;
-    __m128 rijx_SSE, rijy_SSE, rijz_SSE;
-    __m128 rkjx_SSE, rkjy_SSE, rkjz_SSE;
-    __m128 rklx_SSE, rkly_SSE, rklz_SSE;
-    __m128 mx_SSE, my_SSE, mz_SSE;
-    __m128 nx_SSE, ny_SSE, nz_SSE;
-    __m128 cx_SSE, cy_SSE, cz_SSE;
-    __m128 cn_SSE;
-    __m128 s_SSE;
-    __m128 phi_SSE;
-    __m128 ipr_SSE;
-    int    signs;
-    __m128 iprm_SSE, iprn_SSE;
-    __m128 nrkj2_SSE, nrkj_1_SSE, nrkj_2_SSE, nrkj_SSE;
-    __m128 nrkj_m2_SSE, nrkj_n2_SSE;
-    __m128 p_SSE, q_SSE;
-    __m128 fmin_SSE = _mm_set1_ps(GMX_FLOAT_MIN);
-
-    for (s = 0; s < 4; s++)
+#define UNROLL GMX_SIMD_WIDTH_HERE
+    int       s, m;
+    gmx_mm_pr rijx_S, rijy_S, rijz_S;
+    gmx_mm_pr rkjx_S, rkjy_S, rkjz_S;
+    gmx_mm_pr rklx_S, rkly_S, rklz_S;
+    gmx_mm_pr cx_S, cy_S, cz_S;
+    gmx_mm_pr cn_S;
+    gmx_mm_pr s_S;
+    gmx_mm_pr ipr_S;
+    gmx_mm_pr iprm_S, iprn_S;
+    gmx_mm_pr nrkj2_S, nrkj_1_S, nrkj_2_S, nrkj_S;
+    gmx_mm_pr p_S, q_S;
+    gmx_mm_pr fmin_S = gmx_set1_pr(GMX_FLOAT_MIN);
+    /* Using -0.0 should lead to only the sign bit being set */
+    gmx_mm_pr sign_mask_S = gmx_set1_pr(-0.0);
+
+    for (s = 0; s < UNROLL; s++)
     {
-        t1[s] = pbc_rvec_sub(pbc, x[ai[s]], x[aj[s]], bv[0+s].v);
-        t2[s] = pbc_rvec_sub(pbc, x[ak[s]], x[aj[s]], bv[4+s].v);
-        t3[s] = pbc_rvec_sub(pbc, x[ak[s]], x[al[s]], bv[8+s].v);
+        /* If you can't use pbc_dx_simd below for PBC, e.g. because
+         * you can't round in SIMD, use pbc_rvec_sub here.
+         */
+        for (m = 0; m < DIM; m++)
+        {
+            dr[s + (0*DIM + m)*UNROLL] = x[ai[s]][m] - x[aj[s]][m];
+            dr[s + (1*DIM + m)*UNROLL] = x[ak[s]][m] - x[aj[s]][m];
+            dr[s + (2*DIM + m)*UNROLL] = x[ak[s]][m] - x[al[s]][m];
+        }
     }
 
-    load_rvec4(bv[0].v, bv[1].v, bv[2].v, bv[3].v, rijx_SSE, rijy_SSE, rijz_SSE);
-    load_rvec4(bv[4].v, bv[5].v, bv[6].v, bv[7].v, rkjx_SSE, rkjy_SSE, rkjz_SSE);
-    load_rvec4(bv[8].v, bv[9].v, bv[10].v, bv[11].v, rklx_SSE, rkly_SSE, rklz_SSE);
+    rijx_S = gmx_load_pr(dr + 0*UNROLL);
+    rijy_S = gmx_load_pr(dr + 1*UNROLL);
+    rijz_S = gmx_load_pr(dr + 2*UNROLL);
+    rkjx_S = gmx_load_pr(dr + 3*UNROLL);
+    rkjy_S = gmx_load_pr(dr + 4*UNROLL);
+    rkjz_S = gmx_load_pr(dr + 5*UNROLL);
+    rklx_S = gmx_load_pr(dr + 6*UNROLL);
+    rkly_S = gmx_load_pr(dr + 7*UNROLL);
+    rklz_S = gmx_load_pr(dr + 8*UNROLL);
 
-    GMX_MM_CPROD_PS(rijx_SSE, rijy_SSE, rijz_SSE,
-                    rkjx_SSE, rkjy_SSE, rkjz_SSE,
-                    mx_SSE, my_SSE, mz_SSE);
+    pbc_dx_simd(&rijx_S, &rijy_S, &rijz_S, pbc);
+    pbc_dx_simd(&rkjx_S, &rkjy_S, &rkjz_S, pbc);
+    pbc_dx_simd(&rklx_S, &rkly_S, &rklz_S, pbc);
 
-    GMX_MM_CPROD_PS(rkjx_SSE, rkjy_SSE, rkjz_SSE,
-                    rklx_SSE, rkly_SSE, rklz_SSE,
-                    nx_SSE, ny_SSE, nz_SSE);
+    gmx_cprod_pr(rijx_S, rijy_S, rijz_S,
+                 rkjx_S, rkjy_S, rkjz_S,
+                 mx_S, my_S, mz_S);
 
-    GMX_MM_CPROD_PS(mx_SSE, my_SSE, mz_SSE,
-                    nx_SSE, ny_SSE, nz_SSE,
-                    cx_SSE, cy_SSE, cz_SSE);
+    gmx_cprod_pr(rkjx_S, rkjy_S, rkjz_S,
+                 rklx_S, rkly_S, rklz_S,
+                 nx_S, ny_S, nz_S);
 
-    cn_SSE = gmx_mm_sqrt_ps(GMX_MM_NORM2_PS(cx_SSE, cy_SSE, cz_SSE));
+    gmx_cprod_pr(*mx_S, *my_S, *mz_S,
+                 *nx_S, *ny_S, *nz_S,
+                 &cx_S, &cy_S, &cz_S);
 
-    s_SSE = GMX_MM_IPROD_PS(mx_SSE, my_SSE, mz_SSE, nx_SSE, ny_SSE, nz_SSE);
+    cn_S       = gmx_sqrt_pr(gmx_norm2_pr(cx_S, cy_S, cz_S));
 
-    phi_SSE = gmx_mm_atan2_ps(cn_SSE, s_SSE);
-    _mm_store_ps(buf+16, phi_SSE);
+    s_S        = gmx_iprod_pr(*mx_S, *my_S, *mz_S, *nx_S, *ny_S, *nz_S);
 
-    ipr_SSE = GMX_MM_IPROD_PS(rijx_SSE, rijy_SSE, rijz_SSE,
-                              nx_SSE, ny_SSE, nz_SSE);
+    /* Determine the dihedral angle, the sign might need correction */
+    *phi_S     = gmx_atan2_pr(cn_S, s_S);
 
-    signs = _mm_movemask_ps(ipr_SSE);
+    ipr_S      = gmx_iprod_pr(rijx_S, rijy_S, rijz_S,
+                              *nx_S, *ny_S, *nz_S);
 
-    for (s = 0; s < 4; s++)
-    {
-        if (signs & (1<<s))
-        {
-            buf[16+s] = -buf[16+s];
-        }
-    }
+    iprm_S     = gmx_norm2_pr(*mx_S, *my_S, *mz_S);
+    iprn_S     = gmx_norm2_pr(*nx_S, *ny_S, *nz_S);
 
-    iprm_SSE    = GMX_MM_NORM2_PS(mx_SSE, my_SSE, mz_SSE);
-    iprn_SSE    = GMX_MM_NORM2_PS(nx_SSE, ny_SSE, nz_SSE);
-
-    /* store_rvec4 messes with the input, don't use it after this! */
-    store_rvec4(mx_SSE, my_SSE, mz_SSE, bv[0].v, bv[1].v, bv[2].v, bv[3].v);
-    store_rvec4(nx_SSE, ny_SSE, nz_SSE, bv[4].v, bv[5].v, bv[6].v, bv[7].v);
-
-    nrkj2_SSE   = GMX_MM_NORM2_PS(rkjx_SSE, rkjy_SSE, rkjz_SSE);
+    nrkj2_S    = gmx_norm2_pr(rkjx_S, rkjy_S, rkjz_S);
 
     /* Avoid division by zero. When zero, the result is multiplied by 0
      * anyhow, so the 3 max below do not affect the final result.
      */
-    nrkj2_SSE   = _mm_max_ps(nrkj2_SSE, fmin_SSE);
-    nrkj_1_SSE  = gmx_mm_invsqrt_ps(nrkj2_SSE);
-    nrkj_2_SSE  = _mm_mul_ps(nrkj_1_SSE, nrkj_1_SSE);
-    nrkj_SSE    = _mm_mul_ps(nrkj2_SSE, nrkj_1_SSE);
-
-    iprm_SSE    = _mm_max_ps(iprm_SSE, fmin_SSE);
-    iprn_SSE    = _mm_max_ps(iprn_SSE, fmin_SSE);
-    nrkj_m2_SSE = _mm_mul_ps(nrkj_SSE, gmx_mm_inv_ps(iprm_SSE));
-    nrkj_n2_SSE = _mm_mul_ps(nrkj_SSE, gmx_mm_inv_ps(iprn_SSE));
-
-    _mm_store_ps(buf+0, nrkj_m2_SSE);
-    _mm_store_ps(buf+4, nrkj_n2_SSE);
+    nrkj2_S    = gmx_max_pr(nrkj2_S, fmin_S);
+    nrkj_1_S   = gmx_invsqrt_pr(nrkj2_S);
+    nrkj_2_S   = gmx_mul_pr(nrkj_1_S, nrkj_1_S);
+    nrkj_S     = gmx_mul_pr(nrkj2_S, nrkj_1_S);
+
+    iprm_S     = gmx_max_pr(iprm_S, fmin_S);
+    iprn_S     = gmx_max_pr(iprn_S, fmin_S);
+    *nrkj_m2_S = gmx_mul_pr(nrkj_S, gmx_inv_pr(iprm_S));
+    *nrkj_n2_S = gmx_mul_pr(nrkj_S, gmx_inv_pr(iprn_S));
+
+    /* Set sign of the angle with the sign of ipr_S.
+     * Since phi is currently positive, we can use OR instead of XOR.
+     */
+    *phi_S     = gmx_or_pr(*phi_S, gmx_and_pr(ipr_S, sign_mask_S));
 
-    p_SSE       = GMX_MM_IPROD_PS(rijx_SSE, rijy_SSE, rijz_SSE,
-                                  rkjx_SSE, rkjy_SSE, rkjz_SSE);
-    p_SSE       = _mm_mul_ps(p_SSE, nrkj_2_SSE);
+    p_S        = gmx_iprod_pr(rijx_S, rijy_S, rijz_S,
+                              rkjx_S, rkjy_S, rkjz_S);
+    p_S        = gmx_mul_pr(p_S, nrkj_2_S);
 
-    q_SSE       = GMX_MM_IPROD_PS(rklx_SSE, rkly_SSE, rklz_SSE,
-                                  rkjx_SSE, rkjy_SSE, rkjz_SSE);
-    q_SSE       = _mm_mul_ps(q_SSE, nrkj_2_SSE);
+    q_S        = gmx_iprod_pr(rklx_S, rkly_S, rklz_S,
+                              rkjx_S, rkjy_S, rkjz_S);
+    q_S        = gmx_mul_pr(q_S, nrkj_2_S);
 
-    _mm_store_ps(buf+8, p_SSE);
-    _mm_store_ps(buf+12, q_SSE);
+    gmx_store_pr(p, p_S);
+    gmx_store_pr(q, q_S);
+#undef UNROLL
 }
 
-#endif /* SSE_PROPER_DIHEDRALS */
+#endif /* SIMD_BONDEDS */
 
 
 void do_dih_fup(int i, int j, int k, int l, real ddphi,
@@ -1522,21 +1769,22 @@ do_dih_fup_noshiftf(int i, int j, int k, int l, real ddphi,
 }
 
 /* As do_dih_fup_noshiftf above, but with pre-calculated pre-factors */
-static void
-do_dih_fup_noshiftf_precalc(int i, int j, int k, int l, real ddphi,
-                            real nrkj_m2, real nrkj_n2,
+static gmx_inline void
+do_dih_fup_noshiftf_precalc(int i, int j, int k, int l,
                             real p, real q,
-                            rvec m, rvec n, rvec f[])
+                            real f_i_x, real f_i_y, real f_i_z,
+                            real mf_l_x, real mf_l_y, real mf_l_z,
+                            rvec f[])
 {
     rvec f_i, f_j, f_k, f_l;
-    rvec uvec, vvec, svec, dx_jl;
-    real a, b, toler;
-    ivec jt, dt_ij, dt_kj, dt_lj;
-
-    a = -ddphi*nrkj_m2;
-    svmul(a, m, f_i);
-    b =  ddphi*nrkj_n2;
-    svmul(b, n, f_l);
+    rvec uvec, vvec, svec;
+
+    f_i[XX] = f_i_x;
+    f_i[YY] = f_i_y;
+    f_i[ZZ] = f_i_z;
+    f_l[XX] = -mf_l_x;
+    f_l[YY] = -mf_l_y;
+    f_l[ZZ] = -mf_l_z;
     svmul(p, f_i, uvec);
     svmul(q, f_l, vvec);
     rvec_sub(uvec, vvec, svec);
@@ -1744,98 +1992,139 @@ pdihs_noener(int nbonds,
 }
 
 
-#ifdef SSE_PROPER_DIHEDRALS
+#ifdef SIMD_BONDEDS
 
-/* As pdihs_noner above, but using SSE to calculate 4 dihedrals at once */
+/* As pdihs_noner above, but using SIMD to calculate many dihedrals at once */
 static void
-pdihs_noener_sse(int nbonds,
-                 const t_iatom forceatoms[], const t_iparams forceparams[],
-                 const rvec x[], rvec f[],
-                 const t_pbc *pbc, const t_graph *g,
-                 real lambda,
-                 const t_mdatoms *md, t_fcdata *fcd,
-                 int *global_atom_index)
+pdihs_noener_simd(int nbonds,
+                  const t_iatom forceatoms[], const t_iparams forceparams[],
+                  const rvec x[], rvec f[],
+                  const t_pbc *pbc, const t_graph *g,
+                  real lambda,
+                  const t_mdatoms *md, t_fcdata *fcd,
+                  int *global_atom_index)
 {
-    int        i, i4, s;
-    int        type, ai[4], aj[4], ak[4], al[4];
-    int        t1[4], t2[4], t3[4];
-    int        mult[4];
-    real       cp[4], mdphi[4];
-    real       ddphi;
-    rvec_sse_t rs_array[13], *rs;
-    real       buf_array[24], *buf;
-    __m128     mdphi_SSE, sin_SSE, cos_SSE;
-
-    /* Ensure 16-byte alignment */
-    rs  = (rvec_sse_t *)(((size_t)(rs_array +1)) & (~((size_t)15)));
-    buf =      (float *)(((size_t)(buf_array+3)) & (~((size_t)15)));
-
-    for (i = 0; (i < nbonds); i += 20)
-    {
-        /* Collect atoms quadruplets for 4 dihedrals */
-        i4 = i;
-        for (s = 0; s < 4; s++)
-        {
-            ai[s] = forceatoms[i4+1];
-            aj[s] = forceatoms[i4+2];
-            ak[s] = forceatoms[i4+3];
-            al[s] = forceatoms[i4+4];
-            /* At the end fill the arrays with identical entries */
-            if (i4 + 5 < nbonds)
-            {
-                i4 += 5;
-            }
-        }
+#define UNROLL GMX_SIMD_WIDTH_HERE
+    const int      nfa1 = 5;
+    int            i, iu, s;
+    int            type, ai[UNROLL], aj[UNROLL], ak[UNROLL], al[UNROLL];
+    int            t1[UNROLL], t2[UNROLL], t3[UNROLL];
+    real           ddphi;
+    real           dr_array[3*DIM*UNROLL+UNROLL], *dr;
+    real           buf_array[7*UNROLL+UNROLL], *buf;
+    real           *cp, *phi0, *mult, *phi, *p, *q, *sf_i, *msf_l;
+    gmx_mm_pr      phi0_S, phi_S;
+    gmx_mm_pr      mx_S, my_S, mz_S;
+    gmx_mm_pr      nx_S, ny_S, nz_S;
+    gmx_mm_pr      nrkj_m2_S, nrkj_n2_S;
+    gmx_mm_pr      cp_S, mdphi_S, mult_S;
+    gmx_mm_pr      sin_S, cos_S;
+    gmx_mm_pr      mddphi_S;
+    gmx_mm_pr      sf_i_S, msf_l_S;
+    pbc_simd_t     pbc_simd;
+
+    /* Ensure SIMD register alignment */
+    dr  = gmx_simd_align_real(dr_array);
+    buf = gmx_simd_align_real(buf_array);
+
+    /* Extract aligned pointer for parameters and variables */
+    cp    = buf + 0*UNROLL;
+    phi0  = buf + 1*UNROLL;
+    mult  = buf + 2*UNROLL;
+    p     = buf + 3*UNROLL;
+    q     = buf + 4*UNROLL;
+    sf_i  = buf + 5*UNROLL;
+    msf_l = buf + 6*UNROLL;
+
+    set_pbc_simd(pbc, &pbc_simd);
+
+    /* nbonds is the number of dihedrals times nfa1, here we step UNROLL dihs */
+    for (i = 0; (i < nbonds); i += UNROLL*nfa1)
+    {
+        /* Collect atoms quadruplets for UNROLL dihedrals.
+         * iu indexes into forceatoms, we should not let iu go beyond nbonds.
+         */
+        iu = i;
+        for (s = 0; s < UNROLL; s++)
+        {
+            type  = forceatoms[iu];
+            ai[s] = forceatoms[iu+1];
+            aj[s] = forceatoms[iu+2];
+            ak[s] = forceatoms[iu+3];
+            al[s] = forceatoms[iu+4];
 
-        /* Caclulate 4 dihedral angles at once */
-        dih_angle_sse(x, ai, aj, ak, al, pbc, t1, t2, t3, rs, buf);
+            cp[s]   = forceparams[type].pdihs.cpA;
+            phi0[s] = forceparams[type].pdihs.phiA*DEG2RAD;
+            mult[s] = forceparams[type].pdihs.mult;
 
-        i4 = i;
-        for (s = 0; s < 4; s++)
-        {
-            if (i4 < nbonds)
-            {
-                /* Calculate the coefficient and angle deviation */
-                type = forceatoms[i4];
-                dopdihs_mdphi(forceparams[type].pdihs.cpA,
-                              forceparams[type].pdihs.cpB,
-                              forceparams[type].pdihs.phiA,
-                              forceparams[type].pdihs.phiB,
-                              forceparams[type].pdihs.mult,
-                              buf[16+s], lambda, &cp[s], &buf[16+s]);
-                mult[s] = forceparams[type].pdihs.mult;
-            }
-            else
+            /* At the end fill the arrays with identical entries */
+            if (iu + nfa1 < nbonds)
             {
-                buf[16+s] = 0;
+                iu += nfa1;
             }
-            i4 += 5;
         }
 
-        /* Calculate 4 sines at once */
-        mdphi_SSE = _mm_load_ps(buf+16);
-        gmx_mm_sincos_ps(mdphi_SSE, &sin_SSE, &cos_SSE);
-        _mm_store_ps(buf+16, sin_SSE);
-
-        i4 = i;
+        /* Caclulate UNROLL dihedral angles at once */
+        dih_angle_simd(x, ai, aj, ak, al, &pbc_simd,
+                       dr,
+                       &phi_S,
+                       &mx_S, &my_S, &mz_S,
+                       &nx_S, &ny_S, &nz_S,
+                       &nrkj_m2_S,
+                       &nrkj_n2_S,
+                       p, q);
+
+        cp_S     = gmx_load_pr(cp);
+        phi0_S   = gmx_load_pr(phi0);
+        mult_S   = gmx_load_pr(mult);
+
+        mdphi_S  = gmx_sub_pr(gmx_mul_pr(mult_S, phi_S), phi0_S);
+
+        /* Calculate UNROLL sines at once */
+        gmx_sincos_pr(mdphi_S, &sin_S, &cos_S);
+        mddphi_S = gmx_mul_pr(gmx_mul_pr(cp_S, mult_S), sin_S);
+        sf_i_S   = gmx_mul_pr(mddphi_S, nrkj_m2_S);
+        msf_l_S  = gmx_mul_pr(mddphi_S, nrkj_n2_S);
+
+        /* After this m?_S will contain f[i] */
+        mx_S     = gmx_mul_pr(sf_i_S, mx_S);
+        my_S     = gmx_mul_pr(sf_i_S, my_S);
+        mz_S     = gmx_mul_pr(sf_i_S, mz_S);
+
+        /* After this m?_S will contain -f[l] */
+        nx_S     = gmx_mul_pr(msf_l_S, nx_S);
+        ny_S     = gmx_mul_pr(msf_l_S, ny_S);
+        nz_S     = gmx_mul_pr(msf_l_S, nz_S);
+
+        gmx_store_pr(dr + 0*UNROLL, mx_S);
+        gmx_store_pr(dr + 1*UNROLL, my_S);
+        gmx_store_pr(dr + 2*UNROLL, mz_S);
+        gmx_store_pr(dr + 3*UNROLL, nx_S);
+        gmx_store_pr(dr + 4*UNROLL, ny_S);
+        gmx_store_pr(dr + 5*UNROLL, nz_S);
+
+        iu = i;
         s  = 0;
         do
         {
-            ddphi = -cp[s]*mult[s]*buf[16+s];
-
-            do_dih_fup_noshiftf_precalc(ai[s], aj[s], ak[s], al[s], ddphi,
-                                        buf[ 0+s], buf[ 4+s],
-                                        buf[ 8+s], buf[12+s],
-                                        rs[0+s].v, rs[4+s].v,
+            do_dih_fup_noshiftf_precalc(ai[s], aj[s], ak[s], al[s],
+                                        p[s], q[s],
+                                        dr[     XX *UNROLL+s],
+                                        dr[     YY *UNROLL+s],
+                                        dr[     ZZ *UNROLL+s],
+                                        dr[(DIM+XX)*UNROLL+s],
+                                        dr[(DIM+YY)*UNROLL+s],
+                                        dr[(DIM+ZZ)*UNROLL+s],
                                         f);
             s++;
-            i4 += 5;
+            iu += nfa1;
         }
-        while (s < 4 && i4 < nbonds);
+        while (s < UNROLL && iu < nbonds);
     }
+#undef UNROLL
 }
 
-#endif /* SSE_PROPER_DIHEDRALS */
+#endif /* SIMD_BONDEDS */
 
 
 real idihs(int nbonds,
@@ -3694,14 +3983,27 @@ static real calc_one_bond(FILE *fplog, int thread,
                               pbc, g, lambda[efptFTYPE], &(dvdl[efptFTYPE]),
                               md, fcd, global_atom_index);
             }
+#ifdef SIMD_BONDEDS
+            else if (ftype == F_ANGLES &&
+                     !bCalcEnerVir && fr->efep == efepNO)
+            {
+                /* No energies, shift forces, dvdl */
+                angles_noener_simd(nbn, idef->il[ftype].iatoms+nb0,
+                                   idef->iparams,
+                                   (const rvec*)x, f,
+                                   pbc, g, lambda[efptFTYPE], md, fcd,
+                                   global_atom_index);
+                v = 0;
+            }
+#endif
             else if (ftype == F_PDIHS &&
                      !bCalcEnerVir && fr->efep == efepNO)
             {
                 /* No energies, shift forces, dvdl */
-#ifndef SSE_PROPER_DIHEDRALS
+#ifndef SIMD_BONDEDS
                 pdihs_noener
 #else
-                pdihs_noener_sse
+                pdihs_noener_simd
 #endif
                     (nbn, idef->il[ftype].iatoms+nb0,
                     idef->iparams,
@@ -3730,9 +4032,6 @@ static real calc_one_bond(FILE *fplog, int thread,
             v = do_nonbonded_listed(ftype, nbn, iatoms+nb0, idef->iparams, (const rvec*)x, f, fshift,
                                     pbc, g, lambda, dvdl, md, fr, grpp, global_atom_index);
 
-            enerd->dvdl_nonlin[efptCOUL] += dvdl[efptCOUL];
-            enerd->dvdl_nonlin[efptVDW]  += dvdl[efptVDW];
-
             if (bPrintSepPot)
             {
                 fprintf(fplog, "  %-5s + %-15s #%4d                  dVdl %12.5e\n",
index ae32be48e89de743c9856b2f2b65f32fe07474bf..3e4eca01b3ac8b55e262d78fa1b0d893723a877b 100644 (file)
@@ -258,7 +258,7 @@ void CopyRight(FILE *out, const char *szProgram)
 #define NCR (int)asize(CopyrightText)
 /* TODO: Is this exception still needed? */
 #ifdef GMX_FAHCORE
-#define NLICENSE 0 /*FAH has an exception permission from GPL to allow digital signatures in Gromacs*/
+#define NLICENSE 0 /*FAH has an exception permission from LGPL to allow digital signatures in Gromacs*/
 #else
 #define NLICENSE (int)asize(LicenseText)
 #endif
@@ -758,7 +758,7 @@ void gmx_print_version_info(FILE *fp)
     }
 #ifdef HAVE_LIBMKL
     /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
-    fprintf(fp, "Linked with Intel MKL version %s.%s.%s.\n",
+    fprintf(fp, "Linked with Intel MKL version %d.%d.%d.\n",
             __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__);
 #endif
 #ifdef GMX_GPU
index 834bdb4b373debe26ab9e8e182df6ff601e65696..eaa00e1638f0c107a8cad6f2b81c07a05757a454 100644 (file)
@@ -11,7 +11,7 @@ BLAS does not come with a formal named "license", but a general statement that
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is GPL, we think it's only fair to give you the same rights to
+While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
 our modified BLAS files as the original netlib versions, so do what you want with them.
 However, be warned that we have only tested that they to the right thing in the cases used
 in Gromacs (primarily full & sparse matrix diagonalization), so in most cases it is a much
index 8e9b0f750047c7532761e24ac2bea398a392318c..c4cc48cecf4eb0e9d6e460f6b05ac1021bbb701d 100644 (file)
@@ -11,7 +11,7 @@ LAPACK does not come with a formal named "license", but a general statement sayi
 via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software
 packages (and has been). We only ask that proper credit be given to the authors."
 
-While the rest of Gromacs is GPL, we think it's only fair to give you the same rights to
+While the rest of Gromacs is LGPL, we think it's only fair to give you the same rights to
 our modified LAPACK files as the original netlib versions, so do what you want with them.
 
 However, be warned that we have only tested that they to the right thing in the cases used
index a00f2487242e1db44899e3f455993003e7dee34e..132430d3099bd928504c4426f748d559a79dfb5e 100644 (file)
@@ -62,7 +62,7 @@
  * platforms like Microsoft Windows we have created a private version
  * of the necessary routines and distribute them with the Gromacs source.
  *
- * Although the rest of Gromacs is GPL, you can copy and use the XDR
+ * Although the rest of Gromacs is LGPL, you can copy and use the XDR
  * routines in any way you want as long as you obey Sun's license:
  *
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
index 95e9b14497a1e2ab1b4e444efa690623f2003695..373da9ddbf0bf4360ae9d7b24f409fb45e9a7183 100644 (file)
@@ -79,6 +79,12 @@ static gmx_bool ip_pert(int ftype, const t_iparams *ip)
                      ip->restraint.up2A  != ip->restraint.up2B ||
                      ip->restraint.kA    != ip->restraint.kB);
             break;
+        case F_UREY_BRADLEY:
+            bPert = (ip->u_b.thetaA  != ip->u_b.thetaB  ||
+                     ip->u_b.kthetaA != ip->u_b.kthetaB ||
+                     ip->u_b.r13A    != ip->u_b.r13B    ||
+                     ip->u_b.kUBA    != ip->u_b.kUBB);
+            break;
         case F_PDIHS:
         case F_PIDIHS:
         case F_ANGRES:
index e42d128875f15b0d36ab8fef6f9323acae4ee052..5822627fba5ef01d0eccd22f742b35577a1afcba 100644 (file)
@@ -167,6 +167,7 @@ void clear_trxframe(t_trxframe *fr, gmx_bool bFirst)
     fr->bStep   = FALSE;
     fr->bTime   = FALSE;
     fr->bLambda = FALSE;
+    fr->bFepState = FALSE;
     fr->bAtoms  = FALSE;
     fr->bPrec   = FALSE;
     fr->bX      = FALSE;
@@ -185,6 +186,7 @@ void clear_trxframe(t_trxframe *fr, gmx_bool bFirst)
         fr->step    = 0;
         fr->time    = 0;
         fr->lambda  = 0;
+        fr->fep_state = 0;
         fr->atoms   = NULL;
         fr->prec    = 0;
         fr->x       = NULL;
index 50624792f1189c574ad7d61ea40092ead9851b41..e2125333387440d266eb0e6e77f23e8adb635511 100644 (file)
@@ -88,7 +88,10 @@ if(GMX_OPENMM)
     # Even though the OpenMM build has "moved to contrib", many things
     # have be be done from within the scope of the CMakeLists.txt that
     # builds its mdrun, and that is here
-    include(../contrib/BuildMdrunOpenMM)
+    list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/contrib)
+    find_package(OpenMM)
+    include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+    include(${CMAKE_SOURCE_DIR}/src/contrib/BuildMdrunOpenMM.cmake)
 endif(GMX_OPENMM)
 
 if(GMX_GPU OR GMX_FORCE_CXX)
@@ -123,6 +126,10 @@ gmx_add_man_page(mdrun)
 target_link_libraries(mdrun gmxpreprocess md gmx ${OpenMP_LINKER_FLAGS})
 set_target_properties(mdrun PROPERTIES OUTPUT_NAME "mdrun${GMX_BINARY_SUFFIX}" COMPILE_FLAGS "${OpenMP_C_FLAGS}")
 
+if(GMX_OPENMM)
+    target_link_libraries(mdrun openmm_api_wrapper)
+endif()
+
 # Construct component groups for installation; note that a component may
 # belong to only one group
 foreach(PROGRAM ${GMX_KERNEL_PROGRAMS})
index 5e57d1c4e151f9cd12c3c35fad045069fd4e3c51..d1a2f8efee5e71e259e1c37c0bf41f1a7975ca9b 100644 (file)
@@ -80,11 +80,11 @@ typedef struct {
 #define PME_LB_ACCEL_TOL 1.02
 
 enum {
-    epmelblimNO, epmelblimBOX, epmelblimDD, epmelblimNR
+    epmelblimNO, epmelblimBOX, epmelblimDD, epmelblimPMEGRID, epmelblimNR
 };
 
 const char *pmelblim_str[epmelblimNR] =
-{ "no", "box size", "domain decompostion" };
+{ "no", "box size", "domain decompostion", "PME grid restriction" };
 
 struct pme_load_balancing {
     int          nstage;             /* the current maximum number of stages */
@@ -205,12 +205,15 @@ void pme_loadbal_init(pme_load_balancing_t *pme_lb_p,
 }
 
 static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t pme_lb,
-                                            int                  pme_order)
+                                            int                  pme_order,
+                                            const gmx_domdec_t   *dd)
 {
     pme_setup_t *set;
+    int          npmenodes_x, npmenodes_y;
     real         fac, sp;
     real         tmpr_coulomb, tmpr_vdw;
     int          d;
+    gmx_bool     grid_ok;
 
     /* Try to add a new setup with next larger cut-off to the list */
     pme_lb->n++;
@@ -218,9 +221,23 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t pme_lb,
     set          = &pme_lb->setup[pme_lb->n-1];
     set->pmedata = NULL;
 
+    get_pme_nnodes(dd, &npmenodes_x, &npmenodes_y);
+
     fac = 1;
     do
     {
+        /* Avoid infinite while loop, which can occur at the minimum grid size.
+         * Note that in practice load balancing will stop before this point.
+         * The factor 2.1 allows for the extreme case in which only grids
+         * of powers of 2 are allowed (the current code supports more grids).
+         */
+        if (fac > 2.1)
+        {
+            pme_lb->n--;
+
+            return FALSE;
+        }
+
         fac *= 1.01;
         clear_ivec(set->grid);
         sp = calc_grid(NULL, pme_lb->box_start,
@@ -229,20 +246,19 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t pme_lb,
                        &set->grid[YY],
                        &set->grid[ZZ]);
 
-        /* In parallel we can't have grids smaller than 2*pme_order,
-         * and we would anyhow not gain much speed at these grid sizes.
+        /* As here we can't easily check if one of the PME nodes
+         * uses threading, we do a conservative grid check.
+         * This means we can't use pme_order or less grid lines
+         * per PME node along x, which is not a strong restriction.
          */
-        for (d = 0; d < DIM; d++)
-        {
-            if (set->grid[d] <= 2*pme_order)
-            {
-                pme_lb->n--;
-
-                return FALSE;
-            }
-        }
+        gmx_pme_check_restrictions(pme_order,
+                                   set->grid[XX], set->grid[YY], set->grid[ZZ],
+                                   npmenodes_x, npmenodes_y,
+                                   TRUE,
+                                   FALSE,
+                                   &grid_ok);
     }
-    while (sp <= 1.001*pme_lb->setup[pme_lb->cur].spacing);
+    while (sp <= 1.001*pme_lb->setup[pme_lb->cur].spacing || !grid_ok);
 
     set->rcut_coulomb = pme_lb->cut_spacing*sp;
 
@@ -363,7 +379,7 @@ static void print_loadbal_limited(FILE *fp_err, FILE *fp_log,
 {
     char buf[STRLEN], sbuf[22];
 
-    sprintf(buf, "step %4s: the %s limited the PME load balancing to a coulomb cut-off of %.3f",
+    sprintf(buf, "step %4s: the %s limits the PME load balancing to a coulomb cut-off of %.3f",
             gmx_step_str(step, sbuf),
             pmelblim_str[pme_lb->elimited],
             pme_lb->setup[pme_loadbal_end(pme_lb)-1].rcut_coulomb);
@@ -531,7 +547,12 @@ gmx_bool pme_load_balance(pme_load_balancing_t pme_lb,
             else
             {
                 /* Find the next setup */
-                OK = pme_loadbal_increase_cutoff(pme_lb, ir->pme_order);
+                OK = pme_loadbal_increase_cutoff(pme_lb, ir->pme_order, cr->dd);
+
+                if (!OK)
+                {
+                    pme_lb->elimited = epmelblimPMEGRID;
+                }
             }
 
             if (OK && ir->ePBC != epbcNONE)
index 56eb38d25f5b09b2337912e570ad426de2b6452a..ad5097d853240e2056be34f10daeef417b40cd70 100644 (file)
@@ -2317,6 +2317,21 @@ static int dd_simnode2pmenode(t_commrec *cr, int sim_nodeid)
     return pmenode;
 }
 
+void get_pme_nnodes(const gmx_domdec_t *dd,
+                    int *npmenodes_x, int *npmenodes_y)
+{
+    if (dd != NULL)
+    {
+        *npmenodes_x = dd->comm->npmenodes_x;
+        *npmenodes_y = dd->comm->npmenodes_y;
+    }
+    else
+    {
+        *npmenodes_x = 1;
+        *npmenodes_y = 1;
+    }
+}
+
 gmx_bool gmx_pmeonlynode(t_commrec *cr, int sim_nodeid)
 {
     gmx_bool bPMEOnlyNode;
index 471117b04394d18e110547991d643664d27de93f..eebec5963ff21b506894c643cdc959fc2a506e72 100644 (file)
@@ -1092,11 +1092,8 @@ nbnxn_atomdata_reduce_reals_simd(real * gmx_restrict dest,
 /* The SIMD width here is actually independent of that in the kernels,
  * but we use the same width for simplicity (usually optimal anyhow).
  */
-#if GMX_NBNXN_SIMD_BITWIDTH == 128
-#define GMX_MM128_HERE
-#endif
-#if GMX_NBNXN_SIMD_BITWIDTH == 256
-#define GMX_MM256_HERE
+#ifdef GMX_NBNXN_HALF_WIDTH_SIMD
+#define GMX_USE_HALF_WIDTH_SIMD_HERE
 #endif
 #include "gmx_simd_macros.h"
 
@@ -1129,9 +1126,6 @@ nbnxn_atomdata_reduce_reals_simd(real * gmx_restrict dest,
             gmx_store_pr(dest+i, dest_SSE);
         }
     }
-
-#undef GMX_MM128_HERE
-#undef GMX_MM256_HERE
 #endif
 }
 
index b0eaf2e459aa96b9514415cc461e1259f12c8474..7ae17fd5ce5b3a70f7904380b7e24936f6204d72 100644 (file)
@@ -106,14 +106,8 @@ typedef struct {
 } nbnxn_grid_t;
 
 #ifdef GMX_NBNXN_SIMD
-#if GMX_NBNXN_SIMD_BITWIDTH == 128
-#define GMX_MM128_HERE
-#else
-#if GMX_NBNXN_SIMD_BITWIDTH == 256
-#define GMX_MM256_HERE
-#else
-#error "unsupported GMX_NBNXN_SIMD_BITWIDTH"
-#endif
+#ifdef GMX_NBNXN_HALF_WIDTH_SIMD
+#define GMX_USE_HALF_WIDTH_SIMD_HERE
 #endif
 #include "gmx_simd_macros.h"
 
@@ -181,9 +175,6 @@ static gmx_icell_set_x_t icell_set_x_supersub;
 static gmx_icell_set_x_t icell_set_x_supersub_sse8;
 #endif
 
-#undef GMX_MM128_HERE
-#undef GMX_MM256_HERE
-
 /* Local cycle count struct for profiling */
 typedef struct {
     int          count;
index d5113abdbe69ef9eddf9b5a10836049590837296..520aa7368aa98d3c4cbf5455783e1afdb97b61ac 100644 (file)
@@ -3032,29 +3032,59 @@ static pme_spline_work_t *make_pme_spline_work(int order)
     return work;
 }
 
-static void
-gmx_pme_check_grid_restrictions(FILE *fplog, char dim, int nnodes, int *nk)
+void gmx_pme_check_restrictions(int pme_order,
+                                int nkx, int nky, int nkz,
+                                int nnodes_major,
+                                int nnodes_minor,
+                                gmx_bool bUseThreads,
+                                gmx_bool bFatal,
+                                gmx_bool *bValidSettings)
 {
-    int nk_new;
-
-    if (*nk % nnodes != 0)
+    if (pme_order > PME_ORDER_MAX)
     {
-        nk_new = nnodes*(*nk/nnodes + 1);
+        if (!bFatal)
+        {
+            *bValidSettings = FALSE;
+            return;
+        }
+        gmx_fatal(FARGS, "pme_order (%d) is larger than the maximum allowed value (%d). Modify and recompile the code if you really need such a high order.",
+                  pme_order, PME_ORDER_MAX);
+    }
 
-        if (2*nk_new >= 3*(*nk))
+    if (nkx <= pme_order*(nnodes_major > 1 ? 2 : 1) ||
+        nky <= pme_order*(nnodes_minor > 1 ? 2 : 1) ||
+        nkz <= pme_order)
+    {
+        if (!bFatal)
         {
-            gmx_fatal(FARGS, "The PME grid size in dim %c (%d) is not divisble by the number of nodes doing PME in dim %c (%d). The grid size would have to be increased by more than 50%% to make the grid divisible. Change the total number of nodes or the number of domain decomposition cells in x or the PME grid %c dimension (and the cut-off).",
-                      dim, *nk, dim, nnodes, dim);
+            *bValidSettings = FALSE;
+            return;
         }
+        gmx_fatal(FARGS, "The PME grid sizes need to be larger than pme_order (%d) and for dimensions with domain decomposition larger than 2*pme_order",
+                  pme_order);
+    }
 
-        if (fplog != NULL)
+    /* Check for a limitation of the (current) sum_fftgrid_dd code.
+     * We only allow multiple communication pulses in dim 1, not in dim 0.
+     */
+    if (bUseThreads && (nkx < nnodes_major*pme_order &&
+                        nkx != nnodes_major*(pme_order - 1)))
+    {
+        if (!bFatal)
         {
-            fprintf(fplog, "\nNOTE: The PME grid size in dim %c (%d) is not divisble by the number of nodes doing PME in dim %c (%d). Increasing the PME grid size in dim %c to %d. This will increase the accuracy and will not decrease the performance significantly on this number of nodes. For optimal performance change the total number of nodes or the number of domain decomposition cells in x or the PME grid %c dimension (and the cut-off).\n\n",
-                    dim, *nk, dim, nnodes, dim, nk_new, dim);
+            *bValidSettings = FALSE;
+            return;
         }
+        gmx_fatal(FARGS, "The number of PME grid lines per node along x is %g. But when using OpenMP threads, the number of grid lines per node along x should be >= pme_order (%d) or = pmeorder-1. To resolve this issue, use less nodes along x (and possibly more along y and/or z) by specifying -dd manually.",
+                  nkx/(double)nnodes_major, pme_order);
+    }
 
-        *nk = nk_new;
+    if (bValidSettings != NULL)
+    {
+        *bValidSettings = TRUE;
     }
+
+    return;
 }
 
 int gmx_pme_init(gmx_pme_t *         pmedata,
@@ -3197,37 +3227,14 @@ int gmx_pme_init(gmx_pme_t *         pmedata,
     pme->pme_order   = ir->pme_order;
     pme->epsilon_r   = ir->epsilon_r;
 
-    if (pme->pme_order > PME_ORDER_MAX)
-    {
-        gmx_fatal(FARGS, "pme_order (%d) is larger than the maximum allowed value (%d). Modify and recompile the code if you really need such a high order.",
-                  pme->pme_order, PME_ORDER_MAX);
-    }
-
-    /* Currently pme.c supports only the fft5d FFT code.
-     * Therefore the grid always needs to be divisible by nnodes.
-     * When the old 1D code is also supported again, change this check.
-     *
-     * This check should be done before calling gmx_pme_init
-     * and fplog should be passed iso stderr.
-     *
-       if (pme->ndecompdim >= 2)
-     */
-    if (pme->ndecompdim >= 1)
-    {
-        /*
-           gmx_pme_check_grid_restrictions(pme->nodeid==0 ? stderr : NULL,
-                                        'x',nnodes_major,&pme->nkx);
-           gmx_pme_check_grid_restrictions(pme->nodeid==0 ? stderr : NULL,
-                                        'y',nnodes_minor,&pme->nky);
-         */
-    }
-
-    if (pme->nkx <= pme->pme_order*(pme->nnodes_major > 1 ? 2 : 1) ||
-        pme->nky <= pme->pme_order*(pme->nnodes_minor > 1 ? 2 : 1) ||
-        pme->nkz <= pme->pme_order)
-    {
-        gmx_fatal(FARGS, "The PME grid sizes need to be larger than pme_order (%d) and for dimensions with domain decomposition larger than 2*pme_order", pme->pme_order);
-    }
+    /* If we violate restrictions, generate a fatal error here */
+    gmx_pme_check_restrictions(pme->pme_order,
+                               pme->nkx, pme->nky, pme->nkz,
+                               pme->nnodes_major,
+                               pme->nnodes_minor,
+                               pme->bUseThreads,
+                               TRUE,
+                               NULL);
 
     if (pme->nnodes > 1)
     {
@@ -3285,14 +3292,12 @@ int gmx_pme_init(gmx_pme_t *         pmedata,
                       pme->nky,
                       (div_round_up(pme->nkx, pme->nnodes_major)+pme->pme_order+1)*pme->nkz);
 
-    /* Check for a limitation of the (current) sum_fftgrid_dd code.
-     * We only allow multiple communication pulses in dim 1, not in dim 0.
+    /* Double-check for a limitation of the (current) sum_fftgrid_dd code.
+     * Note that gmx_pme_check_restrictions checked for this already.
      */
-    if (pme->bUseThreads && (pme->overlap[0].noverlap_nodes > 1 ||
-                             pme->nkx < pme->nnodes_major*pme->pme_order))
+    if (pme->bUseThreads && pme->overlap[0].noverlap_nodes > 1)
     {
-        gmx_fatal(FARGS, "The number of PME grid lines per node along x is %g. But when using OpenMP threads, the number of grid lines per node along x and should be >= pme_order (%d). To resolve this issue, use less nodes along x (and possibly more along y and/or z) by specifying -dd manually.",
-                  pme->nkx/(double)pme->nnodes_major, pme->pme_order);
+        gmx_incons("More than one communication pulse required for grid overlap communication along the major dimension while using threads");
     }
 
     snew(pme->bsp_mod[XX], pme->nkx);
index 72251d78bbe2b7a4ac85f39245c8bb637c3bd3ee..e0797cdc0026302c5b77b8c3e11d4e6ece1c73f3 100644 (file)
@@ -1115,6 +1115,16 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         }
     }
 
+    if (inputrec->bRot)
+    {
+        /* Enforced rotation has its own cycle counter that starts after the collective
+         * coordinates have been communicated. It is added to ddCyclF to allow
+         * for proper load-balancing */
+        wallcycle_start(wcycle, ewcROT);
+        do_rotation(cr, inputrec, box, x, t, step, wcycle, bNS);
+        wallcycle_stop(wcycle, ewcROT);
+    }
+
     /* Start the force cycle counter.
      * This counter is stopped in do_forcelow_level.
      * No parallel communication should occur while this counter is running,
@@ -1423,6 +1433,14 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                                f, vir_force, mdatoms, enerd, lambda, t);
     }
 
+    /* Add the forces from enforced rotation potentials (if any) */
+    if (inputrec->bRot)
+    {
+        wallcycle_start(wcycle, ewcROTadd);
+        enerd->term[F_COM_PULL] += add_rot_forces(inputrec->rot, f, cr, step, t);
+        wallcycle_stop(wcycle, ewcROTadd);
+    }
+
     if (PAR(cr) && !(cr->duty & DUTY_PME))
     {
         /* In case of node-splitting, the PP nodes receive the long-range
index c8fc514a29c8e8164e3ddb5c41cc697bd5085f5e..1999e231a7bede73295de577652d71acce18e72c 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #ifndef        _alert_bm
index 890a47fc89bc362b9de8beb0566b716a72f9e72a..44b8660038b9e87e902b1a6e839d66ab517fda38 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #ifndef        _ff_bm
index 75c945205635b2a3b3fdb9c9527d76ccdb809f79..080981ca3b5cd647eb0f09f5f1988543dc8859bf 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 
index 29f9d3dd57901a99a4be4784d58c1cfc50a3047f..9fbc7d74ec05a462b2f992e3f94911f4b1110eb6 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #ifndef        _info_bm
index 2ec81bdf199cfed15f916baf9dd60958c788480e..a34bc3ced910e7c2ab46dde773891540ae8a287e 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #ifndef        _play_bm
index d17fc4ca8a7053902210cd24282cb497f599a876..eca879327d3e7c5039e72270a5d9850332c80b73 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #define rama_width 48
index 6dae47064676280df362ce0d0cf6bb71bbb4aaf5..e25a18343748a17e3f34f758f14bc29593b99ecd 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifndef        _rewind_bm
 #define        _rewind_bm
index a89ee0d15cf49423f5eba344b4dfe5fa3e20a7e8..a51d36cd1e65deff45c72a4ddd2ebc9e1a6777b1 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #ifndef        _stop_bm
index 03a0ee3d0b1984923839ebc2ba83d5212171c15c..21adc155181d3b73bb076cffae8d4529034fdf64 100644 (file)
@@ -1,36 +1,39 @@
 /*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.0
- * 
+ * This file is part of the GROMACS molecular simulation package.
+ *
  * Copyright (c) 1991-2001
  * BIOSON Research Institute, Dept. of Biophysical Chemistry
  * University of Groningen, The Netherlands
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
  * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
- * 
- * And Hey:
- * GROup of MAchos and Cynical Suckers
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 
 #ifndef        _stop_ani_bm
index 955412bc3d9a56c40f2454cc806267913af2aa8b..c21c10748feec79938127cc05c15958dacdc6a00 100644 (file)
@@ -1,36 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index b7f761d34a5db4ed3dcf25b9aa93ae7d080aaa30..8fde2e00cb971377de01d997b33c7bd7a24f1a91 100644 (file)
@@ -1,37 +1,39 @@
-/*  -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
+/*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index c614bc6c952b28b1745d2d91bdf600908671117b..a2b2d530afeae0c1d411f8085917f47b9f71a9a0 100644 (file)
@@ -135,6 +135,7 @@ static void find_tetra_order_grid(t_topology top, int ePBC,
     snew(skmol, maxidx);
 
     /* Must init pbc every step because of pressure coupling */
+    set_pbc(&pbc,ePBC,box);
     gpbc = gmx_rmpbc_init(&top.idef, ePBC, natoms, box);
     gmx_rmpbc(gpbc, natoms, box, x);
 
index 0a997a833681a0340ffaf9f8a3f28c0a1e9ad624..dc45d44530f0c423a4acc7107e6776b300f9d6be 100644 (file)
@@ -1,35 +1,40 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
  *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- *
- * The make_edi program was generously contributed by Oliver Lange, based
- * on the code from g_anaeig. You can reach him as olange@gwdg.de.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Gromacs Runs One Microsecond At Cannonball Speeds
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/* The make_edi program was generously contributed by Oliver Lange, based
+ * on the code from g_anaeig. You can reach him as olange@gwdg.de. He
+ * probably also holds copyright to the following code.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index e67344a79211af3c0217257255f4ad3e4dea2fb6..6a61a73b36b656d76ea2831cfc552f69e69ca40d 100644 (file)
@@ -1,36 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 886b375724640aa45abc426ffb99b01c25a7fe4e..29578486186a88bae51363747bdeab7949f90f7c 100644 (file)
@@ -1,36 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 9a871fb6c1bdd17d7dc99c2b6a7504a64c0c28f7..2a8db0871ce574f76c0b593fc92a40f74cfa317c 100644 (file)
@@ -1,36 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Good gRace! Old Maple Actually Chews Slate
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>
index 26ce46528a8517936a5ddffbc4cf4b6fc1b72eda..9764a02cb45a146e4c88fcd68343f736d7c7495f 100644 (file)
@@ -1,36 +1,39 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team,
  * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2012, by the GROMACS development team, led by
+ * David van der Spoel, Berk Hess, Erik Lindahl, and including many
+ * others, as listed in the AUTHORS file in the top-level source
+ * directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
  */
 #ifdef HAVE_CONFIG_H
 #include <config.h>