Merge branch 'release-2016'
authorSzilárd Páll <pall.szilard@gmail.com>
Mon, 11 Sep 2017 17:33:09 +0000 (19:33 +0200)
committerBerk Hess <hess@kth.se>
Tue, 12 Sep 2017 06:47:39 +0000 (08:47 +0200)
Note that changes to the simd_math module/tests from the 2016 branch
were omitted in favor of the current code in master.

Conflicts:
src/gromacs/fileio/oenv.cpp
src/gromacs/fileio/oenv.h
src/gromacs/gmxlib/nonbonded/CMakeLists.txt
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
src/gromacs/simd/simd_math.h
src/gromacs/simd/tests/simd_math.cpp
src/gromacs/swap/swapcoords.cpp

Change-Id: I357e40f97fd53a34ff900f40bb3fdeb20d864c13

16 files changed:
1  2 
CMakeLists.txt
cmake/gmxManageFFTLibraries.cmake
docs/install-guide/index.rst
docs/user-guide/environment-variables.rst
src/gromacs/fileio/oenv.cpp
src/gromacs/fileio/oenv.h
src/gromacs/fileio/trxio.cpp
src/gromacs/gmxlib/nonbonded/CMakeLists.txt
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/hardware/cpuinfo.h
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh
src/gromacs/simd/simd_math.h
src/gromacs/swap/swapcoords.cpp
src/gromacs/tables/forcetable.cpp
src/gromacs/utility/sysinfo.cpp

diff --cc CMakeLists.txt
Simple merge
Simple merge
Simple merge
index c1d19ce08ea181832f6c42b527de1b2fb4235b91,9a9c6c2d44cd15674f806c8800e5960ae17aa522..745ea6c9fd27d213287bbad7ca1eb7566d7ddf05
  struct gmx_output_env_t
  {
      explicit gmx_output_env_t(const gmx::IProgramContext &context)
 -        : programContext(context)
 -    {
 -        time_unit               = time_ps;
 -        view                    = FALSE;
 -        xvg_format              = exvgNONE;
 -        verbosity               = 0;
 -        trajectory_io_verbosity = 1;
 -    }
 +        : programContext(context),
 +          time_unit(time_ps),
 +          view(FALSE),
 +          xvg_format(exvgNONE),
-           verbosity(0) {}
++          verbosity(0),
++          trajectory_io_verbosity(0) {}
++
  
      const gmx::IProgramContext  &programContext;
  
@@@ -127,7 -134,12 +134,12 @@@ int output_env_get_verbosity(const gmx_
      return oenv->verbosity;
  }
  
 -const char *output_env_get_time_unit(const gmx_output_env_t *oenv)
+ int output_env_get_trajectory_io_verbosity(const gmx_output_env_t *oenv)
+ {
+     return oenv->trajectory_io_verbosity;
+ }
 +std::string output_env_get_time_unit(const gmx_output_env_t *oenv)
  {
      return time_units_str[oenv->time_unit];
  }
index 51c7b23b3a0d33509516d180e429108521089c87,58ec84ec972181688640e6d84f6443ba90995658..57188976064d3594526d5f3d21d97385918459d4
@@@ -75,14 -78,17 +76,17 @@@ void output_env_done(gmx_output_env_t *
  int output_env_get_verbosity(const gmx_output_env_t *oenv);
  /* return the verbosity */
  
 -const char *output_env_get_time_unit(const gmx_output_env_t *oenv);
+ int output_env_get_trajectory_io_verbosity(const gmx_output_env_t *oenv);
+ /* return the verbosity for trajectory IO handling */
 +std::string output_env_get_time_unit(const gmx_output_env_t *oenv);
  /* return time unit (e.g. ps or ns) */
  
 -const char *output_env_get_time_label(const gmx_output_env_t *oenv);
 +std::string output_env_get_time_label(const gmx_output_env_t *oenv);
  /* return time unit label (e.g. "Time (ps)") */
  
 -const char *output_env_get_xvgr_tlabel(const gmx_output_env_t *oenv);
 -/* retrun x-axis time label for xmgr */
 +std::string output_env_get_xvgr_tlabel(const gmx_output_env_t *oenv);
 +/* return x-axis time label for xmgr */
  
  real output_env_get_time_factor(const gmx_output_env_t *oenv);
  /* return time conversion factor from ps (i.e. 1e-3 for ps->ns) */
Simple merge
index 69b077b6ab4e7fc1290126f5a99577bde78321ae,841e2f0112b465ceec3c98d3c6078137f8a4f618..f588792ad56e43c7550ebb64e27518d1ec8c17ba
@@@ -47,7 -47,11 +47,11 @@@ if("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_1
      file(GLOB NONBONDED_AVX_128_FMA_SINGLE_SOURCES nb_kernel_avx_128_fma_single/*.c)
  endif()
  
- if((("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_256") OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX2_256")) AND NOT GMX_DOUBLE)
 -if((("${GMX_SIMD}" STREQUAL "AVX_256")
 -            OR ("${GMX_SIMD}" STREQUAL "AVX2_256")
 -            OR ("${GMX_SIMD}" STREQUAL "AVX_512")
 -            OR ("${GMX_SIMD}" STREQUAL "AVX_512_KNL"))
++if((("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_256")
++    OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX2_256")
++    OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512")
++    OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512_KNL"))
+         AND NOT GMX_DOUBLE)
      file(GLOB NONBONDED_AVX_256_SINGLE_SOURCES nb_kernel_avx_256_single/*.c)
  endif()
  
@@@ -63,7 -67,11 +67,11 @@@ if("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_1
      file(GLOB NONBONDED_AVX_128_FMA_DOUBLE_SOURCES nb_kernel_avx_128_fma_double/*.c)
  endif()
  
- if((("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_256") OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX2_256")) AND GMX_DOUBLE)
 -if((("${GMX_SIMD}" STREQUAL "AVX_256")
 -            OR ("${GMX_SIMD}" STREQUAL "AVX2_256")
 -            OR ("${GMX_SIMD}" STREQUAL "AVX_512")
 -            OR ("${GMX_SIMD}" STREQUAL "AVX_512_KNL"))
++if((("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_256")
++            OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX2_256")
++            OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512")
++            OR ("${GMX_SIMD_ACTIVE}" STREQUAL "AVX_512_KNL"))
+         AND GMX_DOUBLE)
      file(GLOB NONBONDED_AVX_256_DOUBLE_SOURCES nb_kernel_avx_256_double/*.c)
  endif()
  
index 1d2cf357c9a8173b86924c5bfc055a99123bb9e2,df8d70086f945ca8b10f640af6d69e6f1358c9f1..3ff092d2846e4aabead3563da5bd2e1d6b3143f7
@@@ -872,44 -873,36 +873,48 @@@ CpuInfo CpuInfo::detect(
  {
      CpuInfo result;
  
 -#if defined __i386__ || defined __i386 || defined _X86_ || defined _M_IX86 || \
 -    defined __x86_64__ || defined __amd64__ || defined _M_X64 || defined _M_AMD64
 -
 -    result.vendor_            = detectX86Vendor();
 -    detectX86Features(&result.brandString_, &result.family_, &result.model_,
 -                      &result.stepping_, &result.features_);
 -    result.logicalProcessors_ = detectX86LogicalProcessors();
 -#else   // not x86
 -
 -#    if defined __arm__ || defined __arm || defined _M_ARM || defined __aarch64__
 -    result.vendor_  = CpuInfo::Vendor::Arm;
 -#    elif defined __powerpc__ || defined __ppc__ || defined __PPC__
 -    result.vendor_  = CpuInfo::Vendor::Ibm;
 -#    endif
 +    if (c_architecture == Architecture::X86)
 +    {
 +        result.vendor_ = detectX86Vendor();
  
 -#    if defined __aarch64__ || ( defined _M_ARM && _M_ARM >= 8 )
 -    result.features_.insert(Feature::Arm_Neon);      // ARMv8 always has Neon
 -    result.features_.insert(Feature::Arm_NeonAsimd); // ARMv8 always has Neon-asimd
 -#    endif
 +        if (result.vendor_ == CpuInfo::Vendor::Intel)
 +        {
 +            result.features_.insert(CpuInfo::Feature::X86_Intel);
 +        }
 +        else if (result.vendor_ == CpuInfo::Vendor::Amd)
 +        {
 +            result.features_.insert(CpuInfo::Feature::X86_Amd);
 +        }
 +        detectX86Features(&result.brandString_, &result.family_, &result.model_,
 +                          &result.stepping_, &result.features_);
 +        result.logicalProcessors_ = detectX86LogicalProcessors();
 +    }
 +    else
 +    {
 +        // Not x86
 +        if (c_architecture == Architecture::Arm)
 +        {
 +            result.vendor_  = CpuInfo::Vendor::Arm;
 +        }
 +        else if (c_architecture == Architecture::PowerPC)
 +        {
 +            result.vendor_  = CpuInfo::Vendor::Ibm;
 +        }
  
 -#    if defined sun
 -    result.vendor_ = CpuInfo::Vendor::Oracle;
 -#    endif
 +#if defined __aarch64__ || ( defined _M_ARM && _M_ARM >= 8 )
 +        result.features_.insert(Feature::Arm_Neon);      // ARMv8 always has Neon
 +        result.features_.insert(Feature::Arm_NeonAsimd); // ARMv8 always has Neon-asimd
 +#endif
  
 -    // On Linux we might be able to find information in /proc/cpuinfo. If vendor or brand
 -    // is set to a known value this routine will not overwrite it.
 -    detectProcCpuInfo(&result.vendor_, &result.brandString_, &result.family_,
 -                      &result.model_, &result.stepping_, &result.features_);
++#if defined sun
++        result.vendor_ = CpuInfo::Vendor::Oracle;
++#endif
 -#endif  // x86 or not
 +        // On Linux we might be able to find information in /proc/cpuinfo. If vendor or brand
 +        // is set to a known value this routine will not overwrite it.
 +        detectProcCpuInfo(&result.vendor_, &result.brandString_, &result.family_,
 +                          &result.model_, &result.stepping_, &result.features_);
 +    }
  
      if (!result.logicalProcessors_.empty())
      {
Simple merge
Simple merge
index c4ec038d2c4504a46c70d8d66ce3c1b475bf1377,00bc3b2b926f16ada3d90bd4a3906186036179f3..c0ef88571064e342206c18a5594ece1d153b73fa
@@@ -354,12 -355,7 +358,11 @@@ __global__ void NB_KERNEL_FUNC_NAME(nbn
  
  #endif                                  /* CALC_ENERGIES */
  
-     int          j4LoopStart      = cij4_start + tidxz;
-     unsigned int j4LoopThreadMask = gmx_ballot_sync(c_fullWarpMask, j4LoopStart < cij4_end);
 +#ifdef EXCLUSION_FORCES
 +    const int nonSelfInteraction  = !(nb_sci.shift == CENTRAL & tidxj <= tidxi);
 +#endif
 +
+     int          j4LoopStart = cij4_start + tidxz;
      /* loop over the j clusters = seen by any of the atoms in the current super-cluster */
      for (j4 = j4LoopStart; j4 < cij4_end; j4 += NTHREAD_Z)
      {
index d44560611cd6c236291204c84b485fa8c47dbbf3,b11e0edc9bfa1604061db11e254afecd207ee1e9..e3f1db68258b361d1753d6ceedca8686b32a53b7
@@@ -1727,15 -1549,8 +1727,16 @@@ template <MathOptimization opt = MathOp
  static inline SimdDouble gmx_simdcall
  sqrt(SimdDouble x)
  {
 -    // As we might use a float version of rsqrt, we mask out small values
 -    return x * maskzInvsqrt(x, SimdDouble(GMX_FLOAT_MIN) <= x);
 +    if (opt == MathOptimization::Safe)
 +    {
++        // As we might use a float version of rsqrt, we mask out small values
 +        SimdDouble res = maskzInvsqrt(x, SimdDouble(GMX_FLOAT_MIN) < x);
 +        return res*x;
 +    }
 +    else
 +    {
 +        return x * invsqrt(x);
 +    }
  }
  
  #if !GMX_SIMD_HAVE_NATIVE_LOG_DOUBLE
index 1d230a6c5f6758026f6d9dd5ea6a4573fff7240f,92cbe4ca5c83b978321e3b03ccc6eed6cdb39373..4333572aad3c94dabe77405c84fb08c7ca4921bc
@@@ -1462,13 -1466,14 +1462,11 @@@ void init_swapcoords
  {
      t_swapcoords          *sc;
      t_swap                *s;
 -    t_atom                *atom;
      t_swapgrp             *g;
      swapstateIons_t       *gs;
 -    gmx_bool               bAppend, bStartFromCpt, bRerun;
 -    gmx_mtop_atomlookup_t  alook = NULL;
 -
 -    alook = gmx_mtop_atomlookup_init(mtop);
 +    gmx_bool               bAppend, bStartFromCpt;
-     matrix                 boxCopy;
 +    swaphistory_t         *swapstate = nullptr;
  
      if ( (PAR(cr)) && !DOMAINDECOMP(cr) )
      {
          gmx_fatal(FARGS, "Position swapping is only implemented for domain decomposition!");
Simple merge
Simple merge