From: Szilárd Páll Date: Mon, 11 Sep 2017 17:33:09 +0000 (+0200) Subject: Merge branch 'release-2016' X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=7798d7486bf6fa3281c2e8852d64f13fbddd4b1d;p=alexxy%2Fgromacs.git Merge branch 'release-2016' 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 --- 7798d7486bf6fa3281c2e8852d64f13fbddd4b1d diff --cc src/gromacs/fileio/oenv.cpp index c1d19ce08e,9a9c6c2d44..745ea6c9fd --- a/src/gromacs/fileio/oenv.cpp +++ b/src/gromacs/fileio/oenv.cpp @@@ -46,11 -45,14 +46,13 @@@ 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; } + int output_env_get_trajectory_io_verbosity(const gmx_output_env_t *oenv) + { + return oenv->trajectory_io_verbosity; + } + -const char *output_env_get_time_unit(const gmx_output_env_t *oenv) +std::string output_env_get_time_unit(const gmx_output_env_t *oenv) { return time_units_str[oenv->time_unit]; } diff --cc src/gromacs/fileio/oenv.h index 51c7b23b3a,58ec84ec97..5718897606 --- a/src/gromacs/fileio/oenv.h +++ b/src/gromacs/fileio/oenv.h @@@ -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 */ + int output_env_get_trajectory_io_verbosity(const gmx_output_env_t *oenv); + /* return the verbosity for trajectory IO handling */ + -const char *output_env_get_time_unit(const gmx_output_env_t *oenv); +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) */ diff --cc src/gromacs/gmxlib/nonbonded/CMakeLists.txt index 69b077b6ab,841e2f0112..f588792ad5 --- a/src/gromacs/gmxlib/nonbonded/CMakeLists.txt +++ b/src/gromacs/gmxlib/nonbonded/CMakeLists.txt @@@ -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() diff --cc src/gromacs/hardware/cpuinfo.cpp index 1d2cf357c9,df8d70086f..3ff092d284 --- a/src/gromacs/hardware/cpuinfo.cpp +++ b/src/gromacs/hardware/cpuinfo.cpp @@@ -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()) { diff --cc src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh index c4ec038d2c,00bc3b2b92..c0ef885710 --- a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh @@@ -354,12 -355,7 +358,11 @@@ __global__ void NB_KERNEL_FUNC_NAME(nbn #endif /* CALC_ENERGIES */ +#ifdef EXCLUSION_FORCES + const int nonSelfInteraction = !(nb_sci.shift == CENTRAL & tidxj <= tidxi); +#endif + - int j4LoopStart = cij4_start + tidxz; - unsigned int j4LoopThreadMask = gmx_ballot_sync(c_fullWarpMask, j4LoopStart < cij4_end); + 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) { diff --cc src/gromacs/simd/simd_math.h index d44560611c,b11e0edc9b..e3f1db6825 --- a/src/gromacs/simd/simd_math.h +++ b/src/gromacs/simd/simd_math.h @@@ -1727,15 -1549,8 +1727,16 @@@ template