Require 2015 version for MSVC
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 16 Feb 2016 22:29:17 +0000 (23:29 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 10 Mar 2016 12:41:09 +0000 (13:41 +0100)
C++11 support is best in this compiler in its latest version, which is
an acceptable compromise for this platform.

This is not good for a CUDA build, which won't officially support MSVC
2015 until CUDA 8, which is unlikely to be released before GROMACS
2016. Thus, there is likely to be a few months where CUDA-enabled
GROMACS 2016 cannot be built by a supported MSVC host compiler.

MSVC 2015 adds warnings for illegal implicit narrowing of double to
float, when used in a brace initializer. In some cases
* we intend the interpretation as real, which is now explicit
* we can just use double
* we can suppress the warning
* in some test code, it is more convenient to initialize as double and copy

Change-Id: Ic6b2f9165b6f1aaa3dc59ce05cd6ffb3abe8861c

17 files changed:
CMakeLists.txt
admin/builds/pre-submit-matrix.txt
docs/dev-manual/language-features.rst
docs/install-guide/index.rst
src/gromacs/fft/tests/fft.cpp
src/gromacs/fileio/oenv.cpp
src/gromacs/fileio/rgb.h
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/hxprops.cpp
src/gromacs/gmxpreprocess/calch.cpp
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/math/tests/invertmatrix.cpp
src/gromacs/mdlib/tests/settle.cpp
src/gromacs/random/tabulatednormaldistribution.cpp
src/gromacs/random/tabulatednormaldistribution.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_simd_double.h
src/gromacs/utility/basedefinitions.h

index f70c940baacbdedcaaf9c7e6acc852101f19e29e..d70b099aeb54b135e320663799a6619c6095a783 100644 (file)
@@ -193,9 +193,9 @@ gmx_add_cache_dependency(GMX_COOL_QUOTES BOOL "NOT GMX_FAHCORE" OFF)
 option(GMX_USE_OPENCL "Enable OpenCL acceleration" OFF)
 
 # Decide on GPU settings based on user-settings and GPU/CUDA detection.
-# GCC 4.6 requires CUDA 5.0 and VS2013 requires CUDA 6.5
+# GCC 4.6 requires CUDA 5.0 and VS2015 requires CUDA 8.0
 if(MSVC)
-    set(REQUIRED_CUDA_VERSION 6.5)
+    set(REQUIRED_CUDA_VERSION 8.0)
 else()
     set(REQUIRED_CUDA_VERSION 5.0)
 endif()
index efe73e751ee14ed6292df6a77c7a68ecaba70902..071ef56aa94bb4e8e234d29bb1715a667734788a 100644 (file)
@@ -5,7 +5,7 @@ gcc-5.1 double mpi
 clang-3.4 double no-openmp fftpack asan
 # TODO move mdrun-only config to post-submit matrix
 clang-3.7 double no-openmp fftpack mdrun-only
-msvc-2013 openmp release
+msvc-2015 openmp release
 icc-16.0 msvc-2015 fftpack
 icc-16.0 openmp mkl cmake-3.3.2 simd=avx_256
 gcc-5.2 openmp simd=avx_128_fma
index ceb0e3477474afee24091103c45f37819dbc736c..d4d3a9edd8b216fb0e464a3c72eef47b7c1255c7 100644 (file)
@@ -11,7 +11,7 @@ these standards fully.
 * MSVC supports only a subset of C99 and work-arounds are required in those cases.
 * Before 7.0 (partial support in 6.5) CUDA didn't support C++11. Therefore any
   header file which is needed (or likly will be nedded) by CUDA should not use C++11.
-* C++11 features which are not widely implemented (including in MSVC 2013 and GCC 4.6)
+* C++11 features which are not widely implemented (including in MSVC 2015 and GCC 4.6)
   should not be used.
 
 .. TODO: Copy important points from http://www.gromacs.org/index.php?title=Developer_Zone/Programming_Guide/Allowed_C%2B%2B_Features
index ecda804883ce30b871b1554e80ac48584ae858e8..cb3ce2a7cf59053d30f660c7c604b48f0f6d5816 100644 (file)
@@ -110,7 +110,7 @@ supported by the compiler. To select the C++ library version use:
 * For clang: ``CFLAGS=--gcc-toolchain=/path/to/gcc/folder
   CXXFLAGS=--gcc-toolchain=/path/to/gcc/folder``. This folder should
   contain ``include/c++``.
-* On Windows with e.g. Intel: at least MSVC 2013 is required. Load the
+* On Windows with e.g. Intel: at least MSVC 2015 is required. Load the
   enviroment with vcvarsall.bat.
 
 For best performance, the |Gromacs| team strongly recommends you get the
@@ -203,6 +203,11 @@ minimum OpenCL version required is |REQUIRED_OPENCL_MIN_VERSION|.
 It is not possible to configure both CUDA and OpenCL support in the
 same version of |Gromacs|.
 
+Please note that MSVC 2015 is the earliest version of MSVC supported
+by |Gromacs|, but that requires at least CUDA 8 for an officially
+supported CUDA build. This will likely not occur before |Gromacs| 2016
+is released.
+
 .. _mpi-support:
 
 MPI support
@@ -1171,7 +1176,7 @@ is currently tested on x86 with gcc versions ranging from 4.6 through
 5.1, and versions 14 and 15 of the Intel compiler as well as Clang
 version 3.4 through 3.6. For this, we use a variety of GNU/Linux
 flavors and versions as well as recent versions of Mac OS X and Windows.  Under
-Windows we test both MSVC and the Intel compiler. For details, you can
+Windows we test both MSVC 2015 and the Intel compiler. For details, you can
 have a look at the `continuous integration server used by GROMACS`_,
 which runs Jenkins_.
 
index dfe4dbd3311a2ad01ac646e8c88457340e7b6141..ca0b6d273bf43348d6115deb0d134a2174a2a7ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016, 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.
@@ -46,6 +46,7 @@
 
 #include "gromacs/fft/fft.h"
 
+#include <algorithm>
 #include <vector>
 
 #include <gtest/gtest.h>
 namespace
 {
 
-//! Input data for FFT tests.
-const real inputdata[] = { //print ",\n".join([",".join(["%4s"%(random.randint(-99,99)/10.,) for i in range(25)]) for j in range(20)])
+/*! \brief Input data for FFT tests.
+ *
+ * TODO If we require compilers that all support C++11 user literals,
+ * then this array could be of type real, initialized with e.g. -3.5_r
+ * that does not suffer from implicit narrowing with brace
+ * initializers, and we would not have to do so much useless copying
+ * during the unit tests below.
+ */
+const double inputdata[] = { //print ",\n".join([",".join(["%4s"%(random.randint(-99,99)/10.,) for i in range(25)]) for j in range(20)])
     -3.5, 6.3, 1.2, 0.3, 1.1, -5.7, 5.8, -1.9, -6.3, -1.4, 7.4, 2.4, -9.9, -7.2, 5.4, 6.1, -1.9, -7.6, 1.4, -3.5, 0.7, 5.6, -4.2, -1.1, -4.4,
     -6.3, -7.2, 4.6, -3.0, -0.9, 7.2, 2.5, -3.6, 6.1, -3.2, -2.1, 6.5, -0.4, -9.0, 2.3, 8.4, 4.0, -5.2, -9.0, 4.7, -3.7, -2.0, -9.5, -3.9, -3.6,
     7.1, 0.8, -0.6, 5.2, -9.3, -4.5, 5.9, 2.2, -5.8, 5.0, 1.2, -0.1, 2.2, 0.2, -7.7, 1.9, -8.4, 4.4, 2.3, -2.9, 6.7, 2.7, 5.8, -3.6, 8.9,
@@ -167,9 +175,10 @@ class FFFTest3D : public BaseFFTTest
 TEST_P(FFTTest1D, Complex)
 {
     const int nx = GetParam();
-    ASSERT_LE(nx*2, static_cast<int>(sizeof(inputdata)/sizeof(real)));
+    ASSERT_LE(nx*2, static_cast<int>(sizeof(inputdata)/sizeof(inputdata[0])));
 
-    in_  = std::vector<real>(inputdata, inputdata+nx*2);
+    in_  = std::vector<real>(nx*2);
+    std::copy(inputdata, inputdata+nx*2, in_.begin());
     out_ = std::vector<real>(nx*2);
     real* in  = &in_[0];
     real* out = &out_[0];
@@ -186,9 +195,10 @@ TEST_P(FFTTest1D, Real)
 {
     const int rx = GetParam();
     const int cx = (rx/2+1);
-    ASSERT_LE(cx*2, static_cast<int>(sizeof(inputdata)/sizeof(real)));
+    ASSERT_LE(cx*2, static_cast<int>(sizeof(inputdata)/sizeof(inputdata[0])));
 
-    in_  = std::vector<real>(inputdata, inputdata+cx*2);
+    in_  = std::vector<real>(cx*2);
+    std::copy(inputdata, inputdata+cx*2, in_.begin());
     out_ = std::vector<real>(cx*2);
     real* in  = &in_[0];
     real* out = &out_[0];
@@ -210,7 +220,8 @@ TEST_F(ManyFFTTest, Complex1DLength48Multi5Test)
     const int nx = 48;
     const int N  = 5;
 
-    in_  = std::vector<real>(inputdata, inputdata+nx*2*N);
+    in_  = std::vector<real>(nx*2*N);
+    std::copy(inputdata, inputdata+nx*2*N, in_.begin());
     out_ = std::vector<real>(nx*2*N);
     real* in  = &in_[0];
     real* out = &out_[0];
@@ -229,7 +240,8 @@ TEST_F(ManyFFTTest, Real1DLength48Multi5Test)
     const int cx = (rx/2+1);
     const int N  = 5;
 
-    in_  = std::vector<real>(inputdata, inputdata+cx*2*N);
+    in_  = std::vector<real>(cx*2*N);
+    std::copy(inputdata, inputdata+cx*2*N, in_.begin());
     out_ = std::vector<real>(cx*2*N);
     real* in  = &in_[0];
     real* out = &out_[0];
@@ -248,7 +260,8 @@ TEST_F(FFTTest, Real2DLength18_15Test)
     const int cx = (rx/2+1);
     const int ny = 15;
 
-    in_  = std::vector<real>(inputdata, inputdata+cx*2*ny);
+    in_  = std::vector<real>(cx*2*ny);
+    std::copy(inputdata, inputdata+cx*2*ny, in_.begin());
     out_ = std::vector<real>(cx*2*ny);
     real* in  = &in_[0];
     real* out = &out_[0];
@@ -279,15 +292,24 @@ TEST_F(FFFTest3D, Real5_6_9)
                                       local_ndata, offset, csize);
     checker_.checkVector(rsize, "rsize");
     checker_.checkVector(csize, "csize");
-    int size = csize[0]*csize[1]*csize[2];
-
-    memcpy(rdata, inputdata, size*sizeof(t_complex));
+    int size        = csize[0]*csize[1]*csize[2];
+    int sizeInBytes = size*sizeof(t_complex);
+    int sizeInReals = sizeInBytes/sizeof(real);
+
+    in_  = std::vector<real>(sizeInReals);
+    // Use std::copy to convert from double to real easily
+    std::copy(inputdata, inputdata+sizeInReals, in_.begin());
+    // Use memcpy to convert to t_complex easily
+    memcpy(rdata, in_.data(), sizeInBytes);
     gmx_parallel_3dfft_execute(fft_, GMX_FFT_REAL_TO_COMPLEX, 0, NULL);
     //TODO use std::complex and add checkComplex for it
     checker_.checkSequenceArray(size*2,
                                 reinterpret_cast<real*>(cdata), "forward");
 
-    memcpy(cdata, inputdata, size*sizeof(t_complex));
+    // Use std::copy to convert from double to real easily
+    std::copy(inputdata, inputdata+sizeInReals, in_.begin());
+    // Use memcpy to convert to t_complex easily
+    memcpy(cdata, in_.data(), sizeInBytes);
     gmx_parallel_3dfft_execute(fft_, GMX_FFT_COMPLEX_TO_REAL, 0, NULL);
     for (int i = 0; i < ndata[0]*ndata[1]; i++) //check sequence but skip unused data
     {
index f586190c0f91cb5d184bf24837b6850d6833b6da..a00699208499f533fd58515c998aab96a414fadf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -76,8 +76,8 @@ struct gmx_output_env_t
 
 /* read only time names */
 /* These must correspond to the time units type time_unit_t in oenv.h */
-static const real  timefactors[] =   { 0,  1e3,  1, 1e-3, 1e-6, 1e-9, 1e-12, 0 };
-static const real  timeinvfactors[] = { 0, 1e-3,  1,  1e3,  1e6,  1e9,  1e12, 0 };
+static const real  timefactors[] =   { real(0),  real(1e3),  real(1), real(1e-3), real(1e-6), real(1e-9), real(1e-12), real(0) };
+static const real  timeinvfactors[] = { real(0), real(1e-3),  real(1),  real(1e3),  real(1e6),  real(1e9),  real(1e12), real(0) };
 static const char *time_units_str[] = {
     NULL, "fs", "ps", "ns", "us",
     "\\mus", "ms", "s"
index 6ce4507602d12e63f98ab1e48f3f03633d2c935b..37d375a9c13c35dcd7b119549e7eb1d9baeb26d5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2016, 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.
 #ifndef GMX_FILEIO_RGB_H
 #define GMX_FILEIO_RGB_H
 
-#include "gromacs/utility/real.h"
-
 typedef struct t_rgb {
-    real r, g, b;
+    double r, g, b;
 } t_rgb;
 
 #endif
index 2ff98fe4457416cb917e5b5cc48f020f818c91af..9beba9718e91cdaf8e08d51bb1b7377c2077f618 100644 (file)
@@ -453,6 +453,10 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
                           const gmx_output_env_t *oenv)
 {
     /* also gets 3J couplings and order parameters S2 */
+    // Avoid warnings about narrowing conversions from double to real
+#ifdef _MSC_VER
+#pragma warning(disable: 4838)
+#endif
     t_karplus kkkphi[] = {
         { "J_NHa1",    6.51, -1.76,  1.6, -M_PI/3,   0.0,  0.0 },
         { "J_NHa2",    6.51, -1.76,  1.6,  M_PI/3,   0.0,  0.0 },
@@ -467,6 +471,9 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
         { "JHaHb2",       9.5, -1.6, 1.8, -M_PI/3, 0,  0.0 },
         { "JHaHb3",       9.5, -1.6, 1.8, 0, 0,  0.0 }
     };
+#ifdef _MSC_VER
+#pragma warning(default: 4838)
+#endif
 #define NKKKPHI asize(kkkphi)
 #define NKKKPSI asize(kkkpsi)
 #define NKKKCHI asize(kkkchi1)
index 941fac46621a5b37e3f4d9da8b078d87c52eecd6..e5ee9493d2633d2da91c60078d313ac4f0930067 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -58,7 +58,10 @@ real ellipticity(int nres, t_bb bb[])
     typedef struct {
         real phi, psi, w;
     } t_ppwstr;
-
+    // Avoid warnings about narrowing conversions from double to real
+#ifdef _MSC_VER
+#pragma warning(disable: 4838)
+#endif
     static const t_ppwstr ppw[] = {
         {  -67,  -44,  0.31 },
         {  -66,  -41,  0.31 },
@@ -73,6 +76,9 @@ real ellipticity(int nres, t_bb bb[])
         {  -54,  -28,  0.46 },
         {  -44,  -33,  0.68 }
     };
+#ifdef _MSC_VER
+#pragma warning(default: 4838)
+#endif
 #define NPPW asize(ppw)
 
     int        i, j;
index d4aac2a5b432fb0fa3fd2cac3fd271d2f7e91125..2b0f49f6414e88ae64e7bd26a081f1d224b01d05 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
@@ -64,7 +64,7 @@ static void gen_waterhydrogen(int nh, rvec xa[], rvec xh[], int *l)
 #define AA 0.081649
 #define BB 0.0
 #define CC 0.0577350
-    const  rvec   matrix1[6] = {
+    const  dvec   matrix1[6] = {
         { AA,     BB,     CC },
         { AA,     BB,     CC },
         { AA,     BB,     CC },
@@ -72,7 +72,7 @@ static void gen_waterhydrogen(int nh, rvec xa[], rvec xh[], int *l)
         { -AA,    BB,     CC },
         { BB,     AA,    -CC }
     };
-    const  rvec   matrix2[6] = {
+    const  dvec   matrix2[6] = {
         { -AA,   BB,   CC },
         { BB,    AA,  -CC },
         { BB,   -AA,  -CC },
index 23014ecbcad401066f852d2d2a9ea08bca016a0d..4971ad76cac1a70cfda9c6d9968311fd1c8f5059 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -69,7 +69,7 @@
 char atp[7] = "HCNOSX";
 #define NATP (asize(atp)-1)
 
-real blen[NATP][NATP] = {
+double blen[NATP][NATP] = {
     {  0.00,  0.108, 0.105, 0.10, 0.10, 0.10 },
     {  0.108, 0.15,  0.14,  0.14, 0.16, 0.14 },
     {  0.105, 0.14,  0.14,  0.14, 0.16, 0.14 },
index 5dadb3c2749b2b27c085d1b034ddacc1c88933a8..4021cb65945f4cda3d11a024b2f21825e5cca0ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016, 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.
@@ -80,17 +80,17 @@ TEST(InvertMatrixTest, IdentityIsImpotent)
 
 TEST(InvertMatrixTest, ComputesInverse)
 {
-    matrix in = {{1, 2, 3}, {-1, 2.5, 1}, {10, -2, 1.2}};
+    matrix in = {{1, 2, 3}, {-1, real(2.5), 1}, {10, -2, real(1.2)}};
     matrix out;
-    matrix expected = {{-0.12019230769230768,
-                        0.20192307692307693,
-                        0.13221153846153844},
-                       {-0.26923076923076916,
-                        0.69230769230769229,
-                        0.096153846153846145},
-                       {0.55288461538461531,
-                        -0.52884615384615374,
-                        -0.10817307692307691}};
+    matrix expected = {{real(-0.12019230769230768),
+                        real(0.20192307692307693),
+                        real(0.13221153846153844)},
+                       {real(-0.26923076923076916),
+                        real(0.69230769230769229),
+                        real(0.096153846153846145)},
+                       {real(0.55288461538461531),
+                        real(-0.52884615384615374),
+                        real(-0.10817307692307691)}};
 
     invertMatrix(in, out);
 
@@ -124,10 +124,10 @@ TEST(InvertBoxMatrixTest, IdentityIsImpotent)
 
 TEST(InvertBoxMatrixTest, ComputesInverseInPlace)
 {
-    matrix in       = {{1, 0, 0}, {-1, 2.5, 0}, {10, -2, 1.2}};
+    matrix in       = {{1, 0, 0}, {-1, real(2.5), 0}, {10, -2, real(1.2)}};
     matrix expected = {{1, 0, 0},
-                       {0.4, 0.4, 0},
-                       {-23.0/3.0, 2.0/3.0, 5.0/6.0}};
+                       {real(0.4), real(0.4), 0},
+                       {real(-23.0/3.0), real(2.0/3.0), real(5.0/6.0)}};
 
     invertBoxMatrix(in, in);
 
index ef53ee1373f487a11cb785b4033da29e8146f4bc..4fcb49b7194de52b2e0e96d3fae510b653260ef9 100644 (file)
@@ -59,7 +59,7 @@ namespace test
 {
 
 //! Database of 51 water atom input positions (DIM reals per atom, taken from spc216.gro) for use as test inputs.
-const real g_positions[] = {
+const double g_positions[] = {
     .130, -.041, -.291,
     .120, -.056, -.192,
     .044, -.005, -.327,
@@ -114,7 +114,7 @@ const real g_positions[] = {
 };
 
 //! Simple cubic simulation box to use in tests
-matrix g_box = {{1.86206, 0, 0}, {0, 1.86206, 0}, {0, 0, 1.86206}};
+matrix g_box = {{real(1.86206), 0, 0}, {0, real(1.86206), 0}, {0, 0, real(1.86206)}};
 
 //! Convenience typedef
 typedef std::tuple<int, bool, bool, bool> SettleTestParameters;
@@ -248,6 +248,9 @@ TEST_P(SettleTest, SatisfiesConstraints)
     gmx_settledata_t settled = settle_init(mtop);
     settle_set_constraints(settled, &mtop->moltype[0].ilist[F_SETTLE], &mdatoms);
 
+    // Copy the original positions from the array of doubles to a vector of reals
+    std::vector<real> startingPositions(std::begin(g_positions), std::end(g_positions));
+
     // Run the test
     bool       errorOccured;
     tensor     virial             = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
@@ -255,7 +258,7 @@ TEST_P(SettleTest, SatisfiesConstraints)
     const real reciprocalTimeStep = 1.0/0.002;
     csettle(settled, numThreads, threadIndex,
             usePbc ? &pbcXYZ_ : &pbcNone_,
-            std::begin(g_positions), updatedPositions_.data(), reciprocalTimeStep,
+            startingPositions.data(), updatedPositions_.data(), reciprocalTimeStep,
             useVelocities ? velocities_.data() : nullptr,
             calcVirial, virial, &errorOccured);
     EXPECT_FALSE(errorOccured) << testDescription;
index b0d7ce264092a39914ce81f501db1cf453dfb3e7..46f9168f44a51145555f75e3d7182ea18011327d 100644 (file)
@@ -42,7 +42,7 @@ namespace gmx
 
 // MSVC does not handle extern template class members correctly even in MSVC 2015,
 // so in that case we have to instantiate in every object using it.
-#if !defined(_MSC_VER) || defined(__INTEL_COMPILER)
+#if !defined(_MSC_VER)
 // This is by far the most common version of the normal distribution table,
 // so we use this as an extern template specialization to avoid instantiating
 // the table in all files using it, unless the user has requested a different
index 2174f38b51ad0e7200269e1cabf5b60dd0e75bb0..c914b66549e9b5196835f0c082e008735ad9feea 100644 (file)
@@ -358,7 +358,7 @@ class TabulatedNormalDistribution
 // so in that case we have to instantiate in every object using it. In addition,
 // doxygen is convinced this defines a function (which leads to crashes in our python
 // scripts), so to avoid confusion we hide it from doxygen too.
-#if (!defined(_MSC_VER) || defined(__INTEL_COMPILER)) && !defined(DOXYGEN)
+#if !defined(_MSC_VER) && !defined(DOXYGEN)
 // Declaration of template specialization
 template<>
 const std::vector<real> TabulatedNormalDistribution<real, 14>::c_table_;
index 69fca4f5dd01ca6b1237add1a48d61fbf2456bc4..6bac451c764b459c7fd1c67be7ad7d5daf67b3cd 100644 (file)
@@ -421,7 +421,6 @@ trunc(SimdDouble x)
 static inline SimdDouble
 frexp(SimdDouble value, SimdDInt32 * exponent)
 {
-    // Don't use _mm_set1_epi64x() - on MSVC it is only supported for 64-bit builds
     const __vector double     exponentMask = reinterpret_cast<__vector double>(vec_splats(0x7FF0000000000000ULL));
     const __vector signed int exponentBias = vec_splats(1022);
     const __vector double     half         = vec_splats(0.5);
index 1e1f6e7fce4558c753f23d473d95ef60f9c1cb55..e6a3c1ceca912dce9e6f2a024177fac4488c030b 100644 (file)
@@ -78,39 +78,37 @@ typedef int gmx_bool;
  * types from C99 headers `stdint.h` and `inttypes.h`.  These headers are also
  * there in C++11.  The types and macros from here should be used instead of
  * `int32_t` etc.
- * MSVC doesn't support these before Visual Studio 2013.
+ *
+ * (MSVC 2015 still doesn't support the format strings.)
  */
 /*! \{ */
+typedef int32_t gmx_int32_t;
+typedef int64_t gmx_int64_t;
+typedef uint32_t gmx_uint32_t;
+typedef uint64_t gmx_uint64_t;
+
 #ifdef _MSC_VER
-typedef __int32 gmx_int32_t;
 #define GMX_PRId32 "I32d"
 #define GMX_SCNd32 "I32d"
 
-typedef __int64 gmx_int64_t;
 #define GMX_PRId64 "I64d"
 #define GMX_SCNd64 "I64d"
 
-typedef unsigned __int32 gmx_uint32_t;
 #define GMX_PRIu32 "I32u"
 #define GMX_SCNu32 "I32u"
 
-typedef unsigned __int64 gmx_uint64_t;
 #define GMX_PRIu64 "I64u"
 #define GMX_SCNu64 "I64u"
 #else
-typedef int32_t gmx_int32_t;
 #define GMX_PRId32 PRId32
 #define GMX_SCNd32 SCNd32
 
-typedef int64_t gmx_int64_t;
 #define GMX_PRId64 PRId64
 #define GMX_SCNd64 SCNd64
 
-typedef uint32_t gmx_uint32_t;
 #define GMX_PRIu32 PRIu32
 #define GMX_SCNu32 SCNu32
 
-typedef uint64_t gmx_uint64_t;
 #define GMX_PRIu64 PRIu64
 #define GMX_SCNu64 SCNu64
 #endif
@@ -231,13 +229,13 @@ typedef uint64_t gmx_uint64_t;
 /*! \def gmx_constexpr
  * \brief C++11 constexpr everywhere except MSVC 2013, where it is empty.
  *
- * Support for constexpr was not added until MSVC 2015.
- * Since interacting with parts of libc++ and libstdc++ depend on it
- * (for instance the min/max calls in our random engines), we need to specify it
- * for other compilers.
+ * Support for constexpr was not added until MSVC 2015, and it still
+ * seems to be unreliable. Since interacting with parts of libc++ and
+ * libstdc++ depend on it (for instance the min/max calls in our
+ * random engines), we need to specify it for other compilers.
  */
 #ifndef gmx_constexpr
-#if (!defined(_MSC_VER) || (defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026))
+#if !defined(_MSC_VER)
 #    define gmx_constexpr constexpr
 #else
 #    define gmx_constexpr
@@ -257,10 +255,7 @@ typedef uint64_t gmx_uint64_t;
    \endcode
  */
 
-#if defined(_MSC_VER) && (_MSC_VER <= 1800) && !defined(__ICL)
-// For MSVC2013 and eariler we use a hack and assume an alignment of 128 bytes is sufficient in all cases
-#    define GMX_ALIGNED(type, alignment) __declspec(align(128)) type
-#elif defined(__GNUC__) || defined(__clang__) || defined(__ibmxl__) || defined(__xlC__) || defined(__PATHCC__)
+#if defined(__GNUC__) || defined(__clang__) || defined(__ibmxl__) || defined(__xlC__) || defined(__PATHCC__)
 // Gcc-4.6.4 does not support alignas, but both gcc, clang, pathscale and xlc
 // support the standard GNU alignment attributes. PGI also sets __GNUC__ now,
 // and mostly supports it.