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;
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];
}
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) */
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()
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()
{
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())
{
#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)
{
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
{
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!");