Merge branch release-2016
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 9 May 2017 11:06:37 +0000 (13:06 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 9 May 2017 16:09:39 +0000 (18:09 +0200)
Change-Id: I4c632a9ac632f73afe4e9ac43f31dcc5f4b520fc

admin/builds/gromacs.py
admin/builds/post-submit-matrix.txt
admin/builds/pre-submit-matrix.txt
cmake/gmxManageSimd.cmake
src/contrib/fftw/CMakeLists.txt
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.cpp
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.cpp
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_simd4_double.h

index 659d0b61283d02ba42e670f29de1c0710eccd481..c517f5fdd347c1becfb131e4508cbe713c30e696 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -34,6 +34,8 @@
 
 import os.path
 
+# These are accessible later in the script, just like other
+# declared options, via e.g. context.opts.release.
 extra_options = {
     'mdrun-only': Option.simple,
     'static': Option.simple,
@@ -47,8 +49,12 @@ extra_options = {
     'thread-mpi': Option.bool,
     'gpu': Option.bool,
     'opencl': Option.bool,
-    'openmp': Option.bool
+    'openmp': Option.bool,
+    'nranks': Option.string,
+    'npme': Option.string,
+    'gpu_id': Option.string
 }
+
 extra_projects = [Project.REGRESSIONTESTS]
 
 def do_build(context):
@@ -182,19 +188,21 @@ def do_build(context):
                 # not explicitly set
                 cmd += ' -ntomp 2'
 
-            if context.opts.gpu:
-                if context.opts.mpi or use_tmpi:
-                    gpu_id = '01' # for (T)MPI use the two GT 640-s
-                else:
-                    gpu_id = '0' # use GPU #0 by default
-                cmd += ' -gpu_id ' + gpu_id
+            if context.opts.gpu_id:
+                cmd += ' -gpu_id ' + context.opts.gpu_id
+
+            if context.opts.nranks:
+                nranks = context.opts.nranks
+            else:
+                nranks = '2'
+
+            if context.opts.npme:
+                cmd += ' -npme ' + context.opts.npme
 
-            # TODO: Add options to influence this (should be now local to the build
-            # script).
             if context.opts.mpi:
-                cmd += ' -np 2'
+                cmd += ' -np ' + nranks
             elif use_tmpi:
-                cmd += ' -nt 2'
+                cmd += ' -nt ' + nranks
             if context.opts.double:
                 cmd += ' -double'
             if context.opts.asan:
index 2c9bdae79655aaad22ac4d47a74861043075f5d1..69e94ad41a232664e8e8a3526ae0a32a6e1ce958 100644 (file)
@@ -1,35 +1,42 @@
-gcc-4.4 double no-openmp host=bs_centos63
-clang-3.4 gmxtest+"-npme 1 -nt 3" double no-openmp fftpack release host=bs_centos63
-clang-3.4 double no-openmp fftpack asan host=bs_centos63
-gcc-4.1 double no-openmp simd-sse2 host=bs_nix1004
-gcc-4.3 mpi simd-sse2 host=bs_nix1004
-gcc-4.5 no-openmp atlas mpi host=bs_nix64
-icc-12.1.2 no-openmp no-threadmpi host=bs_nix64
-gcc-4.7 no-openmp host=bs_nix64
-icc-12.1.2 double mkl release host=bs_nix64
-gcc-4.7 double no-threadmpi simd-sse4.1 release host=bs_nix64
-icc-15.0.0 gmxtest+"-ntomp 1" no-threadmpi host=bs_mac
-gcc-4.8 no-openmp no-threadmpi fftpack optimized host=bs_mac
-gcc-4.9 optimized host=bs_mac
-icc-14.0.3 Platform=Phi host=bs_mic
-icc-14.0.3 Platform=Phi optimized host=bs_mic
-clang-3.4 asan host=bs_mic
-msvc-2010 release host=bs_Win2008_64
-msvc-2010 double no-threadmpi fftpack cmake+GMX_PREFER_STATIC_LIBS=OFF release host=bs_Win2008_64
-icc-12.1.2 cmake+GMX_DLOPEN=OFF no-threadmpi fftpack release host=bs_Win2008_64
-clang-3.6 double no-openmp fftpack host=bs_nix1204
-gcc-4.7 gmxtest+"-nt 1" gpu cuda-4.2 double simd-sse4.1 host=bs_nix1204
-gcc-4.4 gpu cuda-4.0 mpi simd-avx_256 host=bs_nix1204
-gcc-4.5 gpu cuda-4.1 atlas mpi simd-sse4.1 host=bs_nix1204
-gcc-4.6 gpu cuda-5.0 no-threadmpi release host=bs_nix1204
-gcc-4.7 gpu cuda-5.5 atlas simd-sse2 release host=bs_nix1204
-gcc-4.4 double mpi simd-avx_256 host=bs_nix1310
-gcc-4.6 double no-threadmpi simd-avx_256 release host=bs_nix1310
-gcc-4.7 gmxtest+"-npme 1 -np 3" no-threadmpi mpi simd-avx2_256 release host=bs_nix1310
-gcc-4.7 gmxtest+"-npme 1 -nt 3 -gpu_id 12" gpu cuda-5.5 simd-sse4.1 release host=bs_nix1310
-clang-3.4 gmxtest+"-npme 1 -nt 3" double no-openmp simd-avx_256 release host=bs_nix1310
-gcc-4.9 tsan host=bs_nix1310
-gcc-4.9 double no-threadmpi optimized host=bs_nix1404
-gcc-4.7 double gmxtest+"-nt 1" host=bs_nix1404
-gcc-5.1 gmxtest+"-npme 1 -np 3" double no-threadmpi mpi host=bs_nix1404
-gcc-5.1 mpi release host=bs_nix1404
+# Comment line(s) preceding each configuration document the main
+# intent behind that configuration, so that we can correctly judge
+# whether to preserve that during maintenance decisions.
+
+# Test the mdrun-only build
+# TODO In combination with gmx from another build, arrange to run regressiontests
+clang-3.7 double mpi no-openmp fftpack mdrun-only
+
+# Test MPMD PME with thread-MPI
+# TODO Add double to this configuration if/when Carsten stablizes essentialdynamics tests
+gcc-5.2 npme=1 nranks=2 no-openmp fftpack simd=avx_128_fma release
+
+# Test non-default GMX_PREFER_STATIC_LIBS behavior
+# TODO enable this
+# msvc-2015 double no-threadmpi no-prefer-static-libs release
+
+# Test behaviour when dlopen is not present
+# TODO enable this
+# icc-16.0 no-dlopen no-threadmpi double mkl release
+
+# Test SSE4.1 SIMD
+# Test single-rank GPU
+gcc-4.8 nranks=1 gpu cuda-7.5 simd=sse4.1
+
+# Test MPMD PME with library MPI
+clang-3.4 npme=1 nranks=2 mpi
+
+# Test non-default use of mdrun -gpu_id
+# Test SSE2 SIMD
+gcc-4.8 gpu npme=1 nranks=2 gpu_id=2 cuda-7.5 simd=sse2 release
+
+# TODO
+# Re-enable Phi build
+# Test without TNG support
+# Test without hwloc support
+# Test with NVML support
+# Test statically linked hwloc support (if/when it can work well)
+# Test 3D DD (2D is partially covered in regressiontests)
+# Test own-fftw build (from local copy of the file)
+# Test mdrun -tunepme (e.g. with relaxed tolerances, for now)
+# Consider testing of other CMake option paths
+# Consider adding our ARM dev boards as slaves to improve cross-platform portability testing.
index 68f051ce69d279c41c455309e884674801ebc025..7e9cb67fa8d96fdc6cc869d5fb262d069964e0c1 100644 (file)
@@ -1,14 +1,77 @@
-gcc-4.8 gpu cuda-6.5 mpi openmp x11
-gcc-4.8 gpu cuda-8.0 openmp release
+# Comment line(s) preceding each configuration document the main
+# intent behind that configuration, so that we can correctly judge
+# whether to preserve that during maintenance decisions.
+#
+# The phrase "at time of release" refers to either the initial
+# GROMACS release from that branch, or the next expected release
+# from that branch. (We will tend not to retroactively support
+# newer infrastructure in CI, unless it's either easy or of
+# high impact.)
+
+# Test older gcc
+# Test oldest supported CUDA
+# Test oldest supported Ubuntu
+# Test X11 build
+# Test MPI with CUDA
+# Test MPMD PME with library MPI
+gcc-4.8 gpu cuda-6.5 mpi npme=1 nranks=2 openmp x11
+
+# Test newest gcc supported by newest CUDA at time of release
+# Test thread-MPI with CUDA
+gcc-5.4 gpu cuda-8.0 openmp release
+
+# Test with ThreadSanitizer (without OpenMP, because of Redmine #1850)
+# Test AVX2_256 SIMD
+# Test fftpack fallback
 gcc-4.9 tsan fftpack simd=avx2_256
+
+# Test newest gcc at time of release
+# Test on MacOS
 gcc-6.1 double
+
+# Test older clang
+# Test double precision
+# Test without OpenMP
 clang-3.4 double no-openmp fftpack
-clang-3.8 no-openmp asan cmake-3.4.3
-# TODO move mdrun-only config to post-submit matrix
-clang-3.7 double mpi no-openmp fftpack mdrun-only cmake-3.4.3
+
+# Test newer clang
+# Test with AddressSanitizer
+clang-3.8 no-openmp asan
+
+# Test oldest supported MSVC on Windows
+# Test newest supported MSVC on Windows
 msvc-2015 openmp release
+
+# Test oldest supported icc on Windows
+# Test newest supported icc on Windows
 icc-16.0 msvc-2015 fftpack
-icc-16.0 no-thread-mpi openmp mkl simd=avx_256
-gcc-5.1 mpi openmp cmake-3.4.3
-gcc-4.8 openmp opencl cuda-8.0 mpi release
-gcc-5.2 openmp opencl simd=avx_128_fma amdappsdk-3.0
+
+# Test newest cmake at time of release
+# Test MKL
+# Test without any MPI
+# Test on CentOS
+icc-16.0 no-thread-mpi openmp mkl cmake-3.6.1 simd=avx_256
+
+# Test oldest supported cmake
+# Test AVX_128_FMA SIMD
+gcc-5.2 mpi openmp simd=avx_128_fma cmake-3.4.3
+
+# Test NVIDIA OpenCL
+# Test MPI + OpenCL
+gcc-4.8 openmp opencl cuda-7.5 mpi release
+
+# Test AMD OpenCL
+gcc-5.2 openmp opencl amdappsdk-3.0
+
+# TODO
+# Add testing for support for cmake 3.8 for release-2017, e.g. to bs_mic and a CUDA slave (for the new CUDA support)
+# Add testing for support for clang 4.0 for release-2017, and move e.g. ASAN build to it, e.g. to bs_nix-amd
+# Add testing for support for gcc 7 for release-2017, e.g. to bs_mac
+# Add OpenMP support to a clang build
+# Add OpenMP support to ASAN build
+# Test hwloc support
+# Test newest supported LTS Ubuntu
+# Migrate ThreadSanitizer test off GPU build slave
+# Explore adding openmp to ThreadSanitizer configuration, perhaps can avoid Redmine #1850 if done differently
+# Update gcc and clang specifiers per https://redmine.gromacs.org/issues/2161
+# Update gpu testing specifiers per https://redmine.gromacs.org/issues/2161
index 5b34c289dd5d5d1a02d07176be25da5755cb2c48..c0d14c2281eaa24733acae44f217a243e4e73fff 100644 (file)
@@ -310,7 +310,7 @@ elseif(GMX_SIMD STREQUAL "AVX_512")
          int main(){__m512 y,x=_mm512_set1_ps(0.5);y=_mm512_fmadd_ps(x,x,x);return (int)_mm512_cmp_ps_mask(x,y,_CMP_LT_OS);}"
         TOOLCHAIN_C_FLAGS TOOLCHAIN_CXX_FLAGS
         SIMD_${GMX_SIMD}_C_FLAGS SIMD_${GMX_SIMD}_CXX_FLAGS
-        "-xMIC-AVX512" "-mavx512f -mfma" "-mavx512f" "/arch:AVX" "-hgnu") # no AVX_512F flags known for MSVC yet
+        "-xCORE-AVX512" "-mavx512f -mfma" "-mavx512f" "/arch:AVX" "-hgnu") # no AVX_512F flags known for MSVC yet
 
     if(NOT SIMD_${GMX_SIMD}_C_FLAGS OR NOT SIMD_${GMX_SIMD}_CXX_FLAGS)
         gmx_give_fatal_error_when_simd_support_not_found("AVX 512F" "choose a lower level of SIMD (slower)" "${SUGGEST_BINUTILS_UPDATE}")
index 8432df588fdb37a8b36c8125605184d0d28091d3..2037f62ec2ec6e075bc756a1bec6b834f410a3c1 100644 (file)
@@ -73,11 +73,14 @@ elseif(${GMX_SIMD} MATCHES "^(AVX)")
     # Support for --enable-avx2 was only added in 3.3.5, but
     # configuring with it is at worst a warning, even on an earlier
     # version.
-if((CMAKE_COMPILER_IS_GNUCC AND (C_COMPILER_VERSION VERSION_GREATER 4.9 OR CXX_COMPILER_VERSION VERSION_GREATER 4.9)) OR
-   (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (C_COMPILER_VERSION VERSION_GREATER 3.9 OR CXX_COMPILER_VERSION VERSION_GREATER 3.9)))
-    set(_fftw_simd_support_level --enable-sse2;--enable-avx;--enable-avx2;--enable-avx512)
-elseif()
+    # MSVC, GCC < 4.9, Clang < 3.9, and ICC < 15.0.1 do not support AVX-512, so
+    # we should not enable it.
+if(MSVC OR (CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9.0) OR
+   (CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.9.0) OR
+   (CMAKE_C_COMPILER_ID MATCHES "Intel" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.1))
     set(_fftw_simd_support_level --enable-sse2;--enable-avx;--enable-avx2)
+else()
+    set(_fftw_simd_support_level --enable-sse2;--enable-avx;--enable-avx2;--enable-avx512)
 endif()
 elseif(${GMX_SIMD} MATCHES "^(VSX)")
     set(_fftw_simd_support_level --enable-vsx)
index 987206eec811cd15df8efd2e2e406b484504b4fd..0f97061d86603c156ad83bcbc79b1ccd827a4b47 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -277,7 +277,7 @@ nbnxn_kernel_simd_2xnn(nbnxn_pairlist_set_t      gmx_unused *nbl_list,
     int                nnbl;
     nbnxn_pairlist_t **nbl;
     int                coulkt, vdwkt = 0;
-    int                nb, nthreads;
+    int                nb, nthreads gmx_unused;
 
     nnbl = nbl_list->nnbl;
     nbl  = nbl_list->nbl;
index 6d3c057d4088750375b883b6f479260cecf1c7d9..ac30b0b0ef516c909f1ca107cdaada3820154334 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
     gatherLoadUBySimdIntTranspose<1>(tab_coul_V, ti_S0, &ctabv_S0, &dum_S0);
     gatherLoadUBySimdIntTranspose<1>(tab_coul_F, ti_S2, &ctab0_S2, &ctab1_S2);
     gatherLoadUBySimdIntTranspose<1>(tab_coul_V, ti_S2, &ctabv_S2, &dum_S2);
+    ctab1_S0 = ctab1_S0 - ctab0_S0;
+    ctab1_S2 = ctab1_S2 - ctab0_S2;
 #endif
 #endif
     fsub_S0     = fma(frac_S0, ctab1_S0, ctab0_S0);
index 61c00d6e46f3470225617b1471d7b3219c76ef76..8f062dfc312444f49235d47802ef31fca3676aa0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -276,7 +276,7 @@ nbnxn_kernel_simd_4xn(nbnxn_pairlist_set_t      gmx_unused *nbl_list,
     int                nnbl;
     nbnxn_pairlist_t **nbl;
     int                coulkt, vdwkt = 0;
-    int                nb, nthreads;
+    int                nb, nthreads gmx_unused;
 
     nnbl = nbl_list->nnbl;
     nbl  = nbl_list->nbl;
index 917a7883a8d9a9ef2f72177291de47dce19c09a2..70d312f744b467b7631a1c4d0d6689d154c9c753 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -258,7 +258,7 @@ trunc(Simd4Double x)
     };
 }
 
-static inline float gmx_simdcall
+static inline double gmx_simdcall
 dotProduct(Simd4Double a, Simd4Double b)
 {
     __m128d tmp1, tmp2;
@@ -361,7 +361,7 @@ blend(Simd4Double a, Simd4Double b, Simd4DBool sel)
     };
 }
 
-static inline float gmx_simdcall
+static inline double gmx_simdcall
 reduce(Simd4Double a)
 {
     __m128d a0, a1;