From 516e02454b6e6c13f4ceb7705770d017232071b1 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Mon, 10 May 2021 15:36:44 +0200 Subject: [PATCH] Apply clang-format-11 This is better than slowly dribbling changes all over the code base --- api/gmxapi/cpp/session.cpp | 5 +- api/gmxapi/cpp/system.cpp | 5 +- .../include/gromacs/utility/gmxassert.h | 2 +- .../include/gromacs/utility/listoflists.h | 3 +- api/legacy/include/gromacs/utility/real.h | 8 +- api/nblib/gmxsetup.cpp | 2 +- api/nblib/listed_forces/bondtypes.h | 21 +--- api/nblib/molecules.h | 6 +- api/nblib/simulationstate.cpp | 3 +- api/nblib/tests/testsystems.cpp | 6 +- api/nblib/topology.cpp | 2 +- src/gromacs/analysisdata/arraydata.cpp | 8 +- src/gromacs/analysisdata/dataframe.cpp | 23 +--- src/gromacs/analysisdata/dataframe.h | 5 +- .../analysisdata/datamodulemanager.cpp | 3 +- src/gromacs/analysisdata/dataproxy.cpp | 7 +- src/gromacs/analysisdata/datastorage.cpp | 4 +- src/gromacs/analysisdata/framelocaldata.h | 5 +- .../analysisdata/modules/histogram.cpp | 10 +- src/gromacs/analysisdata/modules/plot.cpp | 9 +- src/gromacs/analysisdata/tests/datatest.cpp | 9 +- .../analysisdata/tests/mock_datamodule.cpp | 7 +- src/gromacs/applied_forces/awh/awh.cpp | 3 +- src/gromacs/applied_forces/awh/awh.h | 2 +- src/gromacs/applied_forces/awh/biasgrid.cpp | 9 +- src/gromacs/applied_forces/awh/biasparams.h | 10 +- src/gromacs/applied_forces/awh/biaswriter.cpp | 4 +- .../applied_forces/awh/correlationgrid.cpp | 3 +- src/gromacs/applied_forces/awh/dimparams.h | 3 +- .../applied_forces/awh/tests/awh_setup.h | 4 +- .../densityfittingamplitudelookup.cpp | 4 +- .../densityfittingforceprovider.cpp | 6 +- .../commandline/cmdlinehelpcontext.cpp | 4 +- src/gromacs/commandline/cmdlinehelpmodule.cpp | 10 +- src/gromacs/commandline/cmdlinehelpwriter.cpp | 14 +-- .../commandline/cmdlinemodulemanager_impl.h | 6 +- .../commandline/cmdlineoptionsmodule.cpp | 10 +- src/gromacs/commandline/cmdlineparser.cpp | 6 +- .../commandline/cmdlineprogramcontext.cpp | 4 +- src/gromacs/commandline/pargs.cpp | 5 +- src/gromacs/commandline/pargs.h | 3 +- .../tests/cmdlinemodulemanagertest.cpp | 3 +- .../commandline/tests/cmdlineparser.cpp | 7 +- src/gromacs/coordinateio/coordinatefile.h | 11 +- .../coordinateio/outputadapters/setatoms.h | 6 +- .../outputadapters/setstarttime.h | 6 +- .../coordinateio/outputadapters/settimestep.h | 6 +- src/gromacs/domdec/dlbtiming.cpp | 6 +- src/gromacs/domdec/domdec.cpp | 16 +-- src/gromacs/domdec/domdec_network.cpp | 14 +-- src/gromacs/domdec/domdec_specatomcomm.cpp | 14 +-- src/gromacs/domdec/ga2la.h | 5 +- src/gromacs/essentialdynamics/edsam.cpp | 2 +- src/gromacs/ewald/pme.cpp | 6 +- .../ewald/pme_coordinate_receiver_gpu_impl.cu | 4 +- .../ewald/pme_force_sender_gpu_impl.cu | 4 +- src/gromacs/ewald/pme_gather.clh | 4 +- src/gromacs/ewald/pme_gather.cpp | 20 ++-- src/gromacs/ewald/pme_gpu_internal.cpp | 4 +- src/gromacs/ewald/pme_gpu_types_host_impl.h | 3 +- src/gromacs/ewald/pme_only.cpp | 2 +- src/gromacs/ewald/pme_redistribute.cpp | 8 +- src/gromacs/ewald/tests/pmebsplinetest.cpp | 2 +- src/gromacs/ewald/tests/pmetestcommon.cpp | 3 +- src/gromacs/fileio/mrcdensitymap.cpp | 5 +- src/gromacs/fileio/mrcdensitymapheader.h | 6 +- .../fileio/tests/fileioxdrserializer.cpp | 12 +- src/gromacs/gmxana/gmx_awh.cpp | 5 +- src/gromacs/gmxana/gmx_order.cpp | 8 +- src/gromacs/gmxana/gmx_sham.cpp | 10 +- src/gromacs/gmxana/gmx_wham.cpp | 12 +- .../gmxlib/nonbonded/nb_free_energy.cpp | 6 +- src/gromacs/gmxlib/nonbonded/nb_free_energy.h | 2 +- src/gromacs/gmxpreprocess/gen_vsite.cpp | 15 +-- src/gromacs/gmxpreprocess/genhydro.cpp | 8 +- src/gromacs/gmxpreprocess/gpp_atomtype.cpp | 6 +- src/gromacs/gmxpreprocess/vsite_parm.cpp | 14 +-- src/gromacs/gmxpreprocess/x2top.cpp | 3 +- src/gromacs/gpu_utils/device_context_sycl.cpp | 5 +- src/gromacs/gpu_utils/device_utils.clh | 8 +- src/gromacs/gpu_utils/gpuregiontimer_ocl.h | 4 +- src/gromacs/hardware/cpuinfo.cpp | 15 +-- src/gromacs/hardware/detecthardware.cpp | 5 +- .../hardware/device_management_sycl.cpp | 3 +- src/gromacs/hardware/hardwaretopology.cpp | 8 +- src/gromacs/hardware/hardwaretopology.h | 4 +- src/gromacs/listed_forces/bonded.cpp | 16 +-- src/gromacs/listed_forces/bonded.h | 2 +- src/gromacs/listed_forces/disre.cpp | 2 +- src/gromacs/listed_forces/gpubonded_impl.cu | 3 +- src/gromacs/listed_forces/gpubondedkernels.cu | 36 +++--- src/gromacs/listed_forces/tests/pairs.cpp | 3 +- src/gromacs/math/arrayrefwithpadding.h | 14 +-- src/gromacs/math/coordinatetransformation.cpp | 5 +- src/gromacs/math/densityfit.cpp | 9 +- src/gromacs/math/gausstransform.cpp | 4 +- src/gromacs/math/multidimarray.h | 8 +- src/gromacs/math/paddedvector.h | 18 +-- src/gromacs/math/tests/neldermead.cpp | 5 +- src/gromacs/mdlib/boxdeformation.cpp | 5 +- src/gromacs/mdlib/calc_verletbuf.cpp | 2 +- src/gromacs/mdlib/coupling.cpp | 4 +- src/gromacs/mdlib/energyoutput.cpp | 12 +- src/gromacs/mdlib/expanded.cpp | 2 +- src/gromacs/mdlib/gmx_omp_nthreads.cpp | 6 +- src/gromacs/mdlib/groupcoord.cpp | 4 +- src/gromacs/mdlib/leapfrog_gpu.cu | 4 +- src/gromacs/mdlib/lincs.cpp | 68 ++++++------ src/gromacs/mdlib/lincs_gpu.cpp | 3 +- src/gromacs/mdlib/mdatoms.cpp | 2 +- src/gromacs/mdlib/resethandler.cpp | 5 +- src/gromacs/mdlib/settle.cpp | 14 +-- src/gromacs/mdlib/settle_gpu.cpp | 3 +- src/gromacs/mdlib/simulationsignal.cpp | 9 +- .../mdlib/tests/leapfrogtestrunners.cpp | 4 +- src/gromacs/mdlib/update.cpp | 103 +++++++++--------- src/gromacs/mdlib/update_constrain_gpu_impl.h | 7 +- src/gromacs/mdlib/updategroupscog.cpp | 3 +- src/gromacs/mdrun/md.cpp | 6 +- src/gromacs/mdrun/runner.cpp | 6 +- src/gromacs/mdrun/simulationinputhandle.cpp | 13 +-- src/gromacs/mdrun/simulatorbuilder.h | 29 ++--- src/gromacs/mdrunutility/threadaffinity.cpp | 4 +- src/gromacs/mdspan/extents.h | 11 +- src/gromacs/mdspan/mdspan.h | 25 ++--- src/gromacs/mdtypes/forcebuffers.cpp | 7 +- src/gromacs/mdtypes/forcebuffers.h | 4 +- src/gromacs/mdtypes/forceoutput.h | 3 +- src/gromacs/mdtypes/group.cpp | 3 +- src/gromacs/mdtypes/iforceprovider.h | 10 +- src/gromacs/mdtypes/interaction_const.h | 8 +- src/gromacs/mdtypes/swaphistory.h | 2 +- .../compositesimulatorelement.cpp | 5 +- .../modularsimulator/constraintelement.cpp | 4 +- .../freeenergyperturbationdata.cpp | 5 +- .../parrinellorahmanbarostat.cpp | 2 +- src/gromacs/modularsimulator/propagator.cpp | 36 +++--- src/gromacs/modularsimulator/signallers.cpp | 5 +- .../modularsimulator/statepropagatordata.cpp | 2 +- .../velocityscalingtemperaturecoupling.cpp | 14 +-- src/gromacs/nbnxm/atomdata.cpp | 39 +++---- src/gromacs/nbnxm/benchmark/bench_setup.cpp | 2 +- .../nbnxm/cuda/nbnxm_cuda_kernel_utils.cuh | 18 +-- src/gromacs/nbnxm/gpu_data_mgmt.h | 2 +- src/gromacs/nbnxm/kerneldispatch.cpp | 4 +- .../kernels_reference/kernel_ref_prune.cpp | 4 +- .../nbnxm/kernels_simd_2xmm/kernel_common.h | 5 +- .../nbnxm/kernels_simd_2xmm/kernel_outer.h | 2 +- .../nbnxm/kernels_simd_2xmm/kernel_prune.cpp | 4 +- .../nbnxm/kernels_simd_4xm/kernel_common.h | 5 +- .../nbnxm/kernels_simd_4xm/kernel_outer.h | 2 +- .../nbnxm/kernels_simd_4xm/kernel_prune.cpp | 4 +- src/gromacs/nbnxm/nbnxm_gpu.h | 30 ++--- src/gromacs/nbnxm/nbnxm_setup.cpp | 3 +- src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh | 20 ++-- .../opencl/nbnxm_ocl_kernel_pruneonly.clh | 4 +- .../nbnxm/opencl/nbnxm_ocl_kernel_utils.clh | 40 +++---- src/gromacs/nbnxm/pairlist_simd_2xmm.h | 26 ++--- src/gromacs/nbnxm/pairlist_simd_4xm.h | 26 ++--- src/gromacs/nbnxm/pairlist_tuning.cpp | 9 +- src/gromacs/nbnxm/pairlistwork.h | 3 +- src/gromacs/nbnxm/pairsearch.cpp | 5 +- src/gromacs/nbnxm/sycl/nbnxm_sycl_kernel.cpp | 2 +- src/gromacs/onlinehelp/helpformat.cpp | 5 +- src/gromacs/onlinehelp/helpwritercontext.cpp | 10 +- .../onlinehelp/tests/mock_helptopic.cpp | 6 +- src/gromacs/options/abstractoption.h | 6 +- src/gromacs/options/basicoptions.cpp | 18 +-- src/gromacs/options/basicoptions.h | 14 +-- src/gromacs/options/filenameoption.cpp | 4 +- src/gromacs/options/optionstoragetemplate.h | 11 +- src/gromacs/options/repeatingsection.h | 8 +- src/gromacs/options/treesupport.cpp | 9 +- src/gromacs/options/valuestore.h | 6 +- src/gromacs/pbcutil/pbc_aiuc_cuda.cuh | 2 +- src/gromacs/pbcutil/tests/com.cpp | 5 +- src/gromacs/pulling/pull.cpp | 4 +- src/gromacs/pulling/pull_internal.h | 2 +- src/gromacs/pulling/pull_rotation.cpp | 2 +- src/gromacs/random/gammadistribution.h | 3 +- src/gromacs/random/normaldistribution.h | 7 +- .../random/tabulatednormaldistribution.h | 11 +- src/gromacs/random/uniformintdistribution.h | 11 +- src/gromacs/restraint/tests/manager.cpp | 4 +- src/gromacs/selection/nbsearch.cpp | 4 +- src/gromacs/selection/nbsearch.h | 23 +--- src/gromacs/selection/parsetree.cpp | 9 +- src/gromacs/selection/parsetree.h | 9 +- src/gromacs/selection/poscalc.cpp | 7 +- src/gromacs/selection/selectioncollection.cpp | 4 +- src/gromacs/selection/selectionenums.h | 5 +- src/gromacs/selection/selectionoption.h | 6 +- .../selection/selectionoptionbehavior.cpp | 5 +- src/gromacs/selection/selelem.h | 5 +- src/gromacs/selection/selhelp.cpp | 3 +- src/gromacs/selection/selmethod.h | 6 +- src/gromacs/selection/selvalue.h | 5 +- src/gromacs/selection/sm_same.cpp | 8 +- src/gromacs/selection/tests/nbsearch.cpp | 15 +-- src/gromacs/selection/tests/poscalc.cpp | 6 +- .../impl_arm_neon_asimd_simd_float.h | 2 +- .../impl_arm_neon_asimd_util_double.h | 14 +-- .../impl_arm_neon_asimd_util_float.h | 12 +- .../impl_arm_sve/impl_arm_sve_simd_float.h | 4 +- .../impl_arm_sve/impl_arm_sve_util_double.h | 12 +- .../impl_arm_sve/impl_arm_sve_util_float.h | 12 +- .../impl_ibm_vsx/impl_ibm_vsx_util_double.h | 22 ++-- .../impl_ibm_vsx/impl_ibm_vsx_util_float.h | 20 ++-- .../impl_reference_simd4_double.h | 14 ++- .../impl_reference_simd4_float.h | 14 ++- .../impl_reference_simd_double.h | 17 ++- .../impl_reference_simd_float.h | 17 ++- .../impl_reference_util_double.h | 14 +-- .../impl_reference_util_float.h | 14 +-- .../impl_x86_avx2_256_simd_float.h | 8 +- .../impl_x86_avx_256_util_double.h | 14 +-- .../impl_x86_avx_256_util_float.h | 14 +-- .../impl_x86_avx_512_util_double.h | 16 +-- .../impl_x86_avx_512_util_float.h | 16 +-- .../impl_x86_sse2/impl_x86_sse2_simd_double.h | 4 +- .../impl_x86_sse2/impl_x86_sse2_simd_float.h | 4 +- .../impl_x86_sse2/impl_x86_sse2_util_double.h | 14 +-- .../impl_x86_sse2/impl_x86_sse2_util_float.h | 14 +-- src/gromacs/simd/scalar/scalar.h | 14 ++- src/gromacs/simd/simd_math.h | 3 +- src/gromacs/simd/tests/base.cpp | 3 +- .../simd/tests/bootstrap_loadstore.cpp | 8 +- src/gromacs/simd/tests/simd_floatingpoint.cpp | 6 +- src/gromacs/simd/tests/simd_math.cpp | 14 ++- src/gromacs/simd/vector_operations.h | 6 +- src/gromacs/swap/swapcoords.cpp | 2 +- src/gromacs/tables/cubicsplinetable.cpp | 8 +- src/gromacs/tables/forcetable.cpp | 13 +-- src/gromacs/tables/quadraticsplinetable.cpp | 8 +- src/gromacs/timing/cyclecounter.cpp | 10 +- src/gromacs/topology/atomprop.cpp | 5 +- src/gromacs/topology/idef.cpp | 4 +- src/gromacs/topology/idef.h | 3 +- src/gromacs/topology/residuetypes.cpp | 5 +- src/gromacs/trajectory/energyframe.cpp | 3 +- .../analysissettings_impl.h | 9 +- .../trajectoryanalysis/cmdlinerunner.cpp | 5 +- .../trajectoryanalysis/modules/angle.cpp | 5 +- .../trajectoryanalysis/modules/msd.cpp | 5 +- .../trajectoryanalysis/modules/sasa.cpp | 7 +- .../trajectoryanalysis/modules/select.cpp | 5 +- .../trajectoryanalysis/tests/moduletest.cpp | 5 +- .../trajectoryanalysis/tests/surfacearea.cpp | 8 +- .../topologyinformation.cpp | 6 +- src/gromacs/utility/datafilefinder.h | 8 +- src/gromacs/utility/directoryenumerator.cpp | 6 +- src/gromacs/utility/inmemoryserializer.cpp | 6 +- src/gromacs/utility/keyvaluetree.cpp | 4 +- src/gromacs/utility/keyvaluetreetransform.cpp | 16 +-- src/gromacs/utility/keyvaluetreetransform.h | 3 +- src/gromacs/utility/logger.cpp | 8 +- src/gromacs/utility/loggerbuilder.cpp | 8 +- src/gromacs/utility/path.h | 8 +- src/gromacs/utility/stringstream.cpp | 8 +- src/gromacs/utility/stringutil.cpp | 6 +- .../utility/tests/inmemoryserializer.cpp | 13 ++- src/gromacs/utility/textwriter.cpp | 7 +- src/programs/mdrun/tests/energycomparison.cpp | 3 +- src/programs/mdrun/tests/mdruncomparison.h | 5 +- .../mdrun/tests/multiple_time_stepping.cpp | 46 ++++---- .../mdrun/tests/terminationhelper.cpp | 5 +- .../mdrun/tests/trajectorycomparison.cpp | 3 +- src/programs/view/xdlgitem.h | 5 +- src/testutils/cmdlinetest.cpp | 6 +- src/testutils/interactivetest.cpp | 7 +- src/testutils/mpi_printer.cpp | 6 +- src/testutils/refdata.cpp | 10 +- src/testutils/refdata_checkers.h | 8 +- src/testutils/testinit.cpp | 3 +- src/testutils/tests/interactivetest.cpp | 6 +- 275 files changed, 987 insertions(+), 1388 deletions(-) diff --git a/api/gmxapi/cpp/session.cpp b/api/gmxapi/cpp/session.cpp index 0bccfacf8d..b2c33dcdb7 100644 --- a/api/gmxapi/cpp/session.cpp +++ b/api/gmxapi/cpp/session.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2020,2021, 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. @@ -350,8 +350,7 @@ std::shared_ptr launchSession(Context* context, const Workflow& work) n SessionImpl::~SessionImpl() = default; SessionResources::SessionResources(gmxapi::SessionImpl* session, std::string name) : - sessionImpl_(session), - name_(std::move(name)) + sessionImpl_(session), name_(std::move(name)) { } diff --git a/api/gmxapi/cpp/system.cpp b/api/gmxapi/cpp/system.cpp index 2a25b84290..a41c021b78 100644 --- a/api/gmxapi/cpp/system.cpp +++ b/api/gmxapi/cpp/system.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2020,2021, 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. @@ -117,8 +117,7 @@ System fromTprFile(const std::string& filename) } System::Impl::Impl(std::unique_ptr workflow) noexcept : - workflow_(std::move(workflow)), - spec_(std::make_shared()) + workflow_(std::move(workflow)), spec_(std::make_shared()) { GMX_ASSERT(workflow_, "Class invariant implies non-null workflow_ member"); GMX_ASSERT(spec_, "Class invariant implies non-null work specification member."); diff --git a/api/legacy/include/gromacs/utility/gmxassert.h b/api/legacy/include/gromacs/utility/gmxassert.h index dea2e5eb0d..ec31a945c6 100644 --- a/api/legacy/include/gromacs/utility/gmxassert.h +++ b/api/legacy/include/gromacs/utility/gmxassert.h @@ -67,7 +67,7 @@ # define GMX_RELEASE_ASSERT(condition, msg) \ ((void)((condition) ? (void)0 \ : ::gmx::internal::assertHandler( \ - #condition, msg, GMX_CURRENT_FUNCTION, __FILE__, __LINE__))) + #condition, msg, GMX_CURRENT_FUNCTION, __FILE__, __LINE__))) # else // Use an "immediately invoked function expression" to allow being // used in constexpr context with older GCC versions diff --git a/api/legacy/include/gromacs/utility/listoflists.h b/api/legacy/include/gromacs/utility/listoflists.h index 13c14149a5..48fc0c8fc8 100644 --- a/api/legacy/include/gromacs/utility/listoflists.h +++ b/api/legacy/include/gromacs/utility/listoflists.h @@ -92,8 +92,7 @@ public: * \param[in] elements Elements for all lists concatenated, is consumed */ ListOfLists(std::vector&& listRanges, std::vector&& elements) : - listRanges_(std::move(listRanges)), - elements_(std::move(elements)) + listRanges_(std::move(listRanges)), elements_(std::move(elements)) { if (listRanges_.empty() || listRanges_.at(0) != 0) { diff --git a/api/legacy/include/gromacs/utility/real.h b/api/legacy/include/gromacs/utility/real.h index 2a959637a1..9ca6562691 100644 --- a/api/legacy/include/gromacs/utility/real.h +++ b/api/legacy/include/gromacs/utility/real.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -74,7 +74,8 @@ */ # define GMX_DOUBLE_NEGZERO \ ({ \ - const union { \ + const union \ + { \ int di[2]; \ double d; \ } _gmx_dzero = { 0, -2147483648 }; \ @@ -82,7 +83,8 @@ }) # define GMX_FLOAT_NEGZERO \ ({ \ - const union { \ + const union \ + { \ int fi; \ float f; \ } _gmx_fzero = { -2147483648 }; \ diff --git a/api/nblib/gmxsetup.cpp b/api/nblib/gmxsetup.cpp index 3baa358e98..30f14937ee 100644 --- a/api/nblib/gmxsetup.cpp +++ b/api/nblib/gmxsetup.cpp @@ -176,7 +176,7 @@ void NbvSetupUtil::setAtomProperties(const std::vector& particleTypeIdOfAl void NbvSetupUtil::setupNbnxmInstance(const size_t numParticleTypes, const NBKernelOptions& options) { const auto pinPolicy = (options.useGpu ? gmx::PinningPolicy::PinnedIfSupported - : gmx::PinningPolicy::CannotBePinned); + : gmx::PinningPolicy::CannotBePinned); const int numThreads = options.numOpenMPThreads; // Note: the options and Nbnxm combination rule enums values should match const int combinationRule = static_cast(options.ljCombinationRule); diff --git a/api/nblib/listed_forces/bondtypes.h b/api/nblib/listed_forces/bondtypes.h index 73bdfe2ee9..cef684d822 100644 --- a/api/nblib/listed_forces/bondtypes.h +++ b/api/nblib/listed_forces/bondtypes.h @@ -150,9 +150,7 @@ struct CubicBondType { CubicBondType() = default; CubicBondType(ForceConstant fq, ForceConstant fc, EquilDistance d) : - quadraticForceConstant_(fq), - cubicForceConstant_(fc), - equilDistance_(d) + quadraticForceConstant_(fq), cubicForceConstant_(fc), equilDistance_(d) { } @@ -191,9 +189,7 @@ class MorseBondType public: MorseBondType() = default; MorseBondType(ForceConstant f, Exponent e, EquilDistance d) : - forceConstant_(f), - exponent_(e), - equilDistance_(d) + forceConstant_(f), exponent_(e), equilDistance_(d) { } @@ -249,15 +245,11 @@ public: ProperDihedral() = default; ProperDihedral(Radians phi, ForceConstant f, Multiplicity m) : - phi_(phi), - forceConstant_(f), - multiplicity_(m) + phi_(phi), forceConstant_(f), multiplicity_(m) { } ProperDihedral(Degrees phi, ForceConstant f, Multiplicity m) : - phi_(phi * DEG2RAD), - forceConstant_(f), - multiplicity_(m) + phi_(phi * DEG2RAD), forceConstant_(f), multiplicity_(m) { } @@ -340,10 +332,7 @@ class Default5Center public: Default5Center() = default; Default5Center(Radians phi, Radians psi, ForceConstant fphi, ForceConstant fpsi) : - phi_(phi), - psi_(psi), - fphi_(fphi), - fpsi_(fpsi) + phi_(phi), psi_(psi), fphi_(fphi), fpsi_(fpsi) { } diff --git a/api/nblib/molecules.h b/api/nblib/molecules.h index c8ae094cc1..14c7f087c9 100644 --- a/api/nblib/molecules.h +++ b/api/nblib/molecules.h @@ -86,15 +86,13 @@ class ParticleIdentifier final public: //! \brief construct form a ParticleName, allow implicit conversion ParticleIdentifier(ParticleName particleName) : - particleName_(std::move(particleName)), - residueName_() + particleName_(std::move(particleName)), residueName_() { } //! \brief construct with a non-default ResidueName ParticleIdentifier(ParticleName particleName, ResidueName residueName) : - particleName_(std::move(particleName)), - residueName_(std::move(residueName)) + particleName_(std::move(particleName)), residueName_(std::move(residueName)) { } diff --git a/api/nblib/simulationstate.cpp b/api/nblib/simulationstate.cpp index bd5d2d8595..dbbfa10c27 100644 --- a/api/nblib/simulationstate.cpp +++ b/api/nblib/simulationstate.cpp @@ -69,8 +69,7 @@ SimulationState::Impl::Impl(const std::vector& coordinates, const std::vector& forces, const Box& box, Topology topology) : - box_(box), - topology_(std::move(topology)) + box_(box), topology_(std::move(topology)) { auto numParticles = topology_.numParticles(); diff --git a/api/nblib/tests/testsystems.cpp b/api/nblib/tests/testsystems.cpp index 2bedef8887..b9d438e4fe 100644 --- a/api/nblib/tests/testsystems.cpp +++ b/api/nblib/tests/testsystems.cpp @@ -255,8 +255,7 @@ Topology ArgonTopologyBuilder::argonTopology() } ArgonSimulationStateBuilder::ArgonSimulationStateBuilder() : - box_(6.05449), - topology_(ArgonTopologyBuilder(12).argonTopology()) + box_(6.05449), topology_(ArgonTopologyBuilder(12).argonTopology()) { coordinates_ = { @@ -324,8 +323,7 @@ std::vector& ArgonSimulationStateBuilder::velocities() } SpcMethanolSimulationStateBuilder::SpcMethanolSimulationStateBuilder() : - box_(3.01000), - topology_(SpcMethanolTopologyBuilder().buildTopology(1, 1)) + box_(3.01000), topology_(SpcMethanolTopologyBuilder().buildTopology(1, 1)) { coordinates_ = { { 1.970, 1.460, 1.209 }, // Me1 diff --git a/api/nblib/topology.cpp b/api/nblib/topology.cpp index acaea4999f..204b26dd00 100644 --- a/api/nblib/topology.cpp +++ b/api/nblib/topology.cpp @@ -138,7 +138,7 @@ ListedInteractionData TopologyBuilder::createInteractionData(const ParticleSeque std::transform(begin(expansionArrayStage1), end(expansionArrayStage1), begin(expansionArray), - [& S2 = expansionArrayStage2](size_t S1Element) { return S2[S1Element]; }); + [&S2 = expansionArrayStage2](size_t S1Element) { return S2[S1Element]; }); // add data about InteractionType instances interactionDataElement.parameters = std::move(uniqueInteractionInstances); diff --git a/src/gromacs/analysisdata/arraydata.cpp b/src/gromacs/analysisdata/arraydata.cpp index de6436e46c..83aa4029ee 100644 --- a/src/gromacs/analysisdata/arraydata.cpp +++ b/src/gromacs/analysisdata/arraydata.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2011,2012,2013,2014 by the GROMACS development team. - * Copyright (c) 2015,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2017,2019,2020,2021, 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. @@ -55,11 +55,7 @@ namespace gmx { AbstractAnalysisArrayData::AbstractAnalysisArrayData() : - rowCount_(0), - pointSetInfo_(0, 0, 0, 0), - xstep_(1.0), - bUniformX_(true), - bReady_(false) + rowCount_(0), pointSetInfo_(0, 0, 0, 0), xstep_(1.0), bUniformX_(true), bReady_(false) { xvalue_.push_back(0); } diff --git a/src/gromacs/analysisdata/dataframe.cpp b/src/gromacs/analysisdata/dataframe.cpp index 7c1de57ea8..a59a9e4f03 100644 --- a/src/gromacs/analysisdata/dataframe.cpp +++ b/src/gromacs/analysisdata/dataframe.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2017,2019, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2017,2019,2021, 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. @@ -56,9 +56,7 @@ AnalysisDataFrameHeader::AnalysisDataFrameHeader() : index_(-1), x_(0.0), dx_(0. AnalysisDataFrameHeader::AnalysisDataFrameHeader(int index, real x, real dx) : - index_(index), - x_(x), - dx_(dx) + index_(index), x_(x), dx_(dx) { GMX_ASSERT(index >= 0, "Invalid frame index"); } @@ -82,10 +80,7 @@ AnalysisDataPointSetRef::AnalysisDataPointSetRef(const AnalysisDataFrameHeader& AnalysisDataPointSetRef::AnalysisDataPointSetRef(const AnalysisDataFrameHeader& header, const std::vector& values) : - header_(header), - dataSetIndex_(0), - firstColumn_(0), - values_(values) + header_(header), dataSetIndex_(0), firstColumn_(0), values_(values) { GMX_ASSERT(header_.isValid(), "Invalid point set reference should not be constructed"); } @@ -94,9 +89,7 @@ AnalysisDataPointSetRef::AnalysisDataPointSetRef(const AnalysisDataFrameHeader& AnalysisDataPointSetRef::AnalysisDataPointSetRef(const AnalysisDataPointSetRef& points, int firstColumn, int columnCount) : - header_(points.header()), - dataSetIndex_(points.dataSetIndex()), - firstColumn_(0) + header_(points.header()), dataSetIndex_(points.dataSetIndex()), firstColumn_(0) { GMX_ASSERT(firstColumn >= 0, "Invalid first column"); GMX_ASSERT(columnCount >= 0, "Invalid column count"); @@ -152,9 +145,7 @@ AnalysisDataFrameRef::AnalysisDataFrameRef() {} AnalysisDataFrameRef::AnalysisDataFrameRef(const AnalysisDataFrameHeader& header, const AnalysisDataValuesRef& values, const AnalysisDataPointSetInfosRef& pointSets) : - header_(header), - values_(values), - pointSets_(pointSets) + header_(header), values_(values), pointSets_(pointSets) { GMX_ASSERT(!pointSets_.empty(), "There must always be a point set"); } @@ -163,9 +154,7 @@ AnalysisDataFrameRef::AnalysisDataFrameRef(const AnalysisDataFrameHeader& h AnalysisDataFrameRef::AnalysisDataFrameRef(const AnalysisDataFrameHeader& header, const std::vector& values, const std::vector& pointSets) : - header_(header), - values_(values), - pointSets_(pointSets) + header_(header), values_(values), pointSets_(pointSets) { GMX_ASSERT(!pointSets_.empty(), "There must always be a point set"); } diff --git a/src/gromacs/analysisdata/dataframe.h b/src/gromacs/analysisdata/dataframe.h index 07d66ea356..20db90e1de 100644 --- a/src/gromacs/analysisdata/dataframe.h +++ b/src/gromacs/analysisdata/dataframe.h @@ -290,10 +290,7 @@ class AnalysisDataPointSetInfo public: //! Construct point set data object with the given values. AnalysisDataPointSetInfo(int valueOffset, int valueCount, int dataSetIndex, int firstColumn) : - valueOffset_(valueOffset), - valueCount_(valueCount), - dataSetIndex_(dataSetIndex), - firstColumn_(firstColumn) + valueOffset_(valueOffset), valueCount_(valueCount), dataSetIndex_(dataSetIndex), firstColumn_(firstColumn) { GMX_ASSERT(valueOffset >= 0, "Negative value offsets are invalid"); GMX_ASSERT(valueCount >= 0, "Negative value counts are invalid"); diff --git a/src/gromacs/analysisdata/datamodulemanager.cpp b/src/gromacs/analysisdata/datamodulemanager.cpp index c5e982f579..4424f137a9 100644 --- a/src/gromacs/analysisdata/datamodulemanager.cpp +++ b/src/gromacs/analysisdata/datamodulemanager.cpp @@ -74,8 +74,7 @@ public: { //! Initializes the module information. explicit ModuleInfo(AnalysisDataModulePointer module) : - module(std::move(module)), - bParallel(false) + module(std::move(module)), bParallel(false) { } diff --git a/src/gromacs/analysisdata/dataproxy.cpp b/src/gromacs/analysisdata/dataproxy.cpp index 24460bd78e..e4e68c237c 100644 --- a/src/gromacs/analysisdata/dataproxy.cpp +++ b/src/gromacs/analysisdata/dataproxy.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2011,2012,2013,2014 by the GROMACS development team. - * Copyright (c) 2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2019,2020,2021, 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. @@ -52,10 +52,7 @@ namespace gmx { AnalysisDataProxy::AnalysisDataProxy(int firstColumn, int columnSpan, AbstractAnalysisData* data) : - source_(*data), - firstColumn_(firstColumn), - columnSpan_(columnSpan), - bParallel_(false) + source_(*data), firstColumn_(firstColumn), columnSpan_(columnSpan), bParallel_(false) { GMX_RELEASE_ASSERT(data != nullptr, "Source data must not be NULL"); GMX_RELEASE_ASSERT(firstColumn >= 0 && columnSpan > 0, "Invalid proxy column"); diff --git a/src/gromacs/analysisdata/datastorage.cpp b/src/gromacs/analysisdata/datastorage.cpp index 2e701f2ecf..faf425ccc0 100644 --- a/src/gromacs/analysisdata/datastorage.cpp +++ b/src/gromacs/analysisdata/datastorage.cpp @@ -537,9 +537,7 @@ void AnalysisDataStorageImpl::finishFrameSerial(int index) */ AnalysisDataStorageFrameData::AnalysisDataStorageFrameData(AnalysisDataStorageImpl* storageImpl, int index) : - storageImpl_(*storageImpl), - header_(index, 0.0, 0.0), - status_(eMissing) + storageImpl_(*storageImpl), header_(index, 0.0, 0.0), status_(eMissing) { GMX_RELEASE_ASSERT(storageImpl->data_ != nullptr, "Storage frame constructed before data started"); diff --git a/src/gromacs/analysisdata/framelocaldata.h b/src/gromacs/analysisdata/framelocaldata.h index 33d9e977ed..6c5fe01432 100644 --- a/src/gromacs/analysisdata/framelocaldata.h +++ b/src/gromacs/analysisdata/framelocaldata.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2019,2020,2021, 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. @@ -106,8 +106,7 @@ public: //! Constructs a handle from specified frame data. AnalysisDataFrameLocalDataHandle(const std::vector* dataSetIndices, ValueArray* values) : - dataSetIndices_(dataSetIndices), - values_(values) + dataSetIndices_(dataSetIndices), values_(values) { } diff --git a/src/gromacs/analysisdata/modules/histogram.cpp b/src/gromacs/analysisdata/modules/histogram.cpp index 59d5ac6ac7..22c43011b9 100644 --- a/src/gromacs/analysisdata/modules/histogram.cpp +++ b/src/gromacs/analysisdata/modules/histogram.cpp @@ -96,12 +96,7 @@ AnalysisHistogramSettingsInitializer::AnalysisHistogramSettingsInitializer() : */ AnalysisHistogramSettings::AnalysisHistogramSettings() : - firstEdge_(0.0), - lastEdge_(0.0), - binWidth_(0.0), - inverseBinWidth_(0.0), - binCount_(0), - bAll_(false) + firstEdge_(0.0), lastEdge_(0.0), binWidth_(0.0), inverseBinWidth_(0.0), binCount_(0), bAll_(false) { } @@ -513,8 +508,7 @@ BasicHistogramImpl::BasicHistogramImpl() : averager_(new BasicAverageHistogramMo BasicHistogramImpl::BasicHistogramImpl(const AnalysisHistogramSettings& settings) : - settings_(settings), - averager_(new BasicAverageHistogramModule(settings)) + settings_(settings), averager_(new BasicAverageHistogramModule(settings)) { } diff --git a/src/gromacs/analysisdata/modules/plot.cpp b/src/gromacs/analysisdata/modules/plot.cpp index 09fab9e125..e737ac3dce 100644 --- a/src/gromacs/analysisdata/modules/plot.cpp +++ b/src/gromacs/analysisdata/modules/plot.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -73,9 +73,7 @@ namespace gmx */ AnalysisDataPlotSettings::AnalysisDataPlotSettings() : - selections_(nullptr), - timeUnit_(TimeUnit::Default), - plotFormat_(XvgFormat::Xmgrace) + selections_(nullptr), timeUnit_(TimeUnit::Default), plotFormat_(XvgFormat::Xmgrace) { } @@ -420,8 +418,7 @@ AnalysisDataVectorPlotModule::AnalysisDataVectorPlotModule() : bWrite_{ true, tr AnalysisDataVectorPlotModule::AnalysisDataVectorPlotModule(const AnalysisDataPlotSettings& settings) : - AbstractPlotModule(settings), - bWrite_{ true, true, true, false } + AbstractPlotModule(settings), bWrite_{ true, true, true, false } { } diff --git a/src/gromacs/analysisdata/tests/datatest.cpp b/src/gromacs/analysisdata/tests/datatest.cpp index 4bf7a4ef12..8f7480b5ca 100644 --- a/src/gromacs/analysisdata/tests/datatest.cpp +++ b/src/gromacs/analysisdata/tests/datatest.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2011,2012,2013,2014,2015 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -67,9 +67,7 @@ namespace test */ AnalysisDataTestInputPointSet::AnalysisDataTestInputPointSet(int index, int dataSetIndex, int firstColumn) : - index_(index), - dataSetIndex_(dataSetIndex), - firstColumn_(firstColumn) + index_(index), dataSetIndex_(dataSetIndex), firstColumn_(firstColumn) { } @@ -119,8 +117,7 @@ void AnalysisDataTestInputFrame::addPointSetWithValueAndError(int dataSet, int f */ AnalysisDataTestInput::AnalysisDataTestInput(int dataSetCount, bool bMultipoint) : - columnCounts_(dataSetCount), - bMultipoint_(bMultipoint) + columnCounts_(dataSetCount), bMultipoint_(bMultipoint) { } diff --git a/src/gromacs/analysisdata/tests/mock_datamodule.cpp b/src/gromacs/analysisdata/tests/mock_datamodule.cpp index e99f5e8935..1f349e5f3e 100644 --- a/src/gromacs/analysisdata/tests/mock_datamodule.cpp +++ b/src/gromacs/analysisdata/tests/mock_datamodule.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2011,2012,2013,2014,2015 by the GROMACS development team. - * Copyright (c) 2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2019,2020,2021, 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. @@ -336,10 +336,7 @@ public: const AnalysisDataTestInputPointSet* points, int firstcol, int n) : - frame_(frame), - points_(points), - firstcol_(firstcol), - n_(n) + frame_(frame), points_(points), firstcol_(firstcol), n_(n) { } diff --git a/src/gromacs/applied_forces/awh/awh.cpp b/src/gromacs/applied_forces/awh/awh.cpp index de3ebea891..159aa0639e 100644 --- a/src/gromacs/applied_forces/awh/awh.cpp +++ b/src/gromacs/applied_forces/awh/awh.cpp @@ -147,8 +147,7 @@ static bool anyDimUsesPull(const ArrayRef biasCoupledToSyst } BiasCoupledToSystem::BiasCoupledToSystem(Bias bias, const std::vector& pullCoordIndex) : - bias_(std::move(bias)), - pullCoordIndex_(pullCoordIndex) + bias_(std::move(bias)), pullCoordIndex_(pullCoordIndex) { /* We already checked for this in grompp, but check again here. */ GMX_RELEASE_ASSERT( diff --git a/src/gromacs/applied_forces/awh/awh.h b/src/gromacs/applied_forces/awh/awh.h index d44f295eb2..89f358e532 100644 --- a/src/gromacs/applied_forces/awh/awh.h +++ b/src/gromacs/applied_forces/awh/awh.h @@ -281,7 +281,7 @@ private: const t_commrec* commRecord_; /**< Pointer to the communication record. */ const gmx_multisim_t* multiSimRecord_; /**< Handler for multi-simulations. */ pull_t* pull_; /**< Pointer to the pull working data. */ - double potentialOffset_; /**< The offset of the bias potential which changes due to bias updates. */ + double potentialOffset_; /**< The offset of the bias potential which changes due to bias updates. */ const int numFepLambdaStates_; /**< The number of free energy lambda states of the system. */ int fepLambdaState_; /**< The current free energy lambda state. */ }; diff --git a/src/gromacs/applied_forces/awh/biasgrid.cpp b/src/gromacs/applied_forces/awh/biasgrid.cpp index bd3fe10c58..ccc7dca959 100644 --- a/src/gromacs/applied_forces/awh/biasgrid.cpp +++ b/src/gromacs/applied_forces/awh/biasgrid.cpp @@ -753,9 +753,7 @@ void BiasGrid::initPoints() } GridAxis::GridAxis(double origin, double end, double period, double pointDensity) : - origin_(origin), - period_(period), - isFepLambdaAxis_(false) + origin_(origin), period_(period), isFepLambdaAxis_(false) { length_ = getIntervalLengthPeriodic(origin_, end, period_); @@ -797,10 +795,7 @@ GridAxis::GridAxis(double origin, double end, double period, double pointDensity } GridAxis::GridAxis(double origin, double end, double period, int numPoints, bool isFepLambdaAxis) : - origin_(origin), - period_(period), - numPoints_(numPoints), - isFepLambdaAxis_(isFepLambdaAxis) + origin_(origin), period_(period), numPoints_(numPoints), isFepLambdaAxis_(isFepLambdaAxis) { if (isFepLambdaAxis) { diff --git a/src/gromacs/applied_forces/awh/biasparams.h b/src/gromacs/applied_forces/awh/biasparams.h index ec72ace256..119f91d74e 100644 --- a/src/gromacs/applied_forces/awh/biasparams.h +++ b/src/gromacs/applied_forces/awh/biasparams.h @@ -211,10 +211,10 @@ private: const int64_t numStepsUpdateTarget_; /**< Number of steps per updating the target distribution. */ const int64_t numStepsCheckCovering_; /**< Number of steps per checking for covering. */ public: - const AwhTargetType eTarget; /**< Type of target distribution. */ - const double freeEnergyCutoffInKT; /**< Free energy cut-off in kT for cut-off target distribution. */ - const double temperatureScaleFactor; /**< Temperature scaling factor for temperature scaled targed distributions. */ - const bool idealWeighthistUpdate; /**< Update reference weighthistogram using the target distribution? Otherwise use the realized distribution. */ + const AwhTargetType eTarget; /**< Type of target distribution. */ + const double freeEnergyCutoffInKT; /**< Free energy cut-off in kT for cut-off target distribution. */ + const double temperatureScaleFactor; /**< Temperature scaling factor for temperature scaled targed distributions. */ + const bool idealWeighthistUpdate; /**< Update reference weighthistogram using the target distribution? Otherwise use the realized distribution. */ const int numSharedUpdate; /**< The number of (multi-)simulations sharing the bias update */ const double updateWeight; /**< The probability weight accumulated for each update. */ const double localWeightScaling; /**< Scaling factor applied to a sample before adding it to the reference weight histogram (= 1, usually). */ @@ -224,7 +224,7 @@ private: awh_ivec coverRadius_; /**< The radius (in points) that needs to be sampled around a point before it is considered covered. */ public: const bool convolveForce; /**< True if we convolve the force, false means use MC between umbrellas. */ - const int biasIndex; /**< Index of the bias, used as a second random seed and for priting. */ + const int biasIndex; /**< Index of the bias, used as a second random seed and for priting. */ private: const bool disableUpdateSkips_; /**< If true, we disallow update skips, even when the method supports it. */ }; diff --git a/src/gromacs/applied_forces/awh/biaswriter.cpp b/src/gromacs/applied_forces/awh/biaswriter.cpp index aa0b916dfe..903ea747d9 100644 --- a/src/gromacs/applied_forces/awh/biaswriter.cpp +++ b/src/gromacs/applied_forces/awh/biaswriter.cpp @@ -124,9 +124,7 @@ float getNormalizationValue(AwhOutputEntryType outputType, const Bias& bias, int } // namespace AwhEnergyBlock::AwhEnergyBlock(int numPoints, Normalization normalizationType, float normalizationValue) : - normalizationType(normalizationType), - normalizationValue(normalizationValue), - data_(numPoints) + normalizationType(normalizationType), normalizationValue(normalizationValue), data_(numPoints) { } diff --git a/src/gromacs/applied_forces/awh/correlationgrid.cpp b/src/gromacs/applied_forces/awh/correlationgrid.cpp index 5a7b956e1b..b50ed789cd 100644 --- a/src/gromacs/applied_forces/awh/correlationgrid.cpp +++ b/src/gromacs/applied_forces/awh/correlationgrid.cpp @@ -85,8 +85,7 @@ CorrelationGrid::CorrelationGrid(int numPoints, double blockLengthInit, BlockLengthMeasure blockLengthMeasure, double dtSample) : - dtSample(dtSample), - blockLengthMeasure(blockLengthMeasure) + dtSample(dtSample), blockLengthMeasure(blockLengthMeasure) { /* Set the initial block length for the block averaging. The length doesn't really matter after the block length has been doubled a few times, as long as it's set small enough */ diff --git a/src/gromacs/applied_forces/awh/dimparams.h b/src/gromacs/applied_forces/awh/dimparams.h index 11fc93f83c..cf536b8ec8 100644 --- a/src/gromacs/applied_forces/awh/dimparams.h +++ b/src/gromacs/applied_forces/awh/dimparams.h @@ -93,8 +93,7 @@ private: * Private constructor called by public builder functions for PullDimParams and FepLambdaDimParams. */ DimParams(double conversionFactor, std::variant dimParams) : - dimParams(std::move(dimParams)), - userCoordUnitsToInternal(conversionFactor) + dimParams(std::move(dimParams)), userCoordUnitsToInternal(conversionFactor) { } diff --git a/src/gromacs/applied_forces/awh/tests/awh_setup.h b/src/gromacs/applied_forces/awh/tests/awh_setup.h index 18bd4be1a9..6e2c1f553d 100644 --- a/src/gromacs/applied_forces/awh/tests/awh_setup.h +++ b/src/gromacs/applied_forces/awh/tests/awh_setup.h @@ -72,9 +72,7 @@ struct AwhTestParameters explicit AwhTestParameters(ISerializer* serializer); //! Move constructor AwhTestParameters(AwhTestParameters&& o) noexcept : - beta(o.beta), - awhParams(std::move(o.awhParams)), - dimParams(std::move(o.dimParams)) + beta(o.beta), awhParams(std::move(o.awhParams)), dimParams(std::move(o.dimParams)) { } //! 1/(kB*T). diff --git a/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp b/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp index 75d1d26a07..2f8a8bc89e 100644 --- a/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp +++ b/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp @@ -220,7 +220,7 @@ DensityFittingAmplitudeLookup& DensityFittingAmplitudeLookup::operator=(const De DensityFittingAmplitudeLookup::DensityFittingAmplitudeLookup(DensityFittingAmplitudeLookup&&) noexcept = default; -DensityFittingAmplitudeLookup& DensityFittingAmplitudeLookup:: - operator=(DensityFittingAmplitudeLookup&&) noexcept = default; +DensityFittingAmplitudeLookup& +DensityFittingAmplitudeLookup::operator=(DensityFittingAmplitudeLookup&&) noexcept = default; } // namespace gmx diff --git a/src/gromacs/applied_forces/densityfitting/densityfittingforceprovider.cpp b/src/gromacs/applied_forces/densityfitting/densityfittingforceprovider.cpp index 9a4f5d7e86..111b79b0b8 100644 --- a/src/gromacs/applied_forces/densityfitting/densityfittingforceprovider.cpp +++ b/src/gromacs/applied_forces/densityfitting/densityfittingforceprovider.cpp @@ -233,11 +233,11 @@ DensityFittingForceProvider::Impl::Impl(const DensityFittingParameters& Matrix3x3 translationMatrix = transformationMatrixParametersAsArray.has_value() ? *transformationMatrixParametersAsArray : identityMatrix(); - RVec translationVector = translationParametersAsArray.has_value() - ? RVec((*translationParametersAsArray)[XX], + RVec translationVector = translationParametersAsArray.has_value() + ? RVec((*translationParametersAsArray)[XX], (*translationParametersAsArray)[YY], (*translationParametersAsArray)[ZZ]) - : RVec(0, 0, 0); + : RVec(0, 0, 0); affineTransformation_.emplace(translationMatrix.asConstView(), translationVector); } diff --git a/src/gromacs/commandline/cmdlinehelpcontext.cpp b/src/gromacs/commandline/cmdlinehelpcontext.cpp index 04abd86817..306a984ad0 100644 --- a/src/gromacs/commandline/cmdlinehelpcontext.cpp +++ b/src/gromacs/commandline/cmdlinehelpcontext.cpp @@ -85,9 +85,7 @@ public: } //! Creates an implementation class from a low-level context. explicit Impl(const HelpWriterContext& writerContext) : - writerContext_(writerContext), - completionWriter_(nullptr), - bHidden_(false) + writerContext_(writerContext), completionWriter_(nullptr), bHidden_(false) { } diff --git a/src/gromacs/commandline/cmdlinehelpmodule.cpp b/src/gromacs/commandline/cmdlinehelpmodule.cpp index 4518c54515..fd0ca99811 100644 --- a/src/gromacs/commandline/cmdlinehelpmodule.cpp +++ b/src/gromacs/commandline/cmdlinehelpmodule.cpp @@ -425,8 +425,7 @@ class ModuleHelpTopic : public IHelpTopic public: //! Constructs a help topic for a specific module. ModuleHelpTopic(const ICommandLineModule& module, const CommandLineHelpModuleImpl& helpModule) : - module_(module), - helpModule_(helpModule) + module_(module), helpModule_(helpModule) { } @@ -519,9 +518,7 @@ private: HelpExportReStructuredText::HelpExportReStructuredText(const CommandLineHelpModuleImpl& helpModule, IFileOutputRedirector* outputRedirector) : - outputRedirector_(outputRedirector), - binaryName_(helpModule.binaryName_), - links_(eHelpOutputFormat_Rst) + outputRedirector_(outputRedirector), binaryName_(helpModule.binaryName_), links_(eHelpOutputFormat_Rst) { TextReader linksFile("links.dat"); std::string line; @@ -793,8 +790,7 @@ class ModificationCheckingFileOutputStream : public TextOutputStream { public: ModificationCheckingFileOutputStream(const char* path, IFileOutputRedirector* redirector) : - path_(path), - redirector_(redirector) + path_(path), redirector_(redirector) { } diff --git a/src/gromacs/commandline/cmdlinehelpwriter.cpp b/src/gromacs/commandline/cmdlinehelpwriter.cpp index bd03eebe65..e98d0efbea 100644 --- a/src/gromacs/commandline/cmdlinehelpwriter.cpp +++ b/src/gromacs/commandline/cmdlinehelpwriter.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -287,11 +287,7 @@ class SynopsisFormatter : public IOptionsFormatter public: //! Creates a helper object for formatting the synopsis. explicit SynopsisFormatter(const HelpWriterContext& context) : - context_(context), - bFormatted_(false), - lineLength_(0), - indent_(0), - currentLength_(0) + context_(context), bFormatted_(false), lineLength_(0), indent_(0), currentLength_(0) { } @@ -430,11 +426,7 @@ private: OptionsListFormatter::OptionsListFormatter(const HelpWriterContext& context, const CommonFormatterData& common, const char* title) : - context_(context), - common_(common), - title_(title), - header_(nullptr), - bDidOutput_(false) + context_(context), common_(common), title_(title), header_(nullptr), bDidOutput_(false) { } diff --git a/src/gromacs/commandline/cmdlinemodulemanager_impl.h b/src/gromacs/commandline/cmdlinemodulemanager_impl.h index 2ab9d2bb0d..1af5f01598 100644 --- a/src/gromacs/commandline/cmdlinemodulemanager_impl.h +++ b/src/gromacs/commandline/cmdlinemodulemanager_impl.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2015,2019, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2015,2019,2021, 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. @@ -94,9 +94,7 @@ public: * Does not throw. */ CommandLineModuleGroupData(const CommandLineModuleMap& modules, const char* binaryName, const char* title) : - allModules_(modules), - binaryName_(binaryName), - title_(title) + allModules_(modules), binaryName_(binaryName), title_(title) { } diff --git a/src/gromacs/commandline/cmdlineoptionsmodule.cpp b/src/gromacs/commandline/cmdlineoptionsmodule.cpp index 53f2f92636..36badc4093 100644 --- a/src/gromacs/commandline/cmdlineoptionsmodule.cpp +++ b/src/gromacs/commandline/cmdlineoptionsmodule.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -111,15 +111,11 @@ public: typedef ICommandLineOptionsModule::FactoryMethod FactoryMethod; CommandLineOptionsModule(const char* name, const char* description, FactoryMethod factory) : - name_(name), - description_(description), - factory_(std::move(factory)) + name_(name), description_(description), factory_(std::move(factory)) { } CommandLineOptionsModule(const char* name, const char* description, ICommandLineOptionsModulePointer module) : - name_(name), - description_(description), - module_(std::move(module)) + name_(name), description_(description), module_(std::move(module)) { } const char* name() const override { return name_; } diff --git a/src/gromacs/commandline/cmdlineparser.cpp b/src/gromacs/commandline/cmdlineparser.cpp index 5f33ed552f..c3b9dc0851 100644 --- a/src/gromacs/commandline/cmdlineparser.cpp +++ b/src/gromacs/commandline/cmdlineparser.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -93,9 +93,7 @@ public: }; CommandLineParser::Impl::Impl(Options* options) : - assigner_(options), - bSkipUnknown_(false), - bAllowPositionalArguments_(false) + assigner_(options), bSkipUnknown_(false), bAllowPositionalArguments_(false) { assigner_.setAcceptBooleanNoPrefix(true); } diff --git a/src/gromacs/commandline/cmdlineprogramcontext.cpp b/src/gromacs/commandline/cmdlineprogramcontext.cpp index 5c4b5b89f0..6b1eda99af 100644 --- a/src/gromacs/commandline/cmdlineprogramcontext.cpp +++ b/src/gromacs/commandline/cmdlineprogramcontext.cpp @@ -312,9 +312,7 @@ public: CommandLineProgramContext::Impl::Impl() : programName_("GROMACS"), bSourceLayout_(false) {} CommandLineProgramContext::Impl::Impl(int argc, const char* const argv[], ExecutableEnvironmentPointer env) : - executableEnv_(std::move(env)), - invokedName_(argc != 0 ? argv[0] : ""), - bSourceLayout_(false) + executableEnv_(std::move(env)), invokedName_(argc != 0 ? argv[0] : ""), bSourceLayout_(false) { programName_ = Path::getFilename(invokedName_); programName_ = stripSuffixIfPresent(programName_, ".exe"); diff --git a/src/gromacs/commandline/pargs.cpp b/src/gromacs/commandline/pargs.cpp index c027dba96a..9acde8e261 100644 --- a/src/gromacs/commandline/pargs.cpp +++ b/src/gromacs/commandline/pargs.cpp @@ -276,10 +276,7 @@ private: { //! Creates a conversion helper for a given `t_pargs` struct. explicit ProgramArgData(t_pargs* pa) : - pa(pa), - optionInfo(nullptr), - enumIndex(0), - boolValue(false) + pa(pa), optionInfo(nullptr), enumIndex(0), boolValue(false) { } diff --git a/src/gromacs/commandline/pargs.h b/src/gromacs/commandline/pargs.h index 3ceb0acc81..08b1999a8e 100644 --- a/src/gromacs/commandline/pargs.h +++ b/src/gromacs/commandline/pargs.h @@ -91,7 +91,8 @@ typedef struct * changed. In other words, the initial value for the variable defines the * default value. */ - union { + union + { /*! \brief * Generic pointer for operations that do not need type information. * diff --git a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp index 9d7684be2e..5a0de0edfa 100644 --- a/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp +++ b/src/gromacs/commandline/tests/cmdlinemodulemanagertest.cpp @@ -124,8 +124,7 @@ class CommandLineModuleManagerTestBase::Impl { public: Impl(const CommandLine& args, const char* realBinaryName) : - programContext_(args.argc(), args.argv()), - manager_(realBinaryName, &programContext_) + programContext_(args.argc(), args.argv()), manager_(realBinaryName, &programContext_) { manager_.setQuiet(true); manager_.setOutputRedirector(&redirector_); diff --git a/src/gromacs/commandline/tests/cmdlineparser.cpp b/src/gromacs/commandline/tests/cmdlineparser.cpp index 9558b9b309..2020e41cd7 100644 --- a/src/gromacs/commandline/tests/cmdlineparser.cpp +++ b/src/gromacs/commandline/tests/cmdlineparser.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -78,10 +78,7 @@ public: }; CommandLineParserTest::CommandLineParserTest() : - parser_(&options_), - flag_(false), - ivalue1p_(0), - ivalue12_(0) + parser_(&options_), flag_(false), ivalue1p_(0), ivalue12_(0) { using gmx::BooleanOption; using gmx::DoubleOption; diff --git a/src/gromacs/coordinateio/coordinatefile.h b/src/gromacs/coordinateio/coordinatefile.h index 86dcc9b4ab..fc7fa14e46 100644 --- a/src/gromacs/coordinateio/coordinatefile.h +++ b/src/gromacs/coordinateio/coordinatefile.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -109,11 +109,7 @@ public: * than the object created here. */ TrajectoryFileOpener(const std::string& name, int filetype, const Selection& sel, const gmx_mtop_t* mtop) : - outputFileName_(name), - outputFile_(nullptr), - filetype_(filetype), - sel_(sel), - mtop_(mtop) + outputFileName_(name), outputFile_(nullptr), filetype_(filetype), sel_(sel), mtop_(mtop) { } @@ -201,8 +197,7 @@ private: const Selection& sel, const gmx_mtop_t* mtop, OutputAdapterContainer adapters) : - file_(name, filetype, sel, mtop), - outputAdapters_(std::move(adapters)) + file_(name, filetype, sel, mtop), outputAdapters_(std::move(adapters)) { } diff --git a/src/gromacs/coordinateio/outputadapters/setatoms.h b/src/gromacs/coordinateio/outputadapters/setatoms.h index 00d7d1af37..2091cf38a5 100644 --- a/src/gromacs/coordinateio/outputadapters/setatoms.h +++ b/src/gromacs/coordinateio/outputadapters/setatoms.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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,9 +76,7 @@ public: * framework. */ explicit SetAtoms(ChangeAtomsType atomFlag, AtomsDataPtr inputAtoms) : - atomFlag_(atomFlag), - haveStructureFileAtoms_(false), - atoms_(std::move(inputAtoms)) + atomFlag_(atomFlag), haveStructureFileAtoms_(false), atoms_(std::move(inputAtoms)) { if (atoms_ != nullptr) { diff --git a/src/gromacs/coordinateio/outputadapters/setstarttime.h b/src/gromacs/coordinateio/outputadapters/setstarttime.h index 247f337790..6f47e16977 100644 --- a/src/gromacs/coordinateio/outputadapters/setstarttime.h +++ b/src/gromacs/coordinateio/outputadapters/setstarttime.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -68,9 +68,7 @@ public: * \param[in] startTime User defined value for the initial time. */ explicit SetStartTime(real startTime) : - startTime_(startTime), - haveProcessedFirstFrame_(false), - differenceToInitialTime_(0) + startTime_(startTime), haveProcessedFirstFrame_(false), differenceToInitialTime_(0) { } /*! \brief diff --git a/src/gromacs/coordinateio/outputadapters/settimestep.h b/src/gromacs/coordinateio/outputadapters/settimestep.h index 6368a88583..fbae8451ca 100644 --- a/src/gromacs/coordinateio/outputadapters/settimestep.h +++ b/src/gromacs/coordinateio/outputadapters/settimestep.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -71,9 +71,7 @@ public: * \param[in] timeStep User defined value for the time step. */ explicit SetTimeStep(real timeStep) : - timeStep_(timeStep), - previousFrameTime_(0.0), - haveProcessedFirstFrame_(false) + timeStep_(timeStep), previousFrameTime_(0.0), haveProcessedFirstFrame_(false) { } /*! \brief diff --git a/src/gromacs/domdec/dlbtiming.cpp b/src/gromacs/domdec/dlbtiming.cpp index c13fc4a8b4..dcde124435 100644 --- a/src/gromacs/domdec/dlbtiming.cpp +++ b/src/gromacs/domdec/dlbtiming.cpp @@ -50,11 +50,7 @@ struct BalanceRegion { /*! \brief Constructor */ BalanceRegion() : - isOpen(false), - isOpenOnCpu(false), - isOpenOnGpu(false), - cyclesOpenCpu(0), - cyclesLastCpu(0) + isOpen(false), isOpenOnCpu(false), isOpenOnGpu(false), cyclesOpenCpu(0), cyclesLastCpu(0) { } diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index 346a09bf6d..a9304bbab6 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -1285,7 +1285,7 @@ static void setup_neighbor_relations(gmx_domdec_t* dd) static void make_pp_communicator(const gmx::MDLogger& mdlog, gmx_domdec_t* dd, t_commrec gmx_unused* cr, - bool gmx_unused reorder) + bool gmx_unused reorder) { #if GMX_MPI gmx_domdec_comm_t* comm = dd->comm; @@ -1422,10 +1422,10 @@ static void receive_ddindex2simnodeid(gmx_domdec_t* dd, t_commrec* cr) static CartesianRankSetup split_communicator(const gmx::MDLogger& mdlog, t_commrec* cr, const DdRankOrder ddRankOrder, - bool gmx_unused reorder, - const DDRankSetup& ddRankSetup, - ivec ddCellIndex, - std::vector* pmeRanks) + bool gmx_unused reorder, + const DDRankSetup& ddRankSetup, + ivec ddCellIndex, + std::vector* pmeRanks) { CartesianRankSetup cartSetup; @@ -2928,11 +2928,7 @@ DomainDecompositionBuilder::Impl::Impl(const MDLogger& mdlog, const t_inputrec& ir, const matrix box, ArrayRef xGlobal) : - mdlog_(mdlog), - cr_(cr), - options_(options), - mtop_(mtop), - ir_(ir) + mdlog_(mdlog), cr_(cr), options_(options), mtop_(mtop), ir_(ir) { GMX_LOG(mdlog_.info).appendTextFormatted("\nInitializing Domain Decomposition on %d ranks", cr_->sizeOfDefaultCommunicator); diff --git a/src/gromacs/domdec/domdec_network.cpp b/src/gromacs/domdec/domdec_network.cpp index c6363362fe..b5c01f85e0 100644 --- a/src/gromacs/domdec/domdec_network.cpp +++ b/src/gromacs/domdec/domdec_network.cpp @@ -146,15 +146,15 @@ template void ddSendrecv(const gmx_domdec_t*, int, int, gmx::ArrayRef, gmx template void ddSendrecv(const gmx_domdec_t*, int, int, gmx::ArrayRef, gmx::ArrayRef); void dd_sendrecv2_rvec(const struct gmx_domdec_t gmx_unused* dd, - int gmx_unused ddimind, + int gmx_unused ddimind, rvec gmx_unused* buf_s_fw, - int gmx_unused n_s_fw, + int gmx_unused n_s_fw, rvec gmx_unused* buf_r_fw, - int gmx_unused n_r_fw, + int gmx_unused n_r_fw, rvec gmx_unused* buf_s_bw, - int gmx_unused n_s_bw, + int gmx_unused n_s_bw, rvec gmx_unused* buf_r_bw, - int gmx_unused n_r_bw) + int gmx_unused n_r_bw) { #if GMX_MPI MPI_Request req[4]; @@ -275,7 +275,7 @@ void dd_scatter(const gmx_domdec_t gmx_unused* dd, int gmx_unused nbytes, const } void dd_gather(const gmx_domdec_t gmx_unused* dd, - int gmx_unused nbytes, + int gmx_unused nbytes, const void gmx_unused* src, void gmx_unused* dest) { @@ -318,7 +318,7 @@ void dd_scatterv(const gmx_domdec_t gmx_unused* dd, } void dd_gatherv(const gmx_domdec_t gmx_unused* dd, - int gmx_unused scount, + int gmx_unused scount, const void gmx_unused* sbuf, int gmx_unused* rcounts, int gmx_unused* disps, diff --git a/src/gromacs/domdec/domdec_specatomcomm.cpp b/src/gromacs/domdec/domdec_specatomcomm.cpp index 948041d7d7..89948c7bd2 100644 --- a/src/gromacs/domdec/domdec_specatomcomm.cpp +++ b/src/gromacs/domdec/domdec_specatomcomm.cpp @@ -378,14 +378,14 @@ int setup_specat_communication(gmx_domdec_t* dd, for (int d = dd->ndim - 1; d >= 0; d--) { /* Pulse the grid forward and backward */ - int dim = dd->dim[d]; - bool bPBC = (dim < dd->unitCellInfo.npbcdim); - const int ndir = (dd->numCells[dim] == 2) - ? - /* Only 2 cells, so we only need to communicate once */ + int dim = dd->dim[d]; + bool bPBC = (dim < dd->unitCellInfo.npbcdim); + const int ndir = (dd->numCells[dim] == 2) + ? + /* Only 2 cells, so we only need to communicate once */ 1 - : 2; - int* nsend_ptr = nullptr; + : 2; + int* nsend_ptr = nullptr; for (int dir = 0; dir < ndir; dir++) { if (!bPBC && dd->numCells[dim] > 2 diff --git a/src/gromacs/domdec/ga2la.h b/src/gromacs/domdec/ga2la.h index e4b972afbf..1f6b92d0e3 100644 --- a/src/gromacs/domdec/ga2la.h +++ b/src/gromacs/domdec/ga2la.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2010,2014,2015,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -166,7 +166,8 @@ public: } private: - union Data { + union Data + { std::vector direct; gmx::HashedMap hashed; // constructor and destructor function in parent class diff --git a/src/gromacs/essentialdynamics/edsam.cpp b/src/gromacs/essentialdynamics/edsam.cpp index 605c36d485..ad5e7d9295 100644 --- a/src/gromacs/essentialdynamics/edsam.cpp +++ b/src/gromacs/essentialdynamics/edsam.cpp @@ -1960,7 +1960,7 @@ static void translate_and_rotate(rvec* x, /* The positions to be transla /* Gets the rms deviation of the positions to the structure s */ /* fit_to_structure has to be called before calling this routine! */ -static real rmsd_from_structure(rvec* x, /* The positions under consideration */ +static real rmsd_from_structure(rvec* x, /* The positions under consideration */ struct gmx_edx* s) /* The structure from which the rmsd shall be computed */ { real rmsd = 0.0; diff --git a/src/gromacs/ewald/pme.cpp b/src/gromacs/ewald/pme.cpp index efea5c7a06..027cc6f245 100644 --- a/src/gromacs/ewald/pme.cpp +++ b/src/gromacs/ewald/pme.cpp @@ -323,11 +323,7 @@ PmeAtomComm::PmeAtomComm(MPI_Comm PmeMpiCommunicator, const int pmeOrder, const int dimIndex, const bool doSpread) : - dimind(dimIndex), - bSpread(doSpread), - pme_order(pmeOrder), - nthread(numThreads), - spline(nthread) + dimind(dimIndex), bSpread(doSpread), pme_order(pmeOrder), nthread(numThreads), spline(nthread) { if (PmeMpiCommunicator != MPI_COMM_NULL) { diff --git a/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu b/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu index 7fa2122dfb..0fbede7b09 100644 --- a/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu +++ b/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu @@ -59,9 +59,7 @@ namespace gmx PmeCoordinateReceiverGpu::Impl::Impl(const DeviceStream& pmeStream, MPI_Comm comm, gmx::ArrayRef ppRanks) : - pmeStream_(pmeStream), - comm_(comm), - ppRanks_(ppRanks) + pmeStream_(pmeStream), comm_(comm), ppRanks_(ppRanks) { request_.resize(ppRanks.size()); ppSync_.resize(ppRanks.size()); diff --git a/src/gromacs/ewald/pme_force_sender_gpu_impl.cu b/src/gromacs/ewald/pme_force_sender_gpu_impl.cu index b124c03136..ecec4d6ac6 100644 --- a/src/gromacs/ewald/pme_force_sender_gpu_impl.cu +++ b/src/gromacs/ewald/pme_force_sender_gpu_impl.cu @@ -58,9 +58,7 @@ namespace gmx PmeForceSenderGpu::Impl::Impl(GpuEventSynchronizer* pmeForcesReady, MPI_Comm comm, gmx::ArrayRef ppRanks) : - pmeForcesReady_(pmeForcesReady), - comm_(comm), - ppRanks_(ppRanks) + pmeForcesReady_(pmeForcesReady), comm_(comm), ppRanks_(ppRanks) { } diff --git a/src/gromacs/ewald/pme_gather.clh b/src/gromacs/ewald/pme_gather.clh index 361461b417..f9e3e95715 100644 --- a/src/gromacs/ewald/pme_gather.clh +++ b/src/gromacs/ewald/pme_gather.clh @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -313,7 +313,7 @@ __kernel void CUSTOMIZED_KERNEL_NAME(pme_gather_kernel)(const struct PmeOpenCLKe #define gridlineIndicesSize (atomsPerBlock * DIM) #define splineParamsSize (atomsPerBlock * DIM * order) - __local int sm_gridlineIndices[gridlineIndicesSize]; + __local int sm_gridlineIndices[gridlineIndicesSize]; __local float2 sm_splineParams[splineParamsSize]; /* Theta/dtheta pairs as .x/.y */ /* Spline Y/Z coordinates */ diff --git a/src/gromacs/ewald/pme_gather.cpp b/src/gromacs/ewald/pme_gather.cpp index 2a7925cfe2..babb5837b2 100644 --- a/src/gromacs/ewald/pme_gather.cpp +++ b/src/gromacs/ewald/pme_gather.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -77,16 +77,12 @@ using namespace gmx; // TODO: Remove when this file is moved into gmx namespace */ struct do_fspline { - do_fspline(const gmx_pme_t* pme, - const real* gmx_restrict grid, - const PmeAtomComm* gmx_restrict atc, + do_fspline(const gmx_pme_t* pme, + const real* gmx_restrict grid, + const PmeAtomComm* gmx_restrict atc, const splinedata_t* gmx_restrict spline, int nn) : - pme(pme), - grid(grid), - atc(atc), - spline(spline), - nn(nn) + pme(pme), grid(grid), atc(atc), spline(spline), nn(nn) { } @@ -285,9 +281,9 @@ struct do_fspline } #endif private: - const gmx_pme_t* const pme; - const real* const gmx_restrict grid; - const PmeAtomComm* const gmx_restrict atc; + const gmx_pme_t* const pme; + const real* const gmx_restrict grid; + const PmeAtomComm* const gmx_restrict atc; const splinedata_t* const gmx_restrict spline; const int nn; diff --git a/src/gromacs/ewald/pme_gpu_internal.cpp b/src/gromacs/ewald/pme_gpu_internal.cpp index 798a9be9ef..9700d01f94 100644 --- a/src/gromacs/ewald/pme_gpu_internal.cpp +++ b/src/gromacs/ewald/pme_gpu_internal.cpp @@ -1133,8 +1133,8 @@ static auto selectSplineAndSpreadKernelPtr(const PmeGpu* pmeGpu, * * \return Pointer to CUDA kernel */ -static auto selectSplineKernelPtr(const PmeGpu* pmeGpu, - ThreadsPerAtom threadsPerAtom, +static auto selectSplineKernelPtr(const PmeGpu* pmeGpu, + ThreadsPerAtom threadsPerAtom, bool gmx_unused writeSplinesToGlobal, const int numGrids) { diff --git a/src/gromacs/ewald/pme_gpu_types_host_impl.h b/src/gromacs/ewald/pme_gpu_types_host_impl.h index 8204a9123f..6b16ba5c16 100644 --- a/src/gromacs/ewald/pme_gpu_types_host_impl.h +++ b/src/gromacs/ewald/pme_gpu_types_host_impl.h @@ -84,8 +84,7 @@ struct PmeGpuSpecific * \param[in] pmeStream GPU pme stream. */ PmeGpuSpecific(const DeviceContext& deviceContext, const DeviceStream& pmeStream) : - deviceContext_(deviceContext), - pmeStream_(pmeStream) + deviceContext_(deviceContext), pmeStream_(pmeStream) { } diff --git a/src/gromacs/ewald/pme_only.cpp b/src/gromacs/ewald/pme_only.cpp index 82d6574866..c794473010 100644 --- a/src/gromacs/ewald/pme_only.cpp +++ b/src/gromacs/ewald/pme_only.cpp @@ -254,7 +254,7 @@ static int gmx_pme_recv_coeffs_coords(struct gmx_pme_t* pme, real* ewaldcoeff_lj, bool useGpuForPme, gmx::StatePropagatorDataGpu* stateGpu, - PmeRunMode gmx_unused runMode) + PmeRunMode gmx_unused runMode) { int status = -1; int nat = 0; diff --git a/src/gromacs/ewald/pme_redistribute.cpp b/src/gromacs/ewald/pme_redistribute.cpp index e70e45ef2e..9fdea71a55 100644 --- a/src/gromacs/ewald/pme_redistribute.cpp +++ b/src/gromacs/ewald/pme_redistribute.cpp @@ -244,12 +244,12 @@ void PmeAtomComm::setNumAtoms(const int numAtoms) //! Communicates buffers between rank separated by \p shift slabs static void pme_dd_sendrecv(PmeAtomComm gmx_unused* atc, - gmx_bool gmx_unused bBackward, - int gmx_unused shift, + gmx_bool gmx_unused bBackward, + int gmx_unused shift, void gmx_unused* buf_s, - int gmx_unused nbyte_s, + int gmx_unused nbyte_s, void gmx_unused* buf_r, - int gmx_unused nbyte_r) + int gmx_unused nbyte_r) { #if GMX_MPI int dest, src; diff --git a/src/gromacs/ewald/tests/pmebsplinetest.cpp b/src/gromacs/ewald/tests/pmebsplinetest.cpp index 7c38a52c91..1496db2bf5 100644 --- a/src/gromacs/ewald/tests/pmebsplinetest.cpp +++ b/src/gromacs/ewald/tests/pmebsplinetest.cpp @@ -103,7 +103,7 @@ public: inputRec.nkz = gridSize[ZZ]; inputRec.coulombtype = (moduliType == ModuliType::P3M) ? CoulombInteractionType::P3mAD : CoulombInteractionType::Pme; - inputRec.pme_order = pmeOrder; + inputRec.pme_order = pmeOrder; /* PME initialization call which checks the inputs and computes the B-spline moduli according to the grid sizes. */ PmeSafePointer pme = pmeInitEmpty(&inputRec); diff --git a/src/gromacs/ewald/tests/pmetestcommon.cpp b/src/gromacs/ewald/tests/pmetestcommon.cpp index c8e8530ee7..3d611ca0d0 100644 --- a/src/gromacs/ewald/tests/pmetestcommon.cpp +++ b/src/gromacs/ewald/tests/pmetestcommon.cpp @@ -910,8 +910,7 @@ const char* codePathToString(CodePath codePath) PmeTestHardwareContext::PmeTestHardwareContext() : codePath_(CodePath::CPU) {} PmeTestHardwareContext::PmeTestHardwareContext(TestDevice* testDevice) : - codePath_(CodePath::CPU), - testDevice_(testDevice) + codePath_(CodePath::CPU), testDevice_(testDevice) { setActiveDevice(testDevice_->deviceInfo()); pmeGpuProgram_ = buildPmeGpuProgram(testDevice_->deviceContext()); diff --git a/src/gromacs/fileio/mrcdensitymap.cpp b/src/gromacs/fileio/mrcdensitymap.cpp index 2fd3e5aa0f..c4cd56623b 100644 --- a/src/gromacs/fileio/mrcdensitymap.cpp +++ b/src/gromacs/fileio/mrcdensitymap.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -251,8 +251,7 @@ public: }; MrcDensityMapOfFloatWriter::Impl::Impl(const MrcDensityMapHeader& header, ArrayRef data) : - header_(header), - data_(data) + header_(header), data_(data) { } diff --git a/src/gromacs/fileio/mrcdensitymapheader.h b/src/gromacs/fileio/mrcdensitymapheader.h index 82160127fa..c6f471357c 100644 --- a/src/gromacs/fileio/mrcdensitymapheader.h +++ b/src/gromacs/fileio/mrcdensitymapheader.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -87,8 +87,8 @@ enum class MrcDataMode : int32_t */ struct MrcDataStatistics { - float min_ = 0.; //!< Minimum data value scales values in (currently unsupported) compressed data mode. - float max_ = 0.; //!< Maximum data value scales values in (currently unsupported) compressed data mode. + float min_ = 0.; //!< Minimum data value scales values in (currently unsupported) compressed data mode. + float max_ = 0.; //!< Maximum data value scales values in (currently unsupported) compressed data mode. float mean_ = 0.; //!< mean of the data float rms_ = 0.; //!< rms of the data }; diff --git a/src/gromacs/fileio/tests/fileioxdrserializer.cpp b/src/gromacs/fileio/tests/fileioxdrserializer.cpp index 2c5d9b0c43..b57ddcd715 100644 --- a/src/gromacs/fileio/tests/fileioxdrserializer.cpp +++ b/src/gromacs/fileio/tests/fileioxdrserializer.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -56,12 +56,14 @@ namespace test { namespace { -union IntAndFloat32 { +union IntAndFloat32 +{ std::int32_t int32Value_; float floatValue_; }; -union IntAndFloat64 { +union IntAndFloat64 +{ std::int64_t int64Value_; double doubleValue_; }; @@ -104,8 +106,8 @@ public: double doubleValue_ = c_intAndFloat64.doubleValue_; int intValue_ = integerSizeDependentTestingValue(); real realValue_ = std::is_same_v - ? static_cast(c_intAndFloat64.doubleValue_) - : static_cast(c_intAndFloat32.floatValue_); + ? static_cast(c_intAndFloat64.doubleValue_) + : static_cast(c_intAndFloat32.floatValue_); } defaultValues_; TestFileManager fileManager_; diff --git a/src/gromacs/gmxana/gmx_awh.cpp b/src/gromacs/gmxana/gmx_awh.cpp index f83e9ba3a6..3e43d1de53 100644 --- a/src/gromacs/gmxana/gmx_awh.cpp +++ b/src/gromacs/gmxana/gmx_awh.cpp @@ -299,10 +299,7 @@ std::vector makeLegend(const AwhBiasParams& awhBiasParams, } // namespace OutputFile::OutputFile(const std::string& filename, const std::string& baseTitle, int numBias, int biasIndex) : - numDim_(0), - firstGraphSubBlock_(0), - numGraph_(0), - useKTForEnergy_(false) + numDim_(0), firstGraphSubBlock_(0), numGraph_(0), useKTForEnergy_(false) { baseFilename_ = filename.substr(0, filename.find('.')); diff --git a/src/gromacs/gmxana/gmx_order.cpp b/src/gromacs/gmxana/gmx_order.cpp index f0e0857ccd..5113096c85 100644 --- a/src/gromacs/gmxana/gmx_order.cpp +++ b/src/gromacs/gmxana/gmx_order.cpp @@ -436,10 +436,10 @@ static void calc_order(const char* fn, nr_tails, /* nr tails, to check if index file is correct */ size = 0, /* nr. of atoms in group. same as nr_tails */ i, j, m, k, teller = 0, slice; /* current slice number */ - real nr_frames = 0; - int* slCount; /* nr. of atoms in one slice */ - real sdbangle = 0; /* sum of these angles */ - gmx_bool use_unitvector = FALSE; /* use a specified unit vector instead of axis to specify unit normal*/ + real nr_frames = 0; + int* slCount; /* nr. of atoms in one slice */ + real sdbangle = 0; /* sum of these angles */ + gmx_bool use_unitvector = FALSE; /* use a specified unit vector instead of axis to specify unit normal*/ rvec direction, com; int comsize, distsize; int * comidx = nullptr, *distidx = nullptr; diff --git a/src/gromacs/gmxana/gmx_sham.cpp b/src/gromacs/gmxana/gmx_sham.cpp index 44dffff46d..462967fd1c 100644 --- a/src/gromacs/gmxana/gmx_sham.cpp +++ b/src/gromacs/gmxana/gmx_sham.cpp @@ -333,13 +333,13 @@ static void pick_minima(const char* logfile, int* ibox, int ndim, int len, real this_min.ener = W[this_min.index]; if (is_local_minimum_from_below(&this_min, i, 0, index3(ibox, i - 1, j, k), W) && is_local_minimum_from_above( - &this_min, i, ibox[0] - 1, index3(ibox, i + 1, j, k), W) + &this_min, i, ibox[0] - 1, index3(ibox, i + 1, j, k), W) && is_local_minimum_from_below(&this_min, j, 0, index3(ibox, i, j - 1, k), W) && is_local_minimum_from_above( - &this_min, j, ibox[1] - 1, index3(ibox, i, j + 1, k), W) + &this_min, j, ibox[1] - 1, index3(ibox, i, j + 1, k), W) && is_local_minimum_from_below(&this_min, k, 0, index3(ibox, i, j, k - 1), W) && is_local_minimum_from_above( - &this_min, k, ibox[2] - 1, index3(ibox, i, j, k + 1), W)) + &this_min, k, ibox[2] - 1, index3(ibox, i, j, k + 1), W)) { add_minimum(fp, nmin, &this_min, mm); nmin++; @@ -384,11 +384,11 @@ static void pick_minima(const char* logfile, int* ibox, int ndim, int len, real this_point[i]--; bMin = bMin && is_local_minimum_from_below( - &this_min, index, 0, indexn(ndim, ibox, this_point), W); + &this_min, index, 0, indexn(ndim, ibox, this_point), W); this_point[i] += 2; bMin = bMin && is_local_minimum_from_above( - &this_min, index, ibox[i] - 1, indexn(ndim, ibox, this_point), W); + &this_min, index, ibox[i] - 1, indexn(ndim, ibox, this_point), W); this_point[i]--; } if (bMin) diff --git a/src/gromacs/gmxana/gmx_wham.cpp b/src/gromacs/gmxana/gmx_wham.cpp index 55be0a50c6..f747c89299 100644 --- a/src/gromacs/gmxana/gmx_wham.cpp +++ b/src/gromacs/gmxana/gmx_wham.cpp @@ -172,8 +172,8 @@ typedef struct double* k; //!< force constants for the nPull coords double* pos; //!< umbrella positions for the nPull coords double* z; //!< z=(-Fi/kT) for the nPull coords. These values are iteratively computed during wham - int* N; //!< nr of data points in nPull histograms. - int* Ntot; //!< also nr of data points. N and Ntot only differ if bHistEq==TRUE + int* N; //!< nr of data points in nPull histograms. + int* Ntot; //!< also nr of data points. N and Ntot only differ if bHistEq==TRUE /*! \brief g = 1 + 2*tau[int]/dt where tau is the integrated autocorrelation time. * @@ -229,10 +229,10 @@ typedef struct UmbrellaOptions // NOLINT(clang-analyzer-optin.performance.Paddin * \name Basic WHAM options */ /*!\{*/ - int bins; //!< nr of bins, min, max, and dz of profile - real min, max, dz; - real Temperature, Tolerance; //!< temperature, converged when probability changes less than Tolerance - gmx_bool bCycl; //!< generate cyclic (periodic) PMF + int bins; //!< nr of bins, min, max, and dz of profile + real min, max, dz; + real Temperature, Tolerance; //!< temperature, converged when probability changes less than Tolerance + gmx_bool bCycl; //!< generate cyclic (periodic) PMF /*!\}*/ /*! * \name Output control diff --git a/src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp b/src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp index 6f51cee171..d73bc7fb0e 100644 --- a/src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp +++ b/src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp @@ -217,7 +217,7 @@ static void nb_free_energy_kernel(const t_nblist& nlist, gmx::ArrayRef dvdl, gmx::ArrayRef energygrp_elec, gmx::ArrayRef energygrp_vdw, - t_nrnb* gmx_restrict nrnb) + t_nrnb* gmx_restrict nrnb) { #define STATE_A 0 #define STATE_B 1 @@ -370,7 +370,7 @@ static void nb_free_energy_kernel(const t_nblist& nlist, } // TODO: We should get rid of using pointers to real - const real* x = coords[0]; + const real* x = coords[0]; real* gmx_restrict f = &(forceWithShiftForces->force()[0][0]); real* gmx_restrict fshift = &(forceWithShiftForces->shiftForces()[0][0]); @@ -881,7 +881,7 @@ typedef void (*KernelFunction)(const t_nblist& nlist, gmx::ArrayRef dvdl, gmx::ArrayRef energygrp_elec, gmx::ArrayRef energygrp_vdw, - t_nrnb* gmx_restrict nrnb); + t_nrnb* gmx_restrict nrnb); template static KernelFunction dispatchKernelOnUseSimd(const bool useSimd) diff --git a/src/gromacs/gmxlib/nonbonded/nb_free_energy.h b/src/gromacs/gmxlib/nonbonded/nb_free_energy.h index 534b7527d6..3a04f196cb 100644 --- a/src/gromacs/gmxlib/nonbonded/nb_free_energy.h +++ b/src/gromacs/gmxlib/nonbonded/nb_free_energy.h @@ -71,6 +71,6 @@ void gmx_nb_free_energy_kernel(const t_nblist& nlist, gmx::ArrayRef dvdl, gmx::ArrayRef energygrp_elec, gmx::ArrayRef energygrp_vdw, - t_nrnb* gmx_restrict nrnb); + t_nrnb* gmx_restrict nrnb); #endif diff --git a/src/gromacs/gmxpreprocess/gen_vsite.cpp b/src/gromacs/gmxpreprocess/gen_vsite.cpp index 448b5de2fa..72caa6c88e 100644 --- a/src/gromacs/gmxpreprocess/gen_vsite.cpp +++ b/src/gromacs/gmxpreprocess/gen_vsite.cpp @@ -98,11 +98,7 @@ struct VirtualSiteConfiguration int nhyd, const std::string& nextheavy, const std::string& dummy) : - atomtype(type), - isplanar(planar), - nHydrogens(nhyd), - nextHeavyType(nextheavy), - dummyMass(dummy) + atomtype(type), isplanar(planar), nHydrogens(nhyd), nextHeavyType(nextheavy), dummyMass(dummy) { } //! Type for the XH3/XH2 atom. @@ -152,9 +148,7 @@ struct VirtualSiteTopology * \param[in] v Value for distance. */ VirtualSiteBond(const std::string& a1, const std::string& a2, real v) : - atom1(a1), - atom2(a2), - value(v) + atom1(a1), atom2(a2), value(v) { } //! Atom 1 in bond. @@ -178,10 +172,7 @@ struct VirtualSiteTopology * \param[in] v Value for angle. */ VirtualSiteAngle(const std::string& a1, const std::string& a2, const std::string& a3, real v) : - atom1(a1), - atom2(a2), - atom3(a3), - value(v) + atom1(a1), atom2(a2), atom3(a3), value(v) { } //! Atom 1 in angle. diff --git a/src/gromacs/gmxpreprocess/genhydro.cpp b/src/gromacs/gmxpreprocess/genhydro.cpp index b9c8680c2e..c1926e4c6c 100644 --- a/src/gromacs/gmxpreprocess/genhydro.cpp +++ b/src/gromacs/gmxpreprocess/genhydro.cpp @@ -337,9 +337,13 @@ static int check_atoms_present(const t_atoms* pdba, nadd--; break; } - case MoleculePatchType::Replace: { break; + case MoleculePatchType::Replace: + { + break; } - default: { GMX_THROW(gmx::InternalError("Case not handled")); + default: + { + GMX_THROW(gmx::InternalError("Case not handled")); } } } diff --git a/src/gromacs/gmxpreprocess/gpp_atomtype.cpp b/src/gromacs/gmxpreprocess/gpp_atomtype.cpp index 429de6bd30..8c2c60ab3d 100644 --- a/src/gromacs/gmxpreprocess/gpp_atomtype.cpp +++ b/src/gromacs/gmxpreprocess/gpp_atomtype.cpp @@ -61,11 +61,7 @@ struct AtomTypeData { //! Explicit constructor. AtomTypeData(const t_atom& a, char** name, const InteractionOfType& nb, const int bondAtomType, const int atomNumber) : - atom_(a), - name_(name), - nb_(nb), - bondAtomType_(bondAtomType), - atomNumber_(atomNumber) + atom_(a), name_(name), nb_(nb), bondAtomType_(bondAtomType), atomNumber_(atomNumber) { } //! Actual atom data. diff --git a/src/gromacs/gmxpreprocess/vsite_parm.cpp b/src/gromacs/gmxpreprocess/vsite_parm.cpp index 82051635a1..9e6eabffd0 100644 --- a/src/gromacs/gmxpreprocess/vsite_parm.cpp +++ b/src/gromacs/gmxpreprocess/vsite_parm.cpp @@ -111,8 +111,7 @@ struct VsiteBondParameter { //! Constructor initializes datastructure. VsiteBondParameter(int ftype, const InteractionOfType& vsiteInteraction) : - ftype_(ftype), - vsiteInteraction_(vsiteInteraction) + ftype_(ftype), vsiteInteraction_(vsiteInteraction) { } //! Function type for virtual site. @@ -424,11 +423,11 @@ static bool calc_vsite3_param(PreprocessingAtomTypes* atypes * i.e. if atom k and l are dummy masses (MNH* or MCH3*) */ bXH3 = ((gmx::equalCaseInsensitive(get_atomtype_name_AB(&at->atom[vsite->ak()], atypes), "MNH", 3)) && (gmx::equalCaseInsensitive( - get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MNH", 3))) + get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MNH", 3))) || ((gmx::equalCaseInsensitive( get_atomtype_name_AB(&at->atom[vsite->ak()], atypes), "MCH3", 4)) && (gmx::equalCaseInsensitive( - get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MCH3", 4))); + get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MCH3", 4))); bjk = get_bond_length(bonds, vsite->aj(), vsite->ak()); bjl = get_bond_length(bonds, vsite->aj(), vsite->al()); @@ -566,11 +565,11 @@ static bool calc_vsite3out_param(PreprocessingAtomTypes* aty * i.e. if atom k and l are dummy masses (MNH* or MCH3*) */ bXH3 = ((gmx::equalCaseInsensitive(get_atomtype_name_AB(&at->atom[vsite->ak()], atypes), "MNH", 3)) && (gmx::equalCaseInsensitive( - get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MNH", 3))) + get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MNH", 3))) || ((gmx::equalCaseInsensitive( get_atomtype_name_AB(&at->atom[vsite->ak()], atypes), "MCH3", 4)) && (gmx::equalCaseInsensitive( - get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MCH3", 4))); + get_atomtype_name_AB(&at->atom[vsite->al()], atypes), "MCH3", 4))); /* check if construction parity must be swapped */ bSwapParity = (vsite->c1() == -1); @@ -953,8 +952,7 @@ class VsiteAtomMapping public: //! Only construct with all information in place or nothing VsiteAtomMapping(int functionType, int interactionIndex) : - functionType_(functionType), - interactionIndex_(interactionIndex) + functionType_(functionType), interactionIndex_(interactionIndex) { } VsiteAtomMapping() : functionType_(-1), interactionIndex_(-1) {} diff --git a/src/gromacs/gmxpreprocess/x2top.cpp b/src/gromacs/gmxpreprocess/x2top.cpp index 876afdef94..de2544bd6a 100644 --- a/src/gromacs/gmxpreprocess/x2top.cpp +++ b/src/gromacs/gmxpreprocess/x2top.cpp @@ -282,7 +282,8 @@ static void calc_angles_dihs(InteractionsOfType* ang, InteractionsOfType* dih, c int al = dihedral.al(); real ph = gmx::c_rad2Deg - * dih_angle(x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : nullptr, r_ij, r_kj, r_kl, m, n, &t1, &t2, &t3); + * dih_angle( + x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : nullptr, r_ij, r_kj, r_kl, m, n, &t1, &t2, &t3); dihedral.setForceParameter(0, ph); } } diff --git a/src/gromacs/gpu_utils/device_context_sycl.cpp b/src/gromacs/gpu_utils/device_context_sycl.cpp index 7b4f88f31d..a3434d3039 100644 --- a/src/gromacs/gpu_utils/device_context_sycl.cpp +++ b/src/gromacs/gpu_utils/device_context_sycl.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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. @@ -50,8 +50,7 @@ //! Constructor DeviceContext::DeviceContext(const DeviceInformation& deviceInfo) : - deviceInfo_(deviceInfo), - context_(cl::sycl::context(deviceInfo.syclDevice)) + deviceInfo_(deviceInfo), context_(cl::sycl::context(deviceInfo.syclDevice)) { } diff --git a/src/gromacs/gpu_utils/device_utils.clh b/src/gromacs/gpu_utils/device_utils.clh index dd95c9128f..30fe06e9bc 100644 --- a/src/gromacs/gpu_utils/device_utils.clh +++ b/src/gromacs/gpu_utils/device_utils.clh @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2012,2018,2019,2021, 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,8 @@ */ gmx_opencl_inline void atomicAdd_l_f(volatile __local float* addr, float val) { - union { + union + { unsigned int u32; float f32; } next, expected, current; @@ -96,7 +97,8 @@ gmx_opencl_inline void atomicAdd_l_f3(__local float3* addr, float3 val) */ gmx_opencl_inline void atomicAdd_g_f(volatile __global float* addr, float val) { - union { + union + { unsigned int u32; float f32; } next, expected, current; diff --git a/src/gromacs/gpu_utils/gpuregiontimer_ocl.h b/src/gromacs/gpu_utils/gpuregiontimer_ocl.h index 8adaf08eef..32505f783d 100644 --- a/src/gromacs/gpu_utils/gpuregiontimer_ocl.h +++ b/src/gromacs/gpu_utils/gpuregiontimer_ocl.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2020,2021, 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. @@ -94,7 +94,7 @@ public: { if (events_[i]) // This conditional is ugly, but is required to make some tests (e.g. empty domain) pass { - cl_ulong start_ns, end_ns; + cl_ulong start_ns, end_ns; cl_int gmx_unused cl_error; cl_error = clGetEventProfilingInfo( diff --git a/src/gromacs/hardware/cpuinfo.cpp b/src/gromacs/hardware/cpuinfo.cpp index 82c50f0e19..7ea989e74d 100644 --- a/src/gromacs/hardware/cpuinfo.cpp +++ b/src/gromacs/hardware/cpuinfo.cpp @@ -548,10 +548,11 @@ void renumberIndex(std::vector* v) for (std::size_t i = 0; i < uniqueSortedV.size(); i++) { unsigned int val = uniqueSortedV[i]; - std::replace_if(v->begin(), - v->end(), - [val](unsigned int& c) -> bool { return c == val; }, - static_cast(i)); + std::replace_if( + v->begin(), + v->end(), + [val](unsigned int& c) -> bool { return c == val; }, + static_cast(i)); } } @@ -1089,11 +1090,7 @@ CpuInfo CpuInfo::detect() } CpuInfo::CpuInfo() : - vendor_(CpuInfo::Vendor::Unknown), - brandString_("Unknown CPU brand"), - family_(0), - model_(0), - stepping_(0) + vendor_(CpuInfo::Vendor::Unknown), brandString_("Unknown CPU brand"), family_(0), model_(0), stepping_(0) { } diff --git a/src/gromacs/hardware/detecthardware.cpp b/src/gromacs/hardware/detecthardware.cpp index 2325c71bd1..e13a58b5b8 100644 --- a/src/gromacs/hardware/detecthardware.cpp +++ b/src/gromacs/hardware/detecthardware.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2012,2013,2014,2015,2016, The GROMACS development team. - * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019,2020,2021, 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. @@ -71,8 +71,7 @@ gmx_hw_info_t::gmx_hw_info_t(std::unique_ptr cpuInfo, std::unique_ptr hardwareTopology) : - cpuInfo(std::move(cpuInfo)), - hardwareTopology(std::move(hardwareTopology)) + cpuInfo(std::move(cpuInfo)), hardwareTopology(std::move(hardwareTopology)) { } diff --git a/src/gromacs/hardware/device_management_sycl.cpp b/src/gromacs/hardware/device_management_sycl.cpp index 04d8ab543c..8923fe3e40 100644 --- a/src/gromacs/hardware/device_management_sycl.cpp +++ b/src/gromacs/hardware/device_management_sycl.cpp @@ -171,8 +171,7 @@ static bool isDeviceFunctional(const cl::sycl::device& syclDevice, std::string* cgh.parallel_for(range, [=](cl::sycl::id<1> threadId) { d_buffer[threadId] = threadId.get(0); }); - }) - .wait_and_throw(); + }).wait_and_throw(); const auto h_Buffer = buffer.get_access(); for (int i = 0; i < numThreads; i++) { diff --git a/src/gromacs/hardware/hardwaretopology.cpp b/src/gromacs/hardware/hardwaretopology.cpp index 25330ef663..7ab562e39c 100644 --- a/src/gromacs/hardware/hardwaretopology.cpp +++ b/src/gromacs/hardware/hardwaretopology.cpp @@ -737,16 +737,12 @@ HardwareTopology::Machine::Machine() HardwareTopology::HardwareTopology() : - supportLevel_(SupportLevel::None), - machine_(), - isThisSystem_(true) + supportLevel_(SupportLevel::None), machine_(), isThisSystem_(true) { } HardwareTopology::HardwareTopology(int logicalProcessorCount) : - supportLevel_(SupportLevel::None), - machine_(), - isThisSystem_(true) + supportLevel_(SupportLevel::None), machine_(), isThisSystem_(true) { if (logicalProcessorCount > 0) { diff --git a/src/gromacs/hardware/hardwaretopology.h b/src/gromacs/hardware/hardwaretopology.h index 065cb1d42b..8f8f22972d 100644 --- a/src/gromacs/hardware/hardwaretopology.h +++ b/src/gromacs/hardware/hardwaretopology.h @@ -126,8 +126,8 @@ public: /*! \libinternal \brief Information about a single numa node */ struct Numa { - std::vector nodes; //!< Information about each numa node - float baseLatency; //!< Scale factor for relative latencies + std::vector nodes; //!< Information about each numa node + float baseLatency; //!< Scale factor for relative latencies std::vector> relativeLatency; //!< 2D matrix of relative latencies between nodes float maxRelativeLatency; //!< Largest relative latency }; diff --git a/src/gromacs/listed_forces/bonded.cpp b/src/gromacs/listed_forces/bonded.cpp index 87c06ee74f..06a895acc4 100644 --- a/src/gromacs/listed_forces/bonded.cpp +++ b/src/gromacs/listed_forces/bonded.cpp @@ -820,7 +820,7 @@ real water_pol(int nbonds, rvec4 f[], rvec gmx_unused fshift[], const t_pbc gmx_unused* pbc, - real gmx_unused lambda, + real gmx_unused lambda, real gmx_unused* dvdlambda, gmx::ArrayRef charge, t_fcdata gmx_unused* fcd, @@ -2568,14 +2568,14 @@ real dihres(int nbonds, } -real unimplemented(int gmx_unused nbonds, - const t_iatom gmx_unused forceatoms[], +real unimplemented(int gmx_unused nbonds, + const t_iatom gmx_unused forceatoms[], const t_iparams gmx_unused forceparams[], - const rvec gmx_unused x[], - rvec4 gmx_unused f[], - rvec gmx_unused fshift[], + const rvec gmx_unused x[], + rvec4 gmx_unused f[], + rvec gmx_unused fshift[], const t_pbc gmx_unused* pbc, - real gmx_unused lambda, + real gmx_unused lambda, real gmx_unused* dvdlambda, gmx::ArrayRef /*charge*/, t_fcdata gmx_unused* fcd, @@ -3091,7 +3091,7 @@ real cmap_dihs(int nbonds, rvec4 f[], rvec fshift[], const struct t_pbc* pbc, - real gmx_unused lambda, + real gmx_unused lambda, real gmx_unused* dvdlambda, gmx::ArrayRef /*charge*/, t_fcdata gmx_unused* fcd, diff --git a/src/gromacs/listed_forces/bonded.h b/src/gromacs/listed_forces/bonded.h index 7a2b6282b9..63474319c8 100644 --- a/src/gromacs/listed_forces/bonded.h +++ b/src/gromacs/listed_forces/bonded.h @@ -126,7 +126,7 @@ real cmap_dihs(int nbonds, rvec4 f[], rvec fshift[], const struct t_pbc* pbc, - real gmx_unused lambda, + real gmx_unused lambda, real gmx_unused* dvdlambda, gmx::ArrayRef /*charge*/, t_fcdata gmx_unused* fcd, diff --git a/src/gromacs/listed_forces/disre.cpp b/src/gromacs/listed_forces/disre.cpp index e22a49ba95..34a2627bd0 100644 --- a/src/gromacs/listed_forces/disre.cpp +++ b/src/gromacs/listed_forces/disre.cpp @@ -419,7 +419,7 @@ real ta_disres(int nfa, rvec4* f, rvec* fshift, const t_pbc* pbc, - real gmx_unused lambda, + real gmx_unused lambda, real gmx_unused* dvdlambda, gmx::ArrayRef /*charge*/, t_fcdata gmx_unused* fcd, diff --git a/src/gromacs/listed_forces/gpubonded_impl.cu b/src/gromacs/listed_forces/gpubonded_impl.cu index c5fbd00e46..48bd3f8360 100644 --- a/src/gromacs/listed_forces/gpubonded_impl.cu +++ b/src/gromacs/listed_forces/gpubonded_impl.cu @@ -72,8 +72,7 @@ GpuBonded::Impl::Impl(const gmx_ffparams_t& ffparams, const DeviceContext& deviceContext, const DeviceStream& deviceStream, gmx_wallcycle* wcycle) : - deviceContext_(deviceContext), - deviceStream_(deviceStream) + deviceContext_(deviceContext), deviceStream_(deviceStream) { GMX_RELEASE_ASSERT(deviceStream.isValid(), "Can't run GPU version of bonded forces in stream that is not valid."); diff --git a/src/gromacs/listed_forces/gpubondedkernels.cu b/src/gromacs/listed_forces/gpubondedkernels.cu index 1537c58d58..8ab52bf5b4 100644 --- a/src/gromacs/listed_forces/gpubondedkernels.cu +++ b/src/gromacs/listed_forces/gpubondedkernels.cu @@ -79,7 +79,7 @@ /* Harmonic */ __device__ __forceinline__ static void - harmonic_gpu(const float kA, const float xA, const float x, float* V, float* F) +harmonic_gpu(const float kA, const float xA, const float x, float* V, float* F) { constexpr float half = 0.5f; float dx, dx2; @@ -369,7 +369,7 @@ __device__ __forceinline__ static float dih_angle_gpu(const T xi, __device__ __forceinline__ static void - dopdihs_gpu(const float cpA, const float phiA, const int mult, const float phi, float* v, float* f) +dopdihs_gpu(const float cpA, const float phiA, const int mult, const float phi, float* v, float* f) { float mdphi, sdphi; @@ -380,22 +380,22 @@ __device__ __forceinline__ static void } template -__device__ static void do_dih_fup_gpu(const int i, - const int j, - const int k, - const int l, - const float ddphi, - const float3 r_ij, - const float3 r_kj, - const float3 r_kl, - const float3 m, - const float3 n, - float3 gm_f[], - float3 sm_fShiftLoc[], - const PbcAiuc& pbcAiuc, - const float4 gm_xq[], - const int t1, - const int t2, +__device__ static void do_dih_fup_gpu(const int i, + const int j, + const int k, + const int l, + const float ddphi, + const float3 r_ij, + const float3 r_kj, + const float3 r_kl, + const float3 m, + const float3 n, + float3 gm_f[], + float3 sm_fShiftLoc[], + const PbcAiuc& pbcAiuc, + const float4 gm_xq[], + const int t1, + const int t2, const int gmx_unused t3) { float iprm = norm2(m); diff --git a/src/gromacs/listed_forces/tests/pairs.cpp b/src/gromacs/listed_forces/tests/pairs.cpp index 1a734aa51c..137ebfd440 100644 --- a/src/gromacs/listed_forces/tests/pairs.cpp +++ b/src/gromacs/listed_forces/tests/pairs.cpp @@ -101,8 +101,7 @@ constexpr int c_numAtoms = 3; struct OutputQuantities { OutputQuantities(int energyGroup) : - energy(energyGroup), - dvdLambda(static_cast(FreeEnergyPerturbationCouplingType::Count), 0.0) + energy(energyGroup), dvdLambda(static_cast(FreeEnergyPerturbationCouplingType::Count), 0.0) { } diff --git a/src/gromacs/math/arrayrefwithpadding.h b/src/gromacs/math/arrayrefwithpadding.h index b6489475c3..ee60701610 100644 --- a/src/gromacs/math/arrayrefwithpadding.h +++ b/src/gromacs/math/arrayrefwithpadding.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -99,25 +99,19 @@ public: * Passed pointers must remain valid for the lifetime of this object. */ ArrayRefWithPadding(pointer begin, pointer end, pointer paddedEnd) : - begin_(begin), - end_(end), - paddedEnd_(paddedEnd) + begin_(begin), end_(end), paddedEnd_(paddedEnd) { GMX_ASSERT(end >= begin, "Invalid range"); GMX_ASSERT(paddedEnd >= end, "Invalid range"); } //! Copy constructor ArrayRefWithPadding(const ArrayRefWithPadding& o) : - begin_(o.begin_), - end_(o.end_), - paddedEnd_(o.paddedEnd_) + begin_(o.begin_), end_(o.end_), paddedEnd_(o.paddedEnd_) { } //! Move constructor ArrayRefWithPadding(ArrayRefWithPadding&& o) noexcept : - begin_(std::move(o.begin_)), - end_(std::move(o.end_)), - paddedEnd_(std::move(o.paddedEnd_)) + begin_(std::move(o.begin_)), end_(std::move(o.end_)), paddedEnd_(std::move(o.paddedEnd_)) { } /*! \brief Convenience overload constructor to make an ArrayRefWithPadding from a non-const one. diff --git a/src/gromacs/math/coordinatetransformation.cpp b/src/gromacs/math/coordinatetransformation.cpp index 6555d96e2d..9001f1c93e 100644 --- a/src/gromacs/math/coordinatetransformation.cpp +++ b/src/gromacs/math/coordinatetransformation.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -147,8 +147,7 @@ public: }; TranslateAndScale::Impl::Impl(const RVec& scale, const RVec& translation) : - scale_{ scale }, - translation_{ translation } + scale_{ scale }, translation_{ translation } { } diff --git a/src/gromacs/math/densityfit.cpp b/src/gromacs/math/densityfit.cpp index 6cfcc15305..1b8dc3bf99 100644 --- a/src/gromacs/math/densityfit.cpp +++ b/src/gromacs/math/densityfit.cpp @@ -98,8 +98,7 @@ private: }; DensitySimilarityInnerProduct::DensitySimilarityInnerProduct(density referenceDensity) : - referenceDensity_{ referenceDensity }, - gradient_{ referenceDensity.extents() } + referenceDensity_{ referenceDensity }, gradient_{ referenceDensity.extents() } { const auto numVoxels = gradient_.asConstView().mapping().required_span_size(); /* the gradient for the inner product measure of fit is constant and does not @@ -184,8 +183,7 @@ private: }; DensitySimilarityRelativeEntropy::DensitySimilarityRelativeEntropy(density referenceDensity) : - referenceDensity_{ referenceDensity }, - gradient_(referenceDensity.extents()) + referenceDensity_{ referenceDensity }, gradient_(referenceDensity.extents()) { } @@ -330,8 +328,7 @@ private: }; DensitySimilarityCrossCorrelation::DensitySimilarityCrossCorrelation(density referenceDensity) : - referenceDensity_{ referenceDensity }, - gradient_(referenceDensity.extents()) + referenceDensity_{ referenceDensity }, gradient_(referenceDensity.extents()) { } diff --git a/src/gromacs/math/gausstransform.cpp b/src/gromacs/math/gausstransform.cpp index a539062ac7..8f52f282bc 100644 --- a/src/gromacs/math/gausstransform.cpp +++ b/src/gromacs/math/gausstransform.cpp @@ -250,8 +250,8 @@ IVec rangeEndWithinLattice(const IVec& index, const dynamicExtents3D& extents, c * OuterProductEvaluator */ -mdspan OuterProductEvaluator:: - operator()(ArrayRef x, ArrayRef y) +mdspan +OuterProductEvaluator::operator()(ArrayRef x, ArrayRef y) { data_.resize(ssize(x), ssize(y)); for (gmx::index xIndex = 0; xIndex < ssize(x); ++xIndex) diff --git a/src/gromacs/math/multidimarray.h b/src/gromacs/math/multidimarray.h index 8f6047cc40..867ac725f2 100644 --- a/src/gromacs/math/multidimarray.h +++ b/src/gromacs/math/multidimarray.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -159,14 +159,12 @@ public: } //! Copy constructor constexpr MultiDimArray(const MultiDimArray& o) : - data_(o.data_), - view_(data_.data(), o.view_.extents()) + data_(o.data_), view_(data_.data(), o.view_.extents()) { } //! Move constructor MultiDimArray(MultiDimArray&& o) noexcept : - data_(std::move(o.data_)), - view_(data_.data(), o.view_.extents()) + data_(std::move(o.data_)), view_(data_.data(), o.view_.extents()) { } //! Copy assignment diff --git a/src/gromacs/math/paddedvector.h b/src/gromacs/math/paddedvector.h index 033af87c52..3664c735e1 100644 --- a/src/gromacs/math/paddedvector.h +++ b/src/gromacs/math/paddedvector.h @@ -231,8 +231,7 @@ public: PaddedVector() : storage_(), unpaddedEnd_(begin()) {} /*! \brief Constructor that specifies the initial size. */ explicit PaddedVector(size_type count, const allocator_type& allocator = Allocator()) : - storage_(count, allocator), - unpaddedEnd_(begin() + count) + storage_(count, allocator), unpaddedEnd_(begin() + count) { // The count elements have been default inserted, and now // the padding elements are added @@ -240,8 +239,7 @@ public: } /*! \brief Constructor that specifies the initial size and an element to copy. */ explicit PaddedVector(size_type count, value_type const& v, const allocator_type& allocator = Allocator()) : - storage_(count, v, allocator), - unpaddedEnd_(begin() + count) + storage_(count, v, allocator), unpaddedEnd_(begin() + count) { // The count elements have been default inserted, and now // the padding elements are added @@ -249,8 +247,7 @@ public: } //! Default constructor with allocator explicit PaddedVector(allocator_type const& allocator) : - storage_(allocator), - unpaddedEnd_(begin()) + storage_(allocator), unpaddedEnd_(begin()) { } //! Copy constructor @@ -260,8 +257,7 @@ public: * Leaves \c o in a valid state (ie the destructor can be * called). */ PaddedVector(PaddedVector&& o) noexcept : - storage_(std::exchange(o.storage_, {})), - unpaddedEnd_(o.unpaddedEnd_) + storage_(std::exchange(o.storage_, {})), unpaddedEnd_(o.unpaddedEnd_) { } /*! \brief Move constructor using \c alloc for the new vector. @@ -274,8 +270,7 @@ public: * Leaves \c o in a valid state (ie. the destructor can be * called). */ PaddedVector(PaddedVector&& o, const Allocator& alloc) noexcept : - storage_(alloc), - unpaddedEnd_(begin()) + storage_(alloc), unpaddedEnd_(begin()) { if (alloc == o.storage_.get_allocator()) { @@ -294,8 +289,7 @@ public: } //! Construct from an initializer list PaddedVector(std::initializer_list const& il) : - storage_(il), - unpaddedEnd_(storage_.end()) + storage_(il), unpaddedEnd_(storage_.end()) { // We can't choose the padding until we know the size of // the normal vector, so we have to make the storage_ and diff --git a/src/gromacs/math/tests/neldermead.cpp b/src/gromacs/math/tests/neldermead.cpp index 3a142ac98a..5c82d9d26f 100644 --- a/src/gromacs/math/tests/neldermead.cpp +++ b/src/gromacs/math/tests/neldermead.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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. @@ -66,8 +66,7 @@ class NelderMeadSimplexTest : public ::testing::Test public: //! Set up a one-d, two-vertices Nelder-Mead simplex NelderMeadSimplexTest() : - initialGuess_{ 1 }, - simplex_{ NelderMeadSimplexTest::doubleFirstCoordinateValue, initialGuess_ } + initialGuess_{ 1 }, simplex_{ NelderMeadSimplexTest::doubleFirstCoordinateValue, initialGuess_ } { } diff --git a/src/gromacs/mdlib/boxdeformation.cpp b/src/gromacs/mdlib/boxdeformation.cpp index e42a95fe46..afc22d4565 100644 --- a/src/gromacs/mdlib/boxdeformation.cpp +++ b/src/gromacs/mdlib/boxdeformation.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -101,8 +101,7 @@ BoxDeformation::BoxDeformation(double timeStep, int64_t initialStep, const tensor& deformationTensor, const matrix& referenceBox) : - timeStep_(timeStep), - initialStep_(initialStep) + timeStep_(timeStep), initialStep_(initialStep) { copy_mat(deformationTensor, deformationTensor_); copy_mat(referenceBox, referenceBox_); diff --git a/src/gromacs/mdlib/calc_verletbuf.cpp b/src/gromacs/mdlib/calc_verletbuf.cpp index f29ff7303b..4ef9cd3d6b 100644 --- a/src/gromacs/mdlib/calc_verletbuf.cpp +++ b/src/gromacs/mdlib/calc_verletbuf.cpp @@ -1311,7 +1311,7 @@ static real chanceOfUpdateGroupCrossingCell(const gmx_mtop_t& mtop, const gmx_moltype_t& moltype = mtop.moltype[molblock.type]; chance += molblock.nmol * chanceOfUpdateGroupCrossingCell( - moltype, mtop.ffparams, updateGrouping[molblock.type], kT_fac, cellSize); + moltype, mtop.ffparams, updateGrouping[molblock.type], kT_fac, cellSize); } return chance; diff --git a/src/gromacs/mdlib/coupling.cpp b/src/gromacs/mdlib/coupling.cpp index e6c3613f49..c9a288d8a4 100644 --- a/src/gromacs/mdlib/coupling.cpp +++ b/src/gromacs/mdlib/coupling.cpp @@ -881,8 +881,8 @@ void calculateScalingMatrixImplDetail(const t_input real dt, const matrix pres, const matrix box, - real scalar_pressure, - real xy_pressure, + real scalar_pressure, + real xy_pressure, int64_t gmx_unused step) { real p_corr_z = 0; diff --git a/src/gromacs/mdlib/energyoutput.cpp b/src/gromacs/mdlib/energyoutput.cpp index 631e7b1dad..cc19e024df 100644 --- a/src/gromacs/mdlib/energyoutput.cpp +++ b/src/gromacs/mdlib/energyoutput.cpp @@ -1195,12 +1195,12 @@ void EnergyOutput::printStepToEnergyFile(ener_file* fp_ene, { t_oriresdata& orires = *fcd->orires; diagonalize_orires_tensors(&orires); - nr[enxOR] = orires.numRestraints; - block[enxOR] = orires.orientationsTimeAndEnsembleAv.data(); - id[enxOR] = enxOR; - nr[enxORI] = (orires.orientations.data() != orires.orientationsTimeAndEnsembleAv.data()) - ? orires.numRestraints - : 0; + nr[enxOR] = orires.numRestraints; + block[enxOR] = orires.orientationsTimeAndEnsembleAv.data(); + id[enxOR] = enxOR; + nr[enxORI] = (orires.orientations.data() != orires.orientationsTimeAndEnsembleAv.data()) + ? orires.numRestraints + : 0; block[enxORI] = orires.orientations.data(); id[enxORI] = enxORI; nr[enxORT] = ssize(orires.eigenOutput); diff --git a/src/gromacs/mdlib/expanded.cpp b/src/gromacs/mdlib/expanded.cpp index 025cdac657..51807ab3bc 100644 --- a/src/gromacs/mdlib/expanded.cpp +++ b/src/gromacs/mdlib/expanded.cpp @@ -1479,7 +1479,7 @@ int ExpandedEnsembleDynamics(FILE* log, { told = ir->opts.ref_t[i]; ir->opts.ref_t[i] = simtemp->temperatures[lamnew]; - buf_ngtc[i] = std::sqrt(ir->opts.ref_t[i] / told); /* using the buffer as temperature scaling */ + buf_ngtc[i] = std::sqrt(ir->opts.ref_t[i] / told); /* using the buffer as temperature scaling */ } } diff --git a/src/gromacs/mdlib/gmx_omp_nthreads.cpp b/src/gromacs/mdlib/gmx_omp_nthreads.cpp index 6d94b641cf..91c72b198a 100644 --- a/src/gromacs/mdlib/gmx_omp_nthreads.cpp +++ b/src/gromacs/mdlib/gmx_omp_nthreads.cpp @@ -240,9 +240,9 @@ static void manage_number_of_openmp_threads(const gmx::MDLogger& mdlog, int nthreads_hw_avail, int omp_nthreads_req, int omp_nthreads_pme_req, - gmx_bool gmx_unused bThisNodePMEOnly, - int numRanksOnThisNode, - gmx_bool bSepPME) + gmx_bool gmx_unused bThisNodePMEOnly, + int numRanksOnThisNode, + gmx_bool bSepPME) { int nth; char* env; diff --git a/src/gromacs/mdlib/groupcoord.cpp b/src/gromacs/mdlib/groupcoord.cpp index 34a7ca9156..ac84c96273 100644 --- a/src/gromacs/mdlib/groupcoord.cpp +++ b/src/gromacs/mdlib/groupcoord.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2008, The GROMACS development team. * Copyright (c) 2012,2014,2015,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -59,7 +59,7 @@ void dd_make_local_group_indices(const gmx_ga2la_t* ga2la, int* nr_loc, /* OUT: Number of group atoms found locally */ int* anrs_loc[], /* OUT: Local atom numbers of the group */ int* nalloc_loc, /* IN+OUT: Allocation size of anrs_loc */ - int coll_ind[]) /* OUT (opt): Where is this position found in the collective array? */ + int coll_ind[]) /* OUT (opt): Where is this position found in the collective array? */ { GMX_ASSERT(ga2la, "We need a valid ga2la object"); diff --git a/src/gromacs/mdlib/leapfrog_gpu.cu b/src/gromacs/mdlib/leapfrog_gpu.cu index 7028e256b8..0ce1174b33 100644 --- a/src/gromacs/mdlib/leapfrog_gpu.cu +++ b/src/gromacs/mdlib/leapfrog_gpu.cu @@ -313,9 +313,7 @@ void LeapFrogGpu::integrate(DeviceBuffer d_x, LeapFrogGpu::LeapFrogGpu(const DeviceContext& deviceContext, const DeviceStream& deviceStream, const int numTempScaleValues) : - deviceContext_(deviceContext), - deviceStream_(deviceStream), - numTempScaleValues_(numTempScaleValues) + deviceContext_(deviceContext), deviceStream_(deviceStream), numTempScaleValues_(numTempScaleValues) { numAtoms_ = 0; diff --git a/src/gromacs/mdlib/lincs.cpp b/src/gromacs/mdlib/lincs.cpp index 093ff1bec1..81a0d1173c 100644 --- a/src/gromacs/mdlib/lincs.cpp +++ b/src/gromacs/mdlib/lincs.cpp @@ -502,13 +502,13 @@ static inline void gmx_simdcall gatherLoadUTransposeTSANSafe(const real* static void gmx_simdcall calc_dr_x_f_simd(int b0, int b1, gmx::ArrayRef atoms, - const rvec* gmx_restrict x, - const rvec* gmx_restrict f, - const real* gmx_restrict blc, - const real* pbc_simd, - rvec* gmx_restrict r, - real* gmx_restrict rhs, - real* gmx_restrict sol) + const rvec* gmx_restrict x, + const rvec* gmx_restrict f, + const real* gmx_restrict blc, + const real* pbc_simd, + rvec* gmx_restrict r, + real* gmx_restrict rhs, + real* gmx_restrict sol) { assert(b0 % GMX_SIMD_REAL_WIDTH == 0); @@ -757,14 +757,14 @@ static void do_lincsp(ArrayRefWithPadding xPadded, static void gmx_simdcall calc_dr_x_xp_simd(int b0, int b1, gmx::ArrayRef atoms, - const rvec* gmx_restrict x, - const rvec* gmx_restrict xp, - const real* gmx_restrict bllen, - const real* gmx_restrict blc, - const real* pbc_simd, - rvec* gmx_restrict r, - real* gmx_restrict rhs, - real* gmx_restrict sol) + const rvec* gmx_restrict x, + const rvec* gmx_restrict xp, + const real* gmx_restrict bllen, + const real* gmx_restrict blc, + const real* pbc_simd, + rvec* gmx_restrict r, + real* gmx_restrict rhs, + real* gmx_restrict sol) { assert(b0 % GMX_SIMD_REAL_WIDTH == 0); alignas(GMX_SIMD_ALIGNMENT) std::int32_t offset2[GMX_SIMD_REAL_WIDTH]; @@ -829,14 +829,14 @@ static void gmx_simdcall calc_dr_x_xp_simd(int b0, gmx_unused static void calc_dist_iter(int b0, int b1, gmx::ArrayRef atoms, - const rvec* gmx_restrict xp, - const real* gmx_restrict bllen, - const real* gmx_restrict blc, - const t_pbc* pbc, - real wfac, - real* gmx_restrict rhs, - real* gmx_restrict sol, - bool* bWarn) + const rvec* gmx_restrict xp, + const real* gmx_restrict bllen, + const real* gmx_restrict blc, + const t_pbc* pbc, + real wfac, + real* gmx_restrict rhs, + real* gmx_restrict sol, + bool* bWarn) { for (int b = b0; b < b1; b++) { @@ -876,14 +876,14 @@ gmx_unused static void calc_dist_iter(int b0, static void gmx_simdcall calc_dist_iter_simd(int b0, int b1, gmx::ArrayRef atoms, - const rvec* gmx_restrict x, - const real* gmx_restrict bllen, - const real* gmx_restrict blc, - const real* pbc_simd, - real wfac, - real* gmx_restrict rhs, - real* gmx_restrict sol, - bool* bWarn) + const rvec* gmx_restrict x, + const real* gmx_restrict bllen, + const real* gmx_restrict blc, + const real* pbc_simd, + real wfac, + real* gmx_restrict rhs, + real* gmx_restrict sol, + bool* bWarn) { SimdReal min_S(GMX_REAL_MIN); SimdReal two_S(2.0); @@ -968,9 +968,9 @@ static void do_lincs(ArrayRefWithPadding xPadded, bool bCalcVir, tensor vir_r_m_dr) { - const rvec* x = as_rvec_array(xPadded.paddedArrayRef().data()); - rvec* xp = as_rvec_array(xpPadded.paddedArrayRef().data()); - rvec* gmx_restrict v = as_rvec_array(vRef.data()); + const rvec* x = as_rvec_array(xPadded.paddedArrayRef().data()); + rvec* xp = as_rvec_array(xpPadded.paddedArrayRef().data()); + rvec* gmx_restrict v = as_rvec_array(vRef.data()); const int b0 = lincsd->task[th].b0; const int b1 = lincsd->task[th].b1; diff --git a/src/gromacs/mdlib/lincs_gpu.cpp b/src/gromacs/mdlib/lincs_gpu.cpp index 96c0b8fc32..761f38a120 100644 --- a/src/gromacs/mdlib/lincs_gpu.cpp +++ b/src/gromacs/mdlib/lincs_gpu.cpp @@ -128,8 +128,7 @@ LincsGpu::LincsGpu(int numIterations, int expansionOrder, const DeviceContext& deviceContext, const DeviceStream& deviceStream) : - deviceContext_(deviceContext), - deviceStream_(deviceStream) + deviceContext_(deviceContext), deviceStream_(deviceStream) { GMX_RELEASE_ASSERT(GMX_GPU_CUDA, "LINCS GPU is only implemented in CUDA."); kernelParams_.numIterations = numIterations; diff --git a/src/gromacs/mdlib/mdatoms.cpp b/src/gromacs/mdlib/mdatoms.cpp index 82ecd24b4b..3749019a9d 100644 --- a/src/gromacs/mdlib/mdatoms.cpp +++ b/src/gromacs/mdlib/mdatoms.cpp @@ -217,7 +217,7 @@ void atoms2md(const gmx_mtop_t& mtop, { gmx_bool bLJPME; const t_grpopts* opts; - int nthreads gmx_unused; + int nthreads gmx_unused; bLJPME = EVDW_PME(inputrec.vdwtype); diff --git a/src/gromacs/mdlib/resethandler.cpp b/src/gromacs/mdlib/resethandler.cpp index a471a6c828..be4d76eea5 100644 --- a/src/gromacs/mdlib/resethandler.cpp +++ b/src/gromacs/mdlib/resethandler.cpp @@ -82,10 +82,7 @@ ResetHandler::ResetHandler(compat::not_null signal, const MDLogger& mdlog, gmx_wallcycle* wcycle, gmx_walltime_accounting_t walltime_accounting) : - signal_(*signal), - rankCanSetSignal_(false), - simulationNeedsReset_(false), - maximumHoursToRun_(maximumHoursToRun) + signal_(*signal), rankCanSetSignal_(false), simulationNeedsReset_(false), maximumHoursToRun_(maximumHoursToRun) { if (simulationsShareState) { diff --git a/src/gromacs/mdlib/settle.cpp b/src/gromacs/mdlib/settle.cpp index 24d0d58fb5..5a77a323e6 100644 --- a/src/gromacs/mdlib/settle.cpp +++ b/src/gromacs/mdlib/settle.cpp @@ -368,13 +368,13 @@ void settle_proj(const SettleData& settled, /*! \brief The actual settle code, templated for real/SimdReal and for optimization */ template -static void settleTemplate(const SettleData& settled, - int settleStart, - int settleEnd, - const TypePbc pbc, - const real* x, - real* xprime, - real invdt, +static void settleTemplate(const SettleData& settled, + int settleStart, + int settleEnd, + const TypePbc pbc, + const real* x, + real* xprime, + real invdt, real* gmx_restrict v, tensor vir_r_m_dr, bool* bErrorHasOccurred) diff --git a/src/gromacs/mdlib/settle_gpu.cpp b/src/gromacs/mdlib/settle_gpu.cpp index 0c19d7ad99..659947ac35 100644 --- a/src/gromacs/mdlib/settle_gpu.cpp +++ b/src/gromacs/mdlib/settle_gpu.cpp @@ -123,8 +123,7 @@ void SettleGpu::apply(const DeviceBuffer d_x, } SettleGpu::SettleGpu(const gmx_mtop_t& mtop, const DeviceContext& deviceContext, const DeviceStream& deviceStream) : - deviceContext_(deviceContext), - deviceStream_(deviceStream) + deviceContext_(deviceContext), deviceStream_(deviceStream) { static_assert(sizeof(real) == sizeof(float), "Real numbers should be in single precision in GPU code."); diff --git a/src/gromacs/mdlib/simulationsignal.cpp b/src/gromacs/mdlib/simulationsignal.cpp index 8199dcb450..db0aec861c 100644 --- a/src/gromacs/mdlib/simulationsignal.cpp +++ b/src/gromacs/mdlib/simulationsignal.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -72,12 +72,7 @@ SimulationSignaller::SimulationSignaller(SimulationSignals* signals, const gmx_multisim_t* ms, bool doInterSim, bool doIntraSim) : - signals_(signals), - cr_(cr), - ms_(ms), - doInterSim_(doInterSim), - doIntraSim_(doInterSim || doIntraSim), - mpiBuffer_{} + signals_(signals), cr_(cr), ms_(ms), doInterSim_(doInterSim), doIntraSim_(doInterSim || doIntraSim), mpiBuffer_{} { } diff --git a/src/gromacs/mdlib/tests/leapfrogtestrunners.cpp b/src/gromacs/mdlib/tests/leapfrogtestrunners.cpp index a82d9fc9e7..a48c90ff74 100644 --- a/src/gromacs/mdlib/tests/leapfrogtestrunners.cpp +++ b/src/gromacs/mdlib/tests/leapfrogtestrunners.cpp @@ -82,8 +82,8 @@ void LeapFrogHostTestRunner::integrate(LeapFrogTestData* testData, int numSteps) testData->mdAtoms_.invmass ? gmx::arrayRefFromArray(testData->mdAtoms_.invmass, testData->mdAtoms_.nr) : gmx::ArrayRef{}, - testData->mdAtoms_.invMassPerDim ? gmx::arrayRefFromArray(testData->mdAtoms_.invMassPerDim, - testData->mdAtoms_.nr) + testData->mdAtoms_.invMassPerDim ? gmx::arrayRefFromArray( + testData->mdAtoms_.invMassPerDim, testData->mdAtoms_.nr) : gmx::ArrayRef{}, &testData->state_, testData->f_, diff --git a/src/gromacs/mdlib/update.cpp b/src/gromacs/mdlib/update.cpp index c75ff3c614..60c3b03535 100644 --- a/src/gromacs/mdlib/update.cpp +++ b/src/gromacs/mdlib/update.cpp @@ -348,10 +348,10 @@ updateMDLeapfrogSimple(int start, gmx::ArrayRef tcstat, gmx::ArrayRef cTC, const rvec pRVScaleMatrixDiagonal, - const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, - VelocityType* gmx_restrict v, - const rvec* gmx_restrict f) + const rvec* gmx_restrict x, + rvec* gmx_restrict xprime, + VelocityType* gmx_restrict v, + const rvec* gmx_restrict f) { real lambdaGroup; @@ -467,10 +467,10 @@ updateMDLeapfrogSimpleSimd(int start, real dt, gmx::ArrayRef invMass, gmx::ArrayRef tcstat, - const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, - VelocityType* gmx_restrict v, - const rvec* gmx_restrict f) + const rvec* gmx_restrict x, + rvec* gmx_restrict xprime, + VelocityType* gmx_restrict v, + const rvec* gmx_restrict f) { SimdReal timestep(dt); SimdReal lambdaSystem(tcstat[0].lambda); @@ -551,13 +551,13 @@ static void updateMDLeapfrogGeneral(int start, gmx::ArrayRef invMassPerDim, const gmx_ekindata_t* ekind, const matrix box, - const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, - rvec* gmx_restrict v, - const rvec* gmx_restrict f, - const double* gmx_restrict nh_vxi, - const int nsttcouple, - const matrix M) + const rvec* gmx_restrict x, + rvec* gmx_restrict xprime, + rvec* gmx_restrict v, + const rvec* gmx_restrict f, + const double* gmx_restrict nh_vxi, + const int nsttcouple, + const matrix M) { /* This is a version of the leap-frog integrator that supports * all combinations of T-coupling, P-coupling and NEMD. @@ -628,26 +628,26 @@ static void updateMDLeapfrogGeneral(int start, } /*! \brief Handles the Leap-frog MD x and v integration */ -static void do_update_md(int start, - int nrend, - real dt, - int64_t step, - const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, - rvec* gmx_restrict v, - const rvec* gmx_restrict f, - const TemperatureCoupling etc, - const PressureCoupling epc, - const int nsttcouple, - const int nstpcouple, - gmx::ArrayRef cTC, +static void do_update_md(int start, + int nrend, + real dt, + int64_t step, + const rvec* gmx_restrict x, + rvec* gmx_restrict xprime, + rvec* gmx_restrict v, + const rvec* gmx_restrict f, + const TemperatureCoupling etc, + const PressureCoupling epc, + const int nsttcouple, + const int nstpcouple, + gmx::ArrayRef cTC, gmx::ArrayRef gmx_unused invmass, gmx::ArrayRef invMassPerDim, const gmx_ekindata_t* ekind, const matrix box, - const double* gmx_restrict nh_vxi, - const matrix M, - bool gmx_unused havePartiallyFrozenAtoms) + const double* gmx_restrict nh_vxi, + const matrix M, + bool gmx_unused havePartiallyFrozenAtoms) { GMX_ASSERT(nrend == start || xprime != x, "For SIMD optimization certain compilers need to have xprime != x"); @@ -784,14 +784,14 @@ static void do_update_md(int start, } } /*! \brief Handles the Leap-frog MD x and v integration */ -static void doUpdateMDDoNotUpdateVelocities(int start, - int nrend, - real dt, +static void doUpdateMDDoNotUpdateVelocities(int start, + int nrend, + real dt, const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, + rvec* gmx_restrict xprime, const rvec* gmx_restrict v, const rvec* gmx_restrict f, - bool gmx_unused havePartiallyFrozenAtoms, + bool gmx_unused havePartiallyFrozenAtoms, gmx::ArrayRef gmx_unused invmass, gmx::ArrayRef invMassPerDim, const gmx_ekindata_t& ekind) @@ -1001,8 +1001,7 @@ void Update::Impl::update_temperature_constants(const t_inputrec& inputRecord) } Update::Impl::Impl(const t_inputrec& inputRecord, BoxDeformation* boxDeformation) : - sd_(inputRecord), - deform_(boxDeformation) + sd_(inputRecord), deform_(boxDeformation) { update_temperature_constants(inputRecord); xp_.resizeWithPadding(0); @@ -1137,13 +1136,13 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, } } -static void do_update_sd(int start, - int nrend, - real dt, - int64_t step, - const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, - rvec* gmx_restrict v, +static void do_update_sd(int start, + int nrend, + real dt, + int64_t step, + const rvec* gmx_restrict x, + rvec* gmx_restrict xprime, + rvec* gmx_restrict v, const rvec* gmx_restrict f, gmx::ArrayRef nFreeze, gmx::ArrayRef invmass, @@ -1196,13 +1195,13 @@ static void do_update_sd(int start, } } -static void do_update_bd(int start, - int nrend, - real dt, - int64_t step, - const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, - rvec* gmx_restrict v, +static void do_update_bd(int start, + int nrend, + real dt, + int64_t step, + const rvec* gmx_restrict x, + rvec* gmx_restrict xprime, + rvec* gmx_restrict v, const rvec* gmx_restrict f, gmx::ArrayRef nFreeze, gmx::ArrayRef invmass, diff --git a/src/gromacs/mdlib/update_constrain_gpu_impl.h b/src/gromacs/mdlib/update_constrain_gpu_impl.h index bad3898602..9b260d1a99 100644 --- a/src/gromacs/mdlib/update_constrain_gpu_impl.h +++ b/src/gromacs/mdlib/update_constrain_gpu_impl.h @@ -235,12 +235,7 @@ private: struct ScalingMatrix { ScalingMatrix(const matrix m) : - xx(m[XX][XX]), - yy(m[YY][YY]), - zz(m[ZZ][ZZ]), - yx(m[YY][XX]), - zx(m[ZZ][XX]), - zy(m[ZZ][YY]) + xx(m[XX][XX]), yy(m[YY][YY]), zz(m[ZZ][ZZ]), yx(m[YY][XX]), zx(m[ZZ][XX]), zy(m[ZZ][YY]) { } float xx, yy, zz, yx, zx, zy; diff --git a/src/gromacs/mdlib/updategroupscog.cpp b/src/gromacs/mdlib/updategroupscog.cpp index f73ae88de1..412e4cc8eb 100644 --- a/src/gromacs/mdlib/updategroupscog.cpp +++ b/src/gromacs/mdlib/updategroupscog.cpp @@ -56,8 +56,7 @@ UpdateGroupsCog::UpdateGroupsCog(const gmx_mtop_t& mto gmx::ArrayRef updateGroupingsPerMoleculeType, real temperature, int numHomeAtoms) : - globalToLocalMap_(numHomeAtoms), - mtop_(mtop) + globalToLocalMap_(numHomeAtoms), mtop_(mtop) { int firstUpdateGroupInMolecule = 0; for (const auto& molblock : mtop.molblock) diff --git a/src/gromacs/mdrun/md.cpp b/src/gromacs/mdrun/md.cpp index 186d257c48..dc6a0a25e1 100644 --- a/src/gromacs/mdrun/md.cpp +++ b/src/gromacs/mdrun/md.cpp @@ -364,8 +364,8 @@ void gmx::LegacySimulator::do_md() ForceBuffers f(fr->useMts, ((useGpuForNonbonded && useGpuForBufferOps) || useGpuForUpdate) - ? PinningPolicy::PinnedIfSupported - : PinningPolicy::CannotBePinned); + ? PinningPolicy::PinnedIfSupported + : PinningPolicy::CannotBePinned); const t_mdatoms* md = mdAtoms->mdatoms(); if (DOMAINDECOMP(cr)) { @@ -1297,7 +1297,7 @@ void gmx::LegacySimulator::do_md() state->v.rvec_array(), md->homenr, md->cTC ? gmx::arrayRefFromArray(md->cTC, md->nr) - : gmx::ArrayRef()); + : gmx::ArrayRef()); /* history is maintained in state->dfhist, but state_global is what is sent to trajectory and log output */ if (MASTER(cr)) { diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index f309a376a2..8046ef7cf3 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -1837,10 +1837,10 @@ int Mdrunner::mdrunner() const DeviceContext* deviceContext = runScheduleWork.simulationWork.useGpuPme ? &deviceStreamManager->context() : nullptr; - const DeviceStream* pmeStream = + const DeviceStream* pmeStream = runScheduleWork.simulationWork.useGpuPme - ? &deviceStreamManager->stream(DeviceStreamType::Pme) - : nullptr; + ? &deviceStreamManager->stream(DeviceStreamType::Pme) + : nullptr; pmedata = gmx_pme_init(cr, getNumPmeDomains(cr->dd), diff --git a/src/gromacs/mdrun/simulationinputhandle.cpp b/src/gromacs/mdrun/simulationinputhandle.cpp index ae5e2b81c6..7bf73b2ab5 100644 --- a/src/gromacs/mdrun/simulationinputhandle.cpp +++ b/src/gromacs/mdrun/simulationinputhandle.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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,8 +58,7 @@ class SimulationInput { public: SimulationInput(const char* tprFilename, const char* cpiFilename) : - tprFilename_(tprFilename), - cpiFilename_(cpiFilename) + tprFilename_(tprFilename), cpiFilename_(cpiFilename) { } @@ -112,11 +111,11 @@ detail::SimulationInputHandleImplDeleter::SimulationInputHandleImplDeleter( detail::SimulationInputHandleImplDeleter::SimulationInputHandleImplDeleter( SimulationInputHandleImplDeleter&&) noexcept = default; -detail::SimulationInputHandleImplDeleter& detail::SimulationInputHandleImplDeleter:: - operator=(const SimulationInputHandleImplDeleter&) noexcept = default; +detail::SimulationInputHandleImplDeleter& detail::SimulationInputHandleImplDeleter::operator=( + const SimulationInputHandleImplDeleter&) noexcept = default; -detail::SimulationInputHandleImplDeleter& detail::SimulationInputHandleImplDeleter:: - operator=(SimulationInputHandleImplDeleter&&) noexcept = default; +detail::SimulationInputHandleImplDeleter& detail::SimulationInputHandleImplDeleter::operator=( + SimulationInputHandleImplDeleter&&) noexcept = default; void detail::SimulationInputHandleImplDeleter::operator()(SimulationInputHandleImpl* impl) const { diff --git a/src/gromacs/mdrun/simulatorbuilder.h b/src/gromacs/mdrun/simulatorbuilder.h index 2250724078..5d03dbb050 100644 --- a/src/gromacs/mdrun/simulatorbuilder.h +++ b/src/gromacs/mdrun/simulatorbuilder.h @@ -92,9 +92,7 @@ public: SimulatorConfig(const MdrunOptions& mdrunOptions, StartingBehavior startingBehavior, MdrunScheduleWorkload* runScheduleWork) : - mdrunOptions_(mdrunOptions), - startingBehavior_(startingBehavior), - runScheduleWork_(runScheduleWork) + mdrunOptions_(mdrunOptions), startingBehavior_(startingBehavior), runScheduleWork_(runScheduleWork) { } // TODO: Specify copy and move semantics. @@ -155,11 +153,7 @@ public: gmx_multisim_t* multisimCommRec, const MDLogger& logger, gmx_output_env_t* outputEnv) : - fplog_{ fplog }, - commRec_{ commRec }, - multisimCommRec_{ multisimCommRec }, - logger_{ logger }, - outputEnv_{ outputEnv } + fplog_{ fplog }, commRec_{ commRec }, multisimCommRec_{ multisimCommRec }, logger_{ logger }, outputEnv_{ outputEnv } { } @@ -183,9 +177,7 @@ class Profiling public: //! Build profiling information collection. Profiling(t_nrnb* nrnb, gmx_walltime_accounting* walltimeAccounting, gmx_wallcycle* wallCycle) : - nrnb(nrnb), - wallCycle(wallCycle), - walltimeAccounting(walltimeAccounting) + nrnb(nrnb), wallCycle(wallCycle), walltimeAccounting(walltimeAccounting) { } @@ -205,9 +197,7 @@ class ConstraintsParam public: //! Build collection with handle to actual objects. ConstraintsParam(Constraints* constraints, gmx_enfrot* enforcedRotation, VirtualSitesHandler* vSite) : - constr(constraints), - enforcedRotation(enforcedRotation), - vsite(vSite) + constr(constraints), enforcedRotation(enforcedRotation), vsite(vSite) { } @@ -227,10 +217,7 @@ class LegacyInput public: //! Build collection from legacy input data. LegacyInput(int filenamesSize, const t_filenm* filenamesData, t_inputrec* inputRec, t_forcerec* forceRec) : - numFile(filenamesSize), - filenames(filenamesData), - inputrec(inputRec), - forceRec(forceRec) + numFile(filenamesSize), filenames(filenamesData), inputrec(inputRec), forceRec(forceRec) { } @@ -264,8 +251,7 @@ class SimulatorModules { public: SimulatorModules(IMDOutputProvider* mdOutputProvider, const MDModulesNotifiers& notifiers) : - outputProvider(mdOutputProvider), - mdModulesNotifiers(notifiers) + outputProvider(mdOutputProvider), mdModulesNotifiers(notifiers) { } @@ -306,8 +292,7 @@ class TopologyData public: //! Build collection from simulation data. TopologyData(const gmx_mtop_t& globalTopology, MDAtoms* mdAtoms) : - top_global(globalTopology), - mdAtoms(mdAtoms) + top_global(globalTopology), mdAtoms(mdAtoms) { } diff --git a/src/gromacs/mdrunutility/threadaffinity.cpp b/src/gromacs/mdrunutility/threadaffinity.cpp index f046c966e5..6e46b9841c 100644 --- a/src/gromacs/mdrunutility/threadaffinity.cpp +++ b/src/gromacs/mdrunutility/threadaffinity.cpp @@ -573,8 +573,8 @@ static bool detectDefaultAffinityMask(const int nthreads_hw_avail) */ void gmx_check_thread_affinity_set(const gmx::MDLogger& mdlog, gmx_hw_opt_t* hw_opt, - int gmx_unused nthreads_hw_avail, - gmx_bool bAfterOpenmpInit) + int gmx_unused nthreads_hw_avail, + gmx_bool bAfterOpenmpInit) { GMX_RELEASE_ASSERT(hw_opt, "hw_opt must be a non-NULL pointer"); diff --git a/src/gromacs/mdspan/extents.h b/src/gromacs/mdspan/extents.h index 74ea8b0867..64d135c4ef 100644 --- a/src/gromacs/mdspan/extents.h +++ b/src/gromacs/mdspan/extents.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2021, 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. @@ -247,16 +247,14 @@ struct extents_analyse */ template extents_analyse(const std::array& de, const std::size_t r) : - next(de, r + 1), - this_extent(de[r]) + next(de, r + 1), this_extent(de[r]) { } //! Copy constructor. template extents_analyse(extents_analyse rhs) : - next(rhs.next), - this_extent(rhs.extent(R)) + next(rhs.next), this_extent(rhs.extent(R)) { } @@ -379,7 +377,8 @@ public: * * \param[in] dynamic_extents array of dynamic rank size containing extents */ - constexpr extents(const std::array dynamic_extents) noexcept : + constexpr extents(const std::array dynamic_extents) noexcept + : impl(dynamic_extents, 0) { } diff --git a/src/gromacs/mdspan/mdspan.h b/src/gromacs/mdspan/mdspan.h index 5b2f535197..b3eb1b843d 100644 --- a/src/gromacs/mdspan/mdspan.h +++ b/src/gromacs/mdspan/mdspan.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -145,10 +145,9 @@ public: //! Copy constructor template constexpr basic_mdspan( - const basic_mdspan& rhs) noexcept : - acc_(rhs.acc_), - map_(rhs.map_), - ptr_(rhs.ptr_) + const basic_mdspan& rhs) noexcept + : + acc_(rhs.acc_), map_(rhs.map_), ptr_(rhs.ptr_) { } //! Copy assignment constructor @@ -169,9 +168,7 @@ public: */ template explicit constexpr basic_mdspan(pointer ptr, IndexType... DynamicExtents) noexcept : - acc_(accessor_type()), - map_(extents_type(DynamicExtents...)), - ptr_(ptr) + acc_(accessor_type()), map_(extents_type(DynamicExtents...)), ptr_(ptr) { } /*! \brief Construct from array describing dynamic extents. @@ -180,9 +177,7 @@ public: */ constexpr basic_mdspan(pointer ptr, const std::array& dynamic_extents) : - acc_(accessor_type()), - map_(extents_type(dynamic_extents)), - ptr_(ptr) + acc_(accessor_type()), map_(extents_type(dynamic_extents)), ptr_(ptr) { } /*! \brief Construct from pointer and mapping. @@ -190,9 +185,7 @@ public: * \param[in] m Mapping from multidimenisonal indices to one-dimensional offset. */ constexpr basic_mdspan(pointer ptr, const mapping_type& m) noexcept : - acc_(accessor_type()), - map_(m), - ptr_(ptr) + acc_(accessor_type()), map_(m), ptr_(ptr) { } /*! \brief Construct with pointer, mapping and accessor. @@ -201,9 +194,7 @@ public: * \param[in] a Accessor implementing memory access model. */ constexpr basic_mdspan(pointer ptr, const mapping_type& m, const accessor_type& a) noexcept : - acc_(a), - map_(m), - ptr_(ptr) + acc_(a), map_(m), ptr_(ptr) { } /*! \brief Construct mdspan from multidimensional arrays implemented with mdspan diff --git a/src/gromacs/mdtypes/forcebuffers.cpp b/src/gromacs/mdtypes/forcebuffers.cpp index 03d3e66f29..f125477fdf 100644 --- a/src/gromacs/mdtypes/forcebuffers.cpp +++ b/src/gromacs/mdtypes/forcebuffers.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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. @@ -50,10 +50,7 @@ namespace gmx { ForceBuffers::ForceBuffers() : - force_({}), - forceMtsCombined_({}), - view_({}, {}, false), - useForceMtsCombined_(false) + force_({}), forceMtsCombined_({}), view_({}, {}, false), useForceMtsCombined_(false) { } diff --git a/src/gromacs/mdtypes/forcebuffers.h b/src/gromacs/mdtypes/forcebuffers.h index 9c49e2f00a..caacedbc31 100644 --- a/src/gromacs/mdtypes/forcebuffers.h +++ b/src/gromacs/mdtypes/forcebuffers.h @@ -72,9 +72,7 @@ public: ForceBuffersView(const ArrayRefWithPadding& force, const ArrayRefWithPadding& forceMtsCombined, const bool useForceMtsCombined) : - force_(force), - forceMtsCombined_(forceMtsCombined), - useForceMtsCombined_(useForceMtsCombined) + force_(force), forceMtsCombined_(forceMtsCombined), useForceMtsCombined_(useForceMtsCombined) { } diff --git a/src/gromacs/mdtypes/forceoutput.h b/src/gromacs/mdtypes/forceoutput.h index a9a9ae6b2c..52300228b4 100644 --- a/src/gromacs/mdtypes/forceoutput.h +++ b/src/gromacs/mdtypes/forceoutput.h @@ -129,8 +129,7 @@ public: * \param[in] computeVirial True when algorithms are required to provide their virial contribution (for the current force evaluation) */ ForceWithVirial(const ArrayRef& force, const bool computeVirial) : - force_(force), - computeVirial_(computeVirial) + force_(force), computeVirial_(computeVirial) { for (int dim1 = 0; dim1 < DIM; dim1++) { diff --git a/src/gromacs/mdtypes/group.cpp b/src/gromacs/mdtypes/group.cpp index 8e708c737d..1d6960e6c9 100644 --- a/src/gromacs/mdtypes/group.cpp +++ b/src/gromacs/mdtypes/group.cpp @@ -46,8 +46,7 @@ #include "gromacs/utility/exceptions.h" gmx_ekindata_t::gmx_ekindata_t(int numTempCoupleGroups, real cos_accel, int numThreads) : - ngtc(numTempCoupleGroups), - nthreads_(numThreads) + ngtc(numTempCoupleGroups), nthreads_(numThreads) { tcstat.resize(ngtc); /* Set Berendsen tcoupl lambda's to 1, diff --git a/src/gromacs/mdtypes/iforceprovider.h b/src/gromacs/mdtypes/iforceprovider.h index 3006bf88e9..9b65e0fda4 100644 --- a/src/gromacs/mdtypes/iforceprovider.h +++ b/src/gromacs/mdtypes/iforceprovider.h @@ -96,12 +96,7 @@ public: double time, const matrix box, const t_commrec& cr) : - x_(x), - homenr_(homenr), - chargeA_(chargeA), - massT_(massT), - t_(time), - cr_(cr) + x_(x), homenr_(homenr), chargeA_(chargeA), massT_(massT), t_(time), cr_(cr) { copy_mat(box, box_); } @@ -138,8 +133,7 @@ public: * \param[in,out] enerd Structure containing energy data */ ForceProviderOutput(ForceWithVirial* forceWithVirial, gmx_enerdata_t* enerd) : - forceWithVirial_(makeRefFromPointer(forceWithVirial)), - enerd_(makeRefFromPointer(enerd)) + forceWithVirial_(makeRefFromPointer(forceWithVirial)), enerd_(makeRefFromPointer(enerd)) { } diff --git a/src/gromacs/mdtypes/interaction_const.h b/src/gromacs/mdtypes/interaction_const.h index aee0a64ea9..0f377eb347 100644 --- a/src/gromacs/mdtypes/interaction_const.h +++ b/src/gromacs/mdtypes/interaction_const.h @@ -150,11 +150,11 @@ struct interaction_const_t real rcoulomb_switch = 0; /* PME/Ewald */ - real ewaldcoeff_q = 0; - real ewaldcoeff_lj = 0; + real ewaldcoeff_q = 0; + real ewaldcoeff_lj = 0; LongRangeVdW ljpme_comb_rule = LongRangeVdW::Geom; /* LJ combination rule for the LJ PME mesh part */ - real sh_ewald = 0; /* -sh_ewald is added to the direct space potential */ - real sh_lj_ewald = 0; /* sh_lj_ewald is added to the correction potential */ + real sh_ewald = 0; /* -sh_ewald is added to the direct space potential */ + real sh_lj_ewald = 0; /* sh_lj_ewald is added to the correction potential */ /* Dielectric constant resp. multiplication factor for charges */ real epsilon_r = 1; diff --git a/src/gromacs/mdtypes/swaphistory.h b/src/gromacs/mdtypes/swaphistory.h index 9637463bb3..8dabf20ac7 100644 --- a/src/gromacs/mdtypes/swaphistory.h +++ b/src/gromacs/mdtypes/swaphistory.h @@ -84,7 +84,7 @@ typedef struct swaphistory_t int* fluxleak_p; // Pointer to this data bool bFromCpt; // Did we start from a checkpoint file? gmx::EnumerationArray nat; // Size of xc_old_whole, i.e. the number of atoms in each channel - gmx::EnumerationArray xc_old_whole; // Last known whole positions of the two channels (important for multimeric ch.!) + gmx::EnumerationArray xc_old_whole; // Last known whole positions of the two channels (important for multimeric ch.!) gmx::EnumerationArray xc_old_whole_p; // Pointer to these positions swapstateIons_t* ionType; // History information for one ion type } swaphistory_t; diff --git a/src/gromacs/modularsimulator/compositesimulatorelement.cpp b/src/gromacs/modularsimulator/compositesimulatorelement.cpp index 0110bf8090..369c1bde3a 100644 --- a/src/gromacs/modularsimulator/compositesimulatorelement.cpp +++ b/src/gromacs/modularsimulator/compositesimulatorelement.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -48,8 +48,7 @@ namespace gmx CompositeSimulatorElement::CompositeSimulatorElement( std::vector> elementCallList, std::vector> elements) : - elementCallList_(std::move(elementCallList)), - elementOwnershipList_(std::move(elements)) + elementCallList_(std::move(elementCallList)), elementOwnershipList_(std::move(elements)) { } diff --git a/src/gromacs/modularsimulator/constraintelement.cpp b/src/gromacs/modularsimulator/constraintelement.cpp index 06383b3603..cbf914d09c 100644 --- a/src/gromacs/modularsimulator/constraintelement.cpp +++ b/src/gromacs/modularsimulator/constraintelement.cpp @@ -94,7 +94,7 @@ void ConstraintsElement::elementSetup() const real lambdaBonded = freeEnergyPerturbationData_ ? freeEnergyPerturbationData_->constLambdaView()[static_cast( - FreeEnergyPerturbationCouplingType::Bonded)] + FreeEnergyPerturbationCouplingType::Bonded)] : 0; // Constrain the initial coordinates and velocities do_constrain_first(fplog_, @@ -120,7 +120,7 @@ void ConstraintsElement::elementSetup() } template -void ConstraintsElement::scheduleTask(Step step, +void ConstraintsElement::scheduleTask(Step step, Time gmx_unused time, const RegisterRunFunction& registerRunFunction) { diff --git a/src/gromacs/modularsimulator/freeenergyperturbationdata.cpp b/src/gromacs/modularsimulator/freeenergyperturbationdata.cpp index de8fbdc008..ac610f06c5 100644 --- a/src/gromacs/modularsimulator/freeenergyperturbationdata.cpp +++ b/src/gromacs/modularsimulator/freeenergyperturbationdata.cpp @@ -83,7 +83,7 @@ FreeEnergyPerturbationData::FreeEnergyPerturbationData(FILE* fplog, const t_inpu lambda_); } -void FreeEnergyPerturbationData::Element::scheduleTask(Step step, +void FreeEnergyPerturbationData::Element::scheduleTask(Step step, Time gmx_unused time, const RegisterRunFunction& registerRunFunction) { @@ -179,8 +179,7 @@ const std::string& FreeEnergyPerturbationData::Element::clientID() FreeEnergyPerturbationData::Element::Element(FreeEnergyPerturbationData* freeEnergyPerturbationElement, double deltaLambda) : - freeEnergyPerturbationData_(freeEnergyPerturbationElement), - lambdasChange_(deltaLambda != 0) + freeEnergyPerturbationData_(freeEnergyPerturbationElement), lambdasChange_(deltaLambda != 0) { } diff --git a/src/gromacs/modularsimulator/parrinellorahmanbarostat.cpp b/src/gromacs/modularsimulator/parrinellorahmanbarostat.cpp index b06b8744dc..4bdcff7892 100644 --- a/src/gromacs/modularsimulator/parrinellorahmanbarostat.cpp +++ b/src/gromacs/modularsimulator/parrinellorahmanbarostat.cpp @@ -106,7 +106,7 @@ void ParrinelloRahmanBarostat::connectWithMatchingPropagator(const PropagatorCon } } -void ParrinelloRahmanBarostat::scheduleTask(Step step, +void ParrinelloRahmanBarostat::scheduleTask(Step step, Time gmx_unused time, const RegisterRunFunction& registerRunFunction) { diff --git a/src/gromacs/modularsimulator/propagator.cpp b/src/gromacs/modularsimulator/propagator.cpp index 0e56ed0660..ad04e4f23a 100644 --- a/src/gromacs/modularsimulator/propagator.cpp +++ b/src/gromacs/modularsimulator/propagator.cpp @@ -73,12 +73,12 @@ constexpr EnumerationArray integrationStepNames = template -static void inline updateVelocities(int a, - real dt, - real lambdaStart, - real lambdaEnd, +static void inline updateVelocities(int a, + real dt, + real lambdaStart, + real lambdaEnd, const rvec* gmx_restrict invMassPerDim, - rvec* gmx_restrict v, + rvec* gmx_restrict v, const rvec* gmx_restrict f, const rvec diagPR, const matrix matrixPR) @@ -120,10 +120,10 @@ static void inline updateVelocities(int a, } //! Update positions -static void inline updatePositions(int a, - real dt, +static void inline updatePositions(int a, + real dt, const rvec* gmx_restrict x, - rvec* gmx_restrict xprime, + rvec* gmx_restrict xprime, const rvec* gmx_restrict v) { for (int d = 0; d < DIM; d++) @@ -276,9 +276,9 @@ void Propagator::run() const real lambdaStart = (numStartVelocityScalingValues == NumVelocityScalingValues::Single) ? startVelocityScaling_[0] : 1.0; - const real lambdaEnd = (numEndVelocityScalingValues == NumVelocityScalingValues::Single) - ? endVelocityScaling_[0] - : 1.0; + const real lambdaEnd = (numEndVelocityScalingValues == NumVelocityScalingValues::Single) + ? endVelocityScaling_[0] + : 1.0; const bool isFullScalingMatrixDiagonal = diagonalizePRMatrix(matrixPR_, diagPR_); @@ -359,9 +359,9 @@ void Propagator::run() const real lambdaStart = (numStartVelocityScalingValues == NumVelocityScalingValues::Single) ? startVelocityScaling_[0] : 1.0; - const real lambdaEnd = (numEndVelocityScalingValues == NumVelocityScalingValues::Single) - ? endVelocityScaling_[0] - : 1.0; + const real lambdaEnd = (numEndVelocityScalingValues == NumVelocityScalingValues::Single) + ? endVelocityScaling_[0] + : 1.0; const bool isFullScalingMatrixDiagonal = diagonalizePRMatrix(matrixPR_, diagPR_); @@ -444,9 +444,9 @@ void Propagator::run() const real lambdaStart = (numStartVelocityScalingValues == NumVelocityScalingValues::Single) ? startVelocityScaling_[0] : 1.0; - const real lambdaEnd = (numEndVelocityScalingValues == NumVelocityScalingValues::Single) - ? endVelocityScaling_[0] - : 1.0; + const real lambdaEnd = (numEndVelocityScalingValues == NumVelocityScalingValues::Single) + ? endVelocityScaling_[0] + : 1.0; const bool isFullScalingMatrixDiagonal = diagonalizePRMatrix(matrixPR_, diagPR_); @@ -581,7 +581,7 @@ Propagator::Propagator(double timestep, } template -void Propagator::scheduleTask(Step step, +void Propagator::scheduleTask(Step step, Time gmx_unused time, const RegisterRunFunction& registerRunFunction) { diff --git a/src/gromacs/modularsimulator/signallers.cpp b/src/gromacs/modularsimulator/signallers.cpp index 70ed23d556..84fadcbb66 100644 --- a/src/gromacs/modularsimulator/signallers.cpp +++ b/src/gromacs/modularsimulator/signallers.cpp @@ -65,10 +65,7 @@ NeighborSearchSignaller::NeighborSearchSignaller(std::vector Step nstlist, Step initStep, Time initTime) : - callbacks_(std::move(callbacks)), - nstlist_(nstlist), - initStep_(initStep), - initTime_(initTime) + callbacks_(std::move(callbacks)), nstlist_(nstlist), initStep_(initStep), initTime_(initTime) { } diff --git a/src/gromacs/modularsimulator/statepropagatordata.cpp b/src/gromacs/modularsimulator/statepropagatordata.cpp index 4dd6a899f2..430dd70dbb 100644 --- a/src/gromacs/modularsimulator/statepropagatordata.cpp +++ b/src/gromacs/modularsimulator/statepropagatordata.cpp @@ -335,7 +335,7 @@ void StatePropagatorData::copyPosition(int start, int end) } } -void StatePropagatorData::Element::scheduleTask(Step step, +void StatePropagatorData::Element::scheduleTask(Step step, Time gmx_unused time, const RegisterRunFunction& registerRunFunction) { diff --git a/src/gromacs/modularsimulator/velocityscalingtemperaturecoupling.cpp b/src/gromacs/modularsimulator/velocityscalingtemperaturecoupling.cpp index 3f323c1acf..c2b8b6ab71 100644 --- a/src/gromacs/modularsimulator/velocityscalingtemperaturecoupling.cpp +++ b/src/gromacs/modularsimulator/velocityscalingtemperaturecoupling.cpp @@ -124,9 +124,9 @@ class VRescaleTemperatureCoupling final : public ITemperatureCouplingImpl { public: //! Apply the v-rescale temperature control - real apply(Step step, - int temperatureGroup, - real currentKineticEnergy, + real apply(Step step, + int temperatureGroup, + real currentKineticEnergy, real gmx_unused currentTemperature, const TemperatureCouplingData& temperatureCouplingData) override { @@ -516,7 +516,7 @@ void VelocityScalingTemperatureCoupling::elementSetup() } } -void VelocityScalingTemperatureCoupling::scheduleTask(Step step, +void VelocityScalingTemperatureCoupling::scheduleTask(Step step, Time gmx_unused time, const RegisterRunFunction& registerRunFunction) { @@ -568,9 +568,9 @@ void VelocityScalingTemperatureCoupling::setLambda(Step step) const real currentKineticEnergy = useFullStepKE_ == UseFullStepKE::Yes ? trace(ekind->tcstat[temperatureGroup].ekinf) : trace(ekind->tcstat[temperatureGroup].ekinh); - const real currentTemperature = useFullStepKE_ == UseFullStepKE::Yes - ? ekind->tcstat[temperatureGroup].T - : ekind->tcstat[temperatureGroup].Th; + const real currentTemperature = useFullStepKE_ == UseFullStepKE::Yes + ? ekind->tcstat[temperatureGroup].T + : ekind->tcstat[temperatureGroup].Th; temperatureCouplingIntegral_[temperatureGroup] = temperatureCouplingImpl_->apply( step, temperatureGroup, currentKineticEnergy, currentTemperature, thermostatData); diff --git a/src/gromacs/nbnxm/atomdata.cpp b/src/gromacs/nbnxm/atomdata.cpp index bce2b142ae..5337c8072e 100644 --- a/src/gromacs/nbnxm/atomdata.cpp +++ b/src/gromacs/nbnxm/atomdata.cpp @@ -504,7 +504,8 @@ static void nbnxn_atomdata_params_init(const gmx::MDLogger& mdlog, /* Compare 6*C6 and 12*C12 for geometric cobination rule */ bCombGeom = bCombGeom - && gmx_within_tol(c6 * c6, nbfp[(i * ntype + i) * 2] * nbfp[(j * ntype + j) * 2], tol) + && gmx_within_tol( + c6 * c6, nbfp[(i * ntype + i) * 2] * nbfp[(j * ntype + j) * 2], tol) && gmx_within_tol(c12 * c12, nbfp[(i * ntype + i) * 2 + 1] * nbfp[(j * ntype + j) * 2 + 1], tol); @@ -512,18 +513,18 @@ static void nbnxn_atomdata_params_init(const gmx::MDLogger& mdlog, /* Compare C6 and C12 for Lorentz-Berthelot combination rule */ c6 /= 6.0; c12 /= 12.0; - bCombLB = - bCombLB - && ((c6 == 0 && c12 == 0 - && (params->nbfp_comb[i * 2 + 1] == 0 || params->nbfp_comb[j * 2 + 1] == 0)) - || (c6 > 0 && c12 > 0 - && gmx_within_tol(gmx::sixthroot(c12 / c6), - 0.5 * (params->nbfp_comb[i * 2] + params->nbfp_comb[j * 2]), - tol) - && gmx_within_tol(0.25 * c6 * c6 / c12, - std::sqrt(params->nbfp_comb[i * 2 + 1] - * params->nbfp_comb[j * 2 + 1]), - tol))); + bCombLB = bCombLB + && ((c6 == 0 && c12 == 0 + && (params->nbfp_comb[i * 2 + 1] == 0 || params->nbfp_comb[j * 2 + 1] == 0)) + || (c6 > 0 && c12 > 0 + && gmx_within_tol( + gmx::sixthroot(c12 / c6), + 0.5 * (params->nbfp_comb[i * 2] + params->nbfp_comb[j * 2]), + tol) + && gmx_within_tol(0.25 * c6 * c6 / c12, + std::sqrt(params->nbfp_comb[i * 2 + 1] + * params->nbfp_comb[j * 2 + 1]), + tol))); } else { @@ -1052,8 +1053,8 @@ static void nbnxn_atomdata_clear_reals(gmx::ArrayRef dest, int i0, int i1) } } -gmx_unused static void nbnxn_atomdata_reduce_reals(real* gmx_restrict dest, - gmx_bool bDestSet, +gmx_unused static void nbnxn_atomdata_reduce_reals(real* gmx_restrict dest, + gmx_bool bDestSet, const real** gmx_restrict src, int nsrc, int i0, @@ -1085,11 +1086,11 @@ gmx_unused static void nbnxn_atomdata_reduce_reals(real* gmx_restrict dest, } gmx_unused static void nbnxn_atomdata_reduce_reals_simd(real gmx_unused* gmx_restrict dest, - gmx_bool gmx_unused bDestSet, + gmx_bool gmx_unused bDestSet, const gmx_unused real** gmx_restrict src, - int gmx_unused nsrc, - int gmx_unused i0, - int gmx_unused i1) + int gmx_unused nsrc, + int gmx_unused i0, + int gmx_unused i1) { #if GMX_SIMD /* The SIMD width here is actually independent of that in the kernels, diff --git a/src/gromacs/nbnxm/benchmark/bench_setup.cpp b/src/gromacs/nbnxm/benchmark/bench_setup.cpp index 5ac216df22..e45db48ca3 100644 --- a/src/gromacs/nbnxm/benchmark/bench_setup.cpp +++ b/src/gromacs/nbnxm/benchmark/bench_setup.cpp @@ -179,7 +179,7 @@ static std::unique_ptr setupNbnxmForBenchInstance(const Kern const gmx::BenchmarkSystem& system) { const auto pinPolicy = (options.useGpu ? gmx::PinningPolicy::PinnedIfSupported - : gmx::PinningPolicy::CannotBePinned); + : gmx::PinningPolicy::CannotBePinned); const int numThreads = options.numThreads; // Note: the options and Nbnxm combination rule enums values should match const int combinationRule = static_cast(options.ljCombinationRule); diff --git a/src/gromacs/nbnxm/cuda/nbnxm_cuda_kernel_utils.cuh b/src/gromacs/nbnxm/cuda/nbnxm_cuda_kernel_utils.cuh index b916997a22..554748330f 100644 --- a/src/gromacs/nbnxm/cuda/nbnxm_cuda_kernel_utils.cuh +++ b/src/gromacs/nbnxm/cuda/nbnxm_cuda_kernel_utils.cuh @@ -78,7 +78,7 @@ static const float __device__ c_oneTwelveth = 0.08333333f; /*! Convert LJ sigma,epsilon parameters to C6,C12. */ static __forceinline__ __device__ void - convert_sigma_epsilon_to_c6_c12(const float sigma, const float epsilon, float* c6, float* c12) +convert_sigma_epsilon_to_c6_c12(const float sigma, const float epsilon, float* c6, float* c12) { float sigma2, sigma6; @@ -90,7 +90,7 @@ static __forceinline__ __device__ void /*! Apply force switch, force + energy version. */ static __forceinline__ __device__ void - calculate_force_switch_F(const NBParamGpu nbparam, float c6, float c12, float inv_r, float r2, float* F_invr) +calculate_force_switch_F(const NBParamGpu nbparam, float c6, float c12, float inv_r, float r2, float* F_invr) { float r, r_switch; @@ -142,7 +142,7 @@ static __forceinline__ __device__ void calculate_force_switch_F_E(const NBParamG /*! Apply potential switch, force-only version. */ static __forceinline__ __device__ void - calculate_potential_switch_F(const NBParamGpu nbparam, float inv_r, float r2, float* F_invr, float* E_lj) +calculate_potential_switch_F(const NBParamGpu nbparam, float inv_r, float r2, float* F_invr, float* E_lj) { float r, r_switch; float sw, dsw; @@ -170,7 +170,7 @@ static __forceinline__ __device__ void /*! Apply potential switch, force + energy version. */ static __forceinline__ __device__ void - calculate_potential_switch_F_E(const NBParamGpu nbparam, float inv_r, float r2, float* F_invr, float* E_lj) +calculate_potential_switch_F_E(const NBParamGpu nbparam, float inv_r, float r2, float* F_invr, float* E_lj) { float r, r_switch; float sw, dsw; @@ -445,7 +445,7 @@ static __forceinline__ __device__ float pmecorrF(float z2) * arbitrary array sizes. */ static __forceinline__ __device__ void - reduce_force_j_generic(float* f_buf, float3* fout, int tidxi, int tidxj, int aidx) +reduce_force_j_generic(float* f_buf, float3* fout, int tidxi, int tidxj, int aidx) { if (tidxi < 3) { @@ -463,7 +463,7 @@ static __forceinline__ __device__ void * array sizes. */ static __forceinline__ __device__ void - reduce_force_j_warp_shfl(float3 f, float3* fout, int tidxi, int aidx, const unsigned int activemask) +reduce_force_j_warp_shfl(float3 f, float3* fout, int tidxi, int aidx, const unsigned int activemask) { f.x += __shfl_down_sync(activemask, f.x, 1); f.y += __shfl_up_sync(activemask, f.y, 1); @@ -574,7 +574,7 @@ static __forceinline__ __device__ void reduce_force_i_pow2(volatile float* f_buf * on whether the size of the array to be reduced is power of two or not. */ static __forceinline__ __device__ void - reduce_force_i(float* f_buf, float3* f, float* fshift_buf, bool bCalcFshift, int tidxi, int tidxj, int ai) +reduce_force_i(float* f_buf, float3* f, float* fshift_buf, bool bCalcFshift, int tidxi, int tidxj, int ai) { if ((c_clSize & (c_clSize - 1))) { @@ -630,7 +630,7 @@ static __forceinline__ __device__ void reduce_force_i_warp_shfl(float3 * array sizes. */ static __forceinline__ __device__ void - reduce_energy_pow2(volatile float* buf, float* e_lj, float* e_el, unsigned int tidx) +reduce_energy_pow2(volatile float* buf, float* e_lj, float* e_el, unsigned int tidx) { float e1, e2; @@ -665,7 +665,7 @@ static __forceinline__ __device__ void * array sizes. */ static __forceinline__ __device__ void - reduce_energy_warp_shfl(float E_lj, float E_el, float* e_lj, float* e_el, int tidx, const unsigned int activemask) +reduce_energy_warp_shfl(float E_lj, float E_el, float* e_lj, float* e_el, int tidx, const unsigned int activemask) { int i, sh; diff --git a/src/gromacs/nbnxm/gpu_data_mgmt.h b/src/gromacs/nbnxm/gpu_data_mgmt.h index 3f04782c4f..a27ebf07d4 100644 --- a/src/gromacs/nbnxm/gpu_data_mgmt.h +++ b/src/gromacs/nbnxm/gpu_data_mgmt.h @@ -84,7 +84,7 @@ NbnxmGpu* gpu_init(const gmx::DeviceStreamManager gmx_unused& deviceStreamManage GPU_FUNC_QUALIFIER void gpu_init_pairlist(NbnxmGpu gmx_unused* nb, const struct NbnxnPairlistGpu gmx_unused* h_nblist, - gmx::InteractionLocality gmx_unused iloc) GPU_FUNC_TERM; + gmx::InteractionLocality gmx_unused iloc) GPU_FUNC_TERM; /** Initializes atom-data on the GPU, called at every pair search step. */ GPU_FUNC_QUALIFIER diff --git a/src/gromacs/nbnxm/kerneldispatch.cpp b/src/gromacs/nbnxm/kerneldispatch.cpp index f84ddf3a56..acaa19b912 100644 --- a/src/gromacs/nbnxm/kerneldispatch.cpp +++ b/src/gromacs/nbnxm/kerneldispatch.cpp @@ -109,8 +109,8 @@ static void reduceGroupEnergySimdBuffers(int numGroups, int numGroups_2log, nbnx const real* gmx_restrict vVdwSimd = out->VSvdw.data(); const real* gmx_restrict vCoulombSimd = out->VSc.data(); - real* gmx_restrict vVdw = out->Vvdw.data(); - real* gmx_restrict vCoulomb = out->Vc.data(); + real* gmx_restrict vVdw = out->Vvdw.data(); + real* gmx_restrict vCoulomb = out->Vc.data(); /* The size of the SIMD energy group buffer array is: * numGroups*numGroups*numGroupsStorage*unrollj_half*simd_width diff --git a/src/gromacs/nbnxm/kernels_reference/kernel_ref_prune.cpp b/src/gromacs/nbnxm/kernels_reference/kernel_ref_prune.cpp index 8d94eaed56..977b945ce6 100644 --- a/src/gromacs/nbnxm/kernels_reference/kernel_ref_prune.cpp +++ b/src/gromacs/nbnxm/kernels_reference/kernel_ref_prune.cpp @@ -53,10 +53,10 @@ void nbnxn_kernel_prune_ref(NbnxnPairlistCpu* nbl, nbl->cj.resize(nbl->cjOuter.size()); const nbnxn_ci_t* gmx_restrict ciOuter = nbl->ciOuter.data(); - nbnxn_ci_t* gmx_restrict ciInner = nbl->ci.data(); + nbnxn_ci_t* gmx_restrict ciInner = nbl->ci.data(); const nbnxn_cj_t* gmx_restrict cjOuter = nbl->cjOuter.data(); - nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data(); + nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data(); const real* gmx_restrict x = nbat->x().data(); diff --git a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_common.h b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_common.h index 34160ab8c9..fff9328a09 100644 --- a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_common.h +++ b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_common.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2012,2013,2014,2015,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -104,7 +104,8 @@ static inline void gmx_simdcall gmx_load_simd_2xnn_interactions(int e *interact_S0 = cvtIB2B(testBits(mask_pr_S & filter_S0)); *interact_S2 = cvtIB2B(testBits(mask_pr_S & filter_S2)); #elif GMX_SIMD_HAVE_LOGICAL - union { + union + { # if GMX_DOUBLE std::int64_t i; # else diff --git a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h index be27518f93..bdf2524e51 100644 --- a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h +++ b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h @@ -149,7 +149,7 @@ #if !(defined LJ_COMB_GEOM || defined LJ_COMB_LB || defined FIX_LJ_C) /* No combination rule used */ const real* gmx_restrict nbfp_ptr = nbatParams.nbfp_aligned.data(); - const int* gmx_restrict type = nbatParams.type.data(); + const int* gmx_restrict type = nbatParams.type.data(); #endif /* Load j-i for the first i */ diff --git a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_prune.cpp b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_prune.cpp index eab55185f0..8ca6f06dce 100644 --- a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_prune.cpp +++ b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_prune.cpp @@ -62,10 +62,10 @@ void nbnxn_kernel_prune_2xnn(NbnxnPairlistCpu* nbl, nbl->cj.resize(nbl->cjOuter.size()); const nbnxn_ci_t* gmx_restrict ciOuter = nbl->ciOuter.data(); - nbnxn_ci_t* gmx_restrict ciInner = nbl->ci.data(); + nbnxn_ci_t* gmx_restrict ciInner = nbl->ci.data(); const nbnxn_cj_t* gmx_restrict cjOuter = nbl->cjOuter.data(); - nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data(); + nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data(); const real* gmx_restrict x = nbat->x().data(); diff --git a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_common.h b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_common.h index 1ad55177ee..c4af95d65e 100644 --- a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_common.h +++ b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_common.h @@ -97,7 +97,7 @@ typedef gmx::SimdInt32 SimdBitMask; typedef gmx::SimdReal SimdBitMask; #endif -static inline void gmx_simdcall gmx_load_simd_4xn_interactions(int excl, +static inline void gmx_simdcall gmx_load_simd_4xn_interactions(int excl, SimdBitMask gmx_unused filter_S0, SimdBitMask gmx_unused filter_S1, SimdBitMask gmx_unused filter_S2, @@ -117,7 +117,8 @@ static inline void gmx_simdcall gmx_load_simd_4xn_interactions(int excl, *interact_S2 = cvtIB2B(testBits(mask_pr_S & filter_S2)); *interact_S3 = cvtIB2B(testBits(mask_pr_S & filter_S3)); #elif GMX_SIMD_HAVE_LOGICAL - union { + union + { # if GMX_DOUBLE std::int64_t i; # else diff --git a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h index 1946355f26..2af0345368 100644 --- a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h +++ b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h @@ -151,7 +151,7 @@ #if !(defined LJ_COMB_GEOM || defined LJ_COMB_LB || defined FIX_LJ_C) /* No combination rule used */ const real* gmx_restrict nbfp_ptr = nbatParams.nbfp_aligned.data(); - const int* gmx_restrict type = nbatParams.type.data(); + const int* gmx_restrict type = nbatParams.type.data(); #endif /* Load j-i for the first i */ diff --git a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_prune.cpp b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_prune.cpp index cb2059a713..a623fa5f17 100644 --- a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_prune.cpp +++ b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_prune.cpp @@ -62,10 +62,10 @@ void nbnxn_kernel_prune_4xn(NbnxnPairlistCpu* nbl, nbl->cj.resize(nbl->cjOuter.size()); const nbnxn_ci_t* gmx_restrict ciOuter = nbl->ciOuter.data(); - nbnxn_ci_t* gmx_restrict ciInner = nbl->ci.data(); + nbnxn_ci_t* gmx_restrict ciInner = nbl->ci.data(); const nbnxn_cj_t* gmx_restrict cjOuter = nbl->cjOuter.data(); - nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data(); + nbnxn_cj_t* gmx_restrict cjInner = nbl->cj.data(); const real* gmx_restrict x = nbat->x().data(); diff --git a/src/gromacs/nbnxm/nbnxm_gpu.h b/src/gromacs/nbnxm/nbnxm_gpu.h index a3633c2c7a..74e2f07d51 100644 --- a/src/gromacs/nbnxm/nbnxm_gpu.h +++ b/src/gromacs/nbnxm/nbnxm_gpu.h @@ -94,7 +94,7 @@ static inline bool useLjCombRule(const enum VdwType vdwType) GPU_FUNC_QUALIFIER void gpu_copy_xq_to_gpu(NbnxmGpu gmx_unused* nb, const struct nbnxn_atomdata_t gmx_unused* nbdata, - gmx::AtomLocality gmx_unused aloc) GPU_FUNC_TERM; + gmx::AtomLocality gmx_unused aloc) GPU_FUNC_TERM; /*! \brief * Launch asynchronously the nonbonded force calculations. @@ -147,9 +147,9 @@ void gpu_launch_kernel(NbnxmGpu gmx_unused* nb, * \param [in] numParts Number of parts the pair list is split into in the rolling kernel. */ GPU_FUNC_QUALIFIER -void gpu_launch_kernel_pruneonly(NbnxmGpu gmx_unused* nb, +void gpu_launch_kernel_pruneonly(NbnxmGpu gmx_unused* nb, gmx::InteractionLocality gmx_unused iloc, - int gmx_unused numParts) GPU_FUNC_TERM; + int gmx_unused numParts) GPU_FUNC_TERM; /*! \brief * Launch asynchronously the download of short-range forces from the GPU @@ -159,7 +159,7 @@ GPU_FUNC_QUALIFIER void gpu_launch_cpyback(NbnxmGpu gmx_unused* nb, nbnxn_atomdata_t gmx_unused* nbatom, const gmx::StepWorkload gmx_unused& stepWork, - gmx::AtomLocality gmx_unused aloc) GPU_FUNC_TERM; + gmx::AtomLocality gmx_unused aloc) GPU_FUNC_TERM; /*! \brief Attempts to complete nonbonded GPU task. * @@ -201,11 +201,11 @@ void gpu_launch_cpyback(NbnxmGpu gmx_unused* nb, GPU_FUNC_QUALIFIER bool gpu_try_finish_task(NbnxmGpu gmx_unused* nb, const gmx::StepWorkload gmx_unused& stepWork, - gmx::AtomLocality gmx_unused aloc, + gmx::AtomLocality gmx_unused aloc, real gmx_unused* e_lj, - real gmx_unused* e_el, + real gmx_unused* e_el, gmx::ArrayRef gmx_unused shiftForces, - GpuTaskCompletion gmx_unused completionKind, + GpuTaskCompletion gmx_unused completionKind, gmx_wallcycle gmx_unused* wcycle) GPU_FUNC_TERM_WITH_RETURN(false); /*! \brief Completes the nonbonded GPU task blocking until GPU tasks and data @@ -225,9 +225,9 @@ bool gpu_try_finish_task(NbnxmGpu gmx_unused* nb, GPU_FUNC_QUALIFIER float gpu_wait_finish_task(NbnxmGpu gmx_unused* nb, const gmx::StepWorkload gmx_unused& stepWork, - gmx::AtomLocality gmx_unused aloc, + gmx::AtomLocality gmx_unused aloc, real gmx_unused* e_lj, - real gmx_unused* e_el, + real gmx_unused* e_el, gmx::ArrayRef gmx_unused shiftForces, gmx_wallcycle gmx_unused* wcycle) GPU_FUNC_TERM_WITH_RETURN(0.0); @@ -252,12 +252,12 @@ void nbnxn_gpu_init_x_to_nbat_x(const Nbnxm::GridSet gmx_unused& gridSet, */ GPU_FUNC_QUALIFIER void nbnxn_gpu_x_to_nbat_x(const Nbnxm::Grid gmx_unused& grid, - NbnxmGpu gmx_unused* gpu_nbv, + NbnxmGpu gmx_unused* gpu_nbv, DeviceBuffer gmx_unused d_x, GpuEventSynchronizer gmx_unused* xReadyOnDevice, - gmx::AtomLocality gmx_unused locality, - int gmx_unused gridId, - int gmx_unused numColumnsMax, + gmx::AtomLocality gmx_unused locality, + int gmx_unused gridId, + int gmx_unused numColumnsMax, bool gmx_unused mustInsertNonLocalDependency) GPU_FUNC_TERM; /*! \brief Sync the nonlocal stream with dependent tasks in the local queue. @@ -271,7 +271,7 @@ void nbnxn_gpu_x_to_nbat_x(const Nbnxm::Grid gmx_unused& grid, * \param[in] interactionLocality Local or NonLocal sync point */ GPU_FUNC_QUALIFIER -void nbnxnInsertNonlocalGpuDependency(NbnxmGpu gmx_unused* nb, +void nbnxnInsertNonlocalGpuDependency(NbnxmGpu gmx_unused* nb, gmx::InteractionLocality gmx_unused interactionLocality) GPU_FUNC_TERM; /*! \brief Set up internal flags that indicate what type of short-range work there is. @@ -288,7 +288,7 @@ void nbnxnInsertNonlocalGpuDependency(NbnxmGpu gmx_unused* nb, */ GPU_FUNC_QUALIFIER void setupGpuShortRangeWork(NbnxmGpu gmx_unused* nb, - const gmx::GpuBonded gmx_unused* gpuBonded, + const gmx::GpuBonded gmx_unused* gpuBonded, gmx::InteractionLocality gmx_unused iLocality) GPU_FUNC_TERM; /*! \brief Returns true if there is GPU short-range work for the given interaction locality. diff --git a/src/gromacs/nbnxm/nbnxm_setup.cpp b/src/gromacs/nbnxm/nbnxm_setup.cpp index 422840d889..b33390c7e2 100644 --- a/src/gromacs/nbnxm/nbnxm_setup.cpp +++ b/src/gromacs/nbnxm/nbnxm_setup.cpp @@ -294,8 +294,7 @@ static KernelSetup pick_nbnxn_kernel(const gmx::MDLogger& mdlog, PairlistSets::PairlistSets(const PairlistParams& pairlistParams, const bool haveMultipleDomains, const int minimumIlistCountForGpuBalancing) : - params_(pairlistParams), - minimumIlistCountForGpuBalancing_(minimumIlistCountForGpuBalancing) + params_(pairlistParams), minimumIlistCountForGpuBalancing_(minimumIlistCountForGpuBalancing) { localSet_ = std::make_unique(params_); diff --git a/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh b/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh index 68c1a9df7a..8af2f67435 100644 --- a/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh +++ b/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh @@ -115,12 +115,12 @@ __kernel void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_opencl) #ifndef LJ_COMB int ntypes, /* IN */ #endif - cl_nbparam_params_t nbparam_params, /* IN */ - const __global float4* restrict xq, /* IN */ - __global float* restrict f, /* OUT stores float3 values */ - __global float* restrict gmx_unused e_lj, /* OUT */ - __global float* restrict gmx_unused e_el, /* OUT */ - __global float* restrict fshift, /* OUT stores float3 values */ + cl_nbparam_params_t nbparam_params, /* IN */ + const __global float4* restrict xq, /* IN */ + __global float* restrict f, /* OUT stores float3 values */ + __global float* restrict gmx_unused e_lj, /* OUT */ + __global float* restrict gmx_unused e_el, /* OUT */ + __global float* restrict fshift, /* OUT stores float3 values */ #ifdef LJ_COMB const __global float2* restrict lj_comb, /* IN stores float2 values */ #else @@ -128,9 +128,9 @@ __kernel void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_opencl) #endif const __global float* restrict shift_vec, /* IN stores float3 values */ __constant const float2* restrict gmx_unused nbfp, /* IN */ - __constant const float2* restrict gmx_unused nbfp_comb, /* IN */ - __constant const float* restrict gmx_unused coulomb_tab, /* IN */ - const __global nbnxn_sci_t* pl_sci, /* IN */ + __constant const float2* restrict gmx_unused nbfp_comb, /* IN */ + __constant const float* restrict gmx_unused coulomb_tab, /* IN */ + const __global nbnxn_sci_t* pl_sci, /* IN */ #ifndef PRUNE_NBL const #endif @@ -558,7 +558,7 @@ __kernel void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_opencl) F_invr += qi * qj_f * (int_bit * inv_r2 - interpolate_coulomb_force_r( - coulomb_tab, r2 * inv_r, coulomb_tab_scale)) + coulomb_tab, r2 * inv_r, coulomb_tab_scale)) * inv_r; #endif /* EL_EWALD_ANA/TAB */ diff --git a/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_pruneonly.clh b/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_pruneonly.clh index 49d19645a9..b469440725 100644 --- a/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_pruneonly.clh +++ b/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_pruneonly.clh @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2020,2021, 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. @@ -65,7 +65,7 @@ nbnxn_kernel_prune_rolling_opencl #endif (cl_nbparam_params_t nbparam_params, const __global float4* restrict xq, - const __global float* restrict shift_vec, + const __global float* restrict shift_vec, const __global nbnxn_sci_t* pl_sci, __global nbnxn_cj4_t* pl_cj4, #if !defined HAVE_FRESH_LIST diff --git a/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_utils.clh b/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_utils.clh index 4e2e208d40..9344b71a2e 100644 --- a/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_utils.clh +++ b/src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel_utils.clh @@ -245,7 +245,7 @@ gmx_opencl_inline void preloadCj4Generic(__local int* sm_cjPreload, const __global int* gm_cj, int tidxi, int tidxj, - bool gmx_unused iMaskCond) + bool gmx_unused iMaskCond) { /* Pre-load cj into shared memory */ # if defined _AMD_SOURCE_ // TODO: fix by setting c_nbnxnGpuClusterpairSplit properly @@ -291,9 +291,9 @@ typedef __local int* CjType; */ gmx_opencl_inline void preloadCj4(CjType gmx_unused* cjs, const __global int gmx_unused* gm_cj, - int gmx_unused tidxi, - int gmx_unused tidxj, - bool gmx_unused iMaskCond) + int gmx_unused tidxi, + int gmx_unused tidxj, + bool gmx_unused iMaskCond) { # if USE_SUBGROUP_PRELOAD *cjs = preloadCj4Subgroup(gm_cj); @@ -739,14 +739,14 @@ gmx_opencl_inline void reduce_force_i_and_shift_shfl(__private fvec fci_buf[], * array sizes. */ gmx_opencl_inline void reduce_force_i_and_shift_pow2(volatile __local float* f_buf, - __private fvec fci_buf[], - __global float* fout, - bool bCalcFshift, - int tidxi, - int tidxj, - int sci, - int shift, - __global float* fshift) + __private fvec fci_buf[], + __global float* fout, + bool bCalcFshift, + int tidxi, + int tidxj, + int sci, + int shift, + __global float* fshift) { float fshift_buf = 0; for (int ci_offset = 0; ci_offset < c_nbnxnGpuNumClusterPerSupercluster; ci_offset++) @@ -818,14 +818,14 @@ gmx_opencl_inline void reduce_force_i_and_shift_pow2(volatile __local float* f_b /*! Final i-force reduction */ gmx_opencl_inline void reduce_force_i_and_shift(__local float gmx_unused* f_buf, - __private fvec fci_buf[], - __global float* f, - bool bCalcFshift, - int tidxi, - int tidxj, - int sci, - int shift, - __global float* fshift) + __private fvec fci_buf[], + __global float* f, + bool bCalcFshift, + int tidxi, + int tidxj, + int sci, + int shift, + __global float* fshift) { # if REDUCE_SHUFFLE reduce_force_i_and_shift_shfl(fci_buf, f, bCalcFshift, tidxi, tidxj, sci, shift, fshift); diff --git a/src/gromacs/nbnxm/pairlist_simd_2xmm.h b/src/gromacs/nbnxm/pairlist_simd_2xmm.h index 6c8bc8f46d..82ad11778f 100644 --- a/src/gromacs/nbnxm/pairlist_simd_2xmm.h +++ b/src/gromacs/nbnxm/pairlist_simd_2xmm.h @@ -49,10 +49,10 @@ static constexpr int c_xStride2xNN = (GMX_SIMD_REAL_WIDTH >= 2 * c_nbnxnCpuIClus : c_nbnxnCpuIClusterSize; //! Copies PBC shifted i-cell packed atom coordinates to working array -static inline void icell_set_x_simd_2xnn(int ci, - real shx, - real shy, - real shz, +static inline void icell_set_x_simd_2xnn(int ci, + real shx, + real shy, + real shz, int gmx_unused stride, const real* x, NbnxnPairlistCpuWork* work) @@ -91,20 +91,20 @@ static inline void icell_set_x_simd_2xnn(int ci, * \param[in] rbb2 The squared cut-off for putting cluster-pairs in the list based on bounding box distance only * \param[in,out] numDistanceChecks The number of distance checks performed */ -static inline void makeClusterListSimd2xnn(const Grid& jGrid, - NbnxnPairlistCpu* nbl, - int icluster, - int firstCell, - int lastCell, - bool excludeSubDiagonal, +static inline void makeClusterListSimd2xnn(const Grid& jGrid, + NbnxnPairlistCpu* nbl, + int icluster, + int firstCell, + int lastCell, + bool excludeSubDiagonal, const real* gmx_restrict x_j, real rlist2, float rbb2, - int* gmx_restrict numDistanceChecks) + int* gmx_restrict numDistanceChecks) { using namespace gmx; - const real* gmx_restrict x_ci_simd = nbl->work->iClusterData.xSimd.data(); - const BoundingBox* gmx_restrict bb_ci = nbl->work->iClusterData.bb.data(); + const real* gmx_restrict x_ci_simd = nbl->work->iClusterData.xSimd.data(); + const BoundingBox* gmx_restrict bb_ci = nbl->work->iClusterData.bb.data(); SimdReal jx_S, jy_S, jz_S; diff --git a/src/gromacs/nbnxm/pairlist_simd_4xm.h b/src/gromacs/nbnxm/pairlist_simd_4xm.h index e2328fe49e..0b86343ce2 100644 --- a/src/gromacs/nbnxm/pairlist_simd_4xm.h +++ b/src/gromacs/nbnxm/pairlist_simd_4xm.h @@ -48,10 +48,10 @@ static constexpr int c_xStride4xN = (GMX_SIMD_REAL_WIDTH > c_nbnxnCpuIClusterSize ? GMX_SIMD_REAL_WIDTH : c_nbnxnCpuIClusterSize); //! Copies PBC shifted i-cell packed atom coordinates to working array -static inline void icell_set_x_simd_4xn(int ci, - real shx, - real shy, - real shz, +static inline void icell_set_x_simd_4xn(int ci, + real shx, + real shy, + real shz, int gmx_unused stride, const real* x, NbnxnPairlistCpuWork* work) @@ -90,20 +90,20 @@ static inline void icell_set_x_simd_4xn(int ci, * \param[in] rbb2 The squared cut-off for putting cluster-pairs in the list based on bounding box distance only * \param[in,out] numDistanceChecks The number of distance checks performed */ -static inline void makeClusterListSimd4xn(const Grid& jGrid, - NbnxnPairlistCpu* nbl, - int icluster, - int firstCell, - int lastCell, - bool excludeSubDiagonal, +static inline void makeClusterListSimd4xn(const Grid& jGrid, + NbnxnPairlistCpu* nbl, + int icluster, + int firstCell, + int lastCell, + bool excludeSubDiagonal, const real* gmx_restrict x_j, real rlist2, float rbb2, - int* gmx_restrict numDistanceChecks) + int* gmx_restrict numDistanceChecks) { using namespace gmx; - const real* gmx_restrict x_ci_simd = nbl->work->iClusterData.xSimd.data(); - const BoundingBox* gmx_restrict bb_ci = nbl->work->iClusterData.bb.data(); + const real* gmx_restrict x_ci_simd = nbl->work->iClusterData.xSimd.data(); + const BoundingBox* gmx_restrict bb_ci = nbl->work->iClusterData.bb.data(); SimdReal jx_S, jy_S, jz_S; diff --git a/src/gromacs/nbnxm/pairlist_tuning.cpp b/src/gromacs/nbnxm/pairlist_tuning.cpp index f9f61db40f..48f409254a 100644 --- a/src/gromacs/nbnxm/pairlist_tuning.cpp +++ b/src/gromacs/nbnxm/pairlist_tuning.cpp @@ -225,11 +225,10 @@ void increaseNstlist(FILE* fp, "with an appropriate message above"); const bool runningOnXeonPhi = (cpuinfo.brandString().find("Xeon Phi") != std::string::npos); - const float listfac_ok = useOrEmulateGpuForNonbondeds - ? c_nbnxnListSizeFactorGPU - : runningOnXeonPhi ? c_nbnxnListSizeFactorIntelXeonPhi - : c_nbnxnListSizeFactorCpu; - float listfac_max = listfac_ok + c_nbnxnListSizeFactorMargin; + const float listfac_ok = useOrEmulateGpuForNonbondeds ? c_nbnxnListSizeFactorGPU + : runningOnXeonPhi ? c_nbnxnListSizeFactorIntelXeonPhi + : c_nbnxnListSizeFactorCpu; + float listfac_max = listfac_ok + c_nbnxnListSizeFactorMargin; const int nstlist_orig = ir->nstlist; if (nstlist_cmdline > 0) diff --git a/src/gromacs/nbnxm/pairlistwork.h b/src/gromacs/nbnxm/pairlistwork.h index b30f37a50b..7f3d8eea7d 100644 --- a/src/gromacs/nbnxm/pairlistwork.h +++ b/src/gromacs/nbnxm/pairlistwork.h @@ -120,8 +120,7 @@ struct NbnxnPairlistGpuWork }; NbnxnPairlistGpuWork() : - distanceBuffer(c_gpuNumClusterPerCell), - sci_sort({}, { gmx::PinningPolicy::PinnedIfSupported }) + distanceBuffer(c_gpuNumClusterPerCell), sci_sort({}, { gmx::PinningPolicy::PinnedIfSupported }) { } diff --git a/src/gromacs/nbnxm/pairsearch.cpp b/src/gromacs/nbnxm/pairsearch.cpp index 546b95ff65..a336110b7a 100644 --- a/src/gromacs/nbnxm/pairsearch.cpp +++ b/src/gromacs/nbnxm/pairsearch.cpp @@ -77,10 +77,7 @@ void SearchCycleCounting::printCycles(FILE* fp, gmx::ArrayRef()), - cp1({ { 0 } }) + cp0({ { 0 } }), ndistc(0), nbl_fep(std::make_unique()), cp1({ { 0 } }) { } diff --git a/src/gromacs/nbnxm/sycl/nbnxm_sycl_kernel.cpp b/src/gromacs/nbnxm/sycl/nbnxm_sycl_kernel.cpp index a2bfe59abc..8b3b81b7f6 100644 --- a/src/gromacs/nbnxm/sycl/nbnxm_sycl_kernel.cpp +++ b/src/gromacs/nbnxm/sycl/nbnxm_sycl_kernel.cpp @@ -870,7 +870,7 @@ auto nbnxmKernel(cl::sycl::handler& cgh, fInvR += qi * qj * (pairExclMask * r2Inv - interpolateCoulombForceR( - a_coulombTab, coulombTabScale, r2 * rInv)) + a_coulombTab, coulombTabScale, r2 * rInv)) * rInv; } diff --git a/src/gromacs/onlinehelp/helpformat.cpp b/src/gromacs/onlinehelp/helpformat.cpp index 079d4cec8c..48f749080f 100644 --- a/src/gromacs/onlinehelp/helpformat.cpp +++ b/src/gromacs/onlinehelp/helpformat.cpp @@ -205,10 +205,7 @@ public: }; TextTableFormatter::Impl::Impl() : - firstColumnIndent_(0), - foldLastColumnToNextLineIndent_(-1), - bFirstRow_(true), - bPrintHeader_(false) + firstColumnIndent_(0), foldLastColumnToNextLineIndent_(-1), bFirstRow_(true), bPrintHeader_(false) { } diff --git a/src/gromacs/onlinehelp/helpwritercontext.cpp b/src/gromacs/onlinehelp/helpwritercontext.cpp index 940d0a9440..7c1e54f5f3 100644 --- a/src/gromacs/onlinehelp/helpwritercontext.cpp +++ b/src/gromacs/onlinehelp/helpwritercontext.cpp @@ -277,8 +277,7 @@ public: struct LinkItem { LinkItem(const std::string& linkName, const std::string& replacement) : - linkName(linkName), - replacement(replacement) + linkName(linkName), replacement(replacement) { } std::string linkName; @@ -343,9 +342,7 @@ public: public: //! Initializes the state with the given parameters. SharedState(TextWriter* writer, HelpOutputFormat format, const HelpLinks* links) : - file_(*writer), - format_(format), - links_(links) + file_(*writer), format_(format), links_(links) { } @@ -389,8 +386,7 @@ public: struct ReplaceItem { ReplaceItem(const std::string& search, const std::string& replace) : - search(search), - replace(replace) + search(search), replace(replace) { } std::string search; diff --git a/src/gromacs/onlinehelp/tests/mock_helptopic.cpp b/src/gromacs/onlinehelp/tests/mock_helptopic.cpp index 7ece420bdc..a41643f731 100644 --- a/src/gromacs/onlinehelp/tests/mock_helptopic.cpp +++ b/src/gromacs/onlinehelp/tests/mock_helptopic.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2014,2015,2017,2019, by the GROMACS development team, led by + * Copyright (c) 2012,2014,2015,2017,2019,2021, 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,9 +69,7 @@ MockHelpTopic& MockHelpTopic::addSubTopic(gmx::AbstractCompositeHelpTopic* paren } MockHelpTopic::MockHelpTopic(const char* name, const char* title, const char* text) : - name_(name), - title_(title), - text_(text != nullptr ? text : "") + name_(name), title_(title), text_(text != nullptr ? text : "") { if (!isNullOrEmpty(text)) { diff --git a/src/gromacs/options/abstractoption.h b/src/gromacs/options/abstractoption.h index fa34c5dae4..c64e68d78f 100644 --- a/src/gromacs/options/abstractoption.h +++ b/src/gromacs/options/abstractoption.h @@ -105,11 +105,7 @@ protected: /*! \cond libapi */ //! Initializes the name and default values for an option. explicit AbstractOption(const char* name) : - minValueCount_(1), - maxValueCount_(1), - name_(name), - descr_(nullptr), - storeIsSet_(nullptr) + minValueCount_(1), maxValueCount_(1), name_(name), descr_(nullptr), storeIsSet_(nullptr) { } diff --git a/src/gromacs/options/basicoptions.cpp b/src/gromacs/options/basicoptions.cpp index 2ced2570e4..1e0c40b752 100644 --- a/src/gromacs/options/basicoptions.cpp +++ b/src/gromacs/options/basicoptions.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -245,10 +245,7 @@ AbstractOptionStorage* Int64Option::createStorage(const OptionManagerContainer& */ DoubleOptionStorage::DoubleOptionStorage(const DoubleOption& settings) : - MyBase(settings), - info_(this), - bTime_(settings.bTime_), - factor_(1.0) + MyBase(settings), info_(this), bTime_(settings.bTime_), factor_(1.0) { } @@ -337,10 +334,7 @@ AbstractOptionStorage* DoubleOption::createStorage(const OptionManagerContainer& */ FloatOptionStorage::FloatOptionStorage(const FloatOption& settings) : - MyBase(settings), - info_(this), - bTime_(settings.bTime_), - factor_(1.0) + MyBase(settings), info_(this), bTime_(settings.bTime_), factor_(1.0) { } @@ -429,8 +423,7 @@ AbstractOptionStorage* FloatOption::createStorage(const OptionManagerContainer& */ StringOptionStorage::StringOptionStorage(const StringOption& settings) : - MyBase(settings), - info_(this) + MyBase(settings), info_(this) { if (settings.defaultEnumIndex_ >= 0 && settings.enumValues_ == nullptr) { @@ -539,8 +532,7 @@ EnumOptionStorage::EnumOptionStorage(const AbstractOption& settings, int defaultValue, int defaultValueIfSet, StorePointer store) : - MyBase(settings, std::move(store)), - info_(this) + MyBase(settings, std::move(store)), info_(this) { if (enumValues == nullptr) { diff --git a/src/gromacs/options/basicoptions.h b/src/gromacs/options/basicoptions.h index d432055b26..20b34479ed 100644 --- a/src/gromacs/options/basicoptions.h +++ b/src/gromacs/options/basicoptions.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -313,10 +313,7 @@ public: //! Initializes an option with the given name. explicit StringOption(const char* name) : - MyBase(name), - enumValues_(nullptr), - enumValuesCount_(0), - defaultEnumIndex_(-1) + MyBase(name), enumValues_(nullptr), enumValuesCount_(0), defaultEnumIndex_(-1) { } @@ -407,8 +404,7 @@ class EnumIndexStore : public IOptionValueStore public: //! Initializes the storage for the given actual enum variables. EnumIndexStore(EnumType* store, std::vector* storeVector) : - store_(store), - storeVector_(storeVector) + store_(store), storeVector_(storeVector) { if (storeVector_ != nullptr) { @@ -621,9 +617,7 @@ public: //! Initializes an option with the given name. explicit LegacyEnumOption(const char* name) : - MyBase(name), - enumValues_(nullptr), - enumValuesCount_(0) + MyBase(name), enumValues_(nullptr), enumValuesCount_(0) { } diff --git a/src/gromacs/options/filenameoption.cpp b/src/gromacs/options/filenameoption.cpp index 41aea4bf50..0c755aeced 100644 --- a/src/gromacs/options/filenameoption.cpp +++ b/src/gromacs/options/filenameoption.cpp @@ -136,9 +136,7 @@ private: }; FileTypeHandler::FileTypeHandler(int fileType) : - fileType_(fileType), - extensionCount_(0), - genericTypes_(nullptr) + fileType_(fileType), extensionCount_(0), genericTypes_(nullptr) { if (fileType_ >= 0) { diff --git a/src/gromacs/options/optionstoragetemplate.h b/src/gromacs/options/optionstoragetemplate.h index 0ec97a877c..e8445fd108 100644 --- a/src/gromacs/options/optionstoragetemplate.h +++ b/src/gromacs/options/optionstoragetemplate.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -310,15 +310,13 @@ protected: template explicit OptionStorageTemplateSimple(const OptionTemplate& settings, OptionFlags staticFlags = OptionFlags()) : - OptionStorageTemplate(settings, staticFlags), - initialized_(false) + OptionStorageTemplate(settings, staticFlags), initialized_(false) { } //! Initializes the storage. OptionStorageTemplateSimple(const AbstractOption& settings, typename OptionStorageTemplate::StorePointer store) : - OptionStorageTemplate(settings, std::move(store)), - initialized_(false) + OptionStorageTemplate(settings, std::move(store)), initialized_(false) { } @@ -416,8 +414,7 @@ OptionStorageTemplate::OptionStorageTemplate(const OptionTemplate& sett template OptionStorageTemplate::OptionStorageTemplate(const AbstractOption& settings, StorePointer store) : - AbstractOptionStorage(settings, OptionFlags()), - store_(std::move(store)) + AbstractOptionStorage(settings, OptionFlags()), store_(std::move(store)) { } diff --git a/src/gromacs/options/repeatingsection.h b/src/gromacs/options/repeatingsection.h index 1521ea2b6c..8325859b37 100644 --- a/src/gromacs/options/repeatingsection.h +++ b/src/gromacs/options/repeatingsection.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2021, 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. @@ -81,8 +81,7 @@ public: //! Creates a section with the given name. explicit RepeatingOptionSection(const char* name) : - AbstractOptionSection(name), - values_(nullptr) + AbstractOptionSection(name), values_(nullptr) { } @@ -114,8 +113,7 @@ class RepeatingOptionSectionStorage : public IOptionSectionStorage public: //! Initializes the storage for given section properties. explicit RepeatingOptionSectionStorage(const RepeatingOptionSection& section) : - store_(new OptionValueStoreVector(section.values_)), - currentData_() + store_(new OptionValueStoreVector(section.values_)), currentData_() { } diff --git a/src/gromacs/options/treesupport.cpp b/src/gromacs/options/treesupport.cpp index d43ad7d789..d8164a11ff 100644 --- a/src/gromacs/options/treesupport.cpp +++ b/src/gromacs/options/treesupport.cpp @@ -67,8 +67,7 @@ class TreeAssignHelper { public: TreeAssignHelper(Options* options, IKeyValueTreeErrorHandler* errorHandler) : - assigner_(options), - errorHandler_(errorHandler) + assigner_(options), errorHandler_(errorHandler) { if (errorHandler_ == nullptr) { @@ -151,8 +150,7 @@ class TreeCheckHelper : private OptionsVisitor { public: TreeCheckHelper(const KeyValueTreeObject& root) : - currentObject_(&root), - currentKnownNames_(nullptr) + currentObject_(&root), currentKnownNames_(nullptr) { } @@ -214,8 +212,7 @@ class TreeAdjustHelper : private OptionsVisitor { public: TreeAdjustHelper(const KeyValueTreeObject& root, KeyValueTreeBuilder* builder) : - currentSourceObject_(&root), - currentObjectBuilder_(builder->rootObject()) + currentSourceObject_(&root), currentObjectBuilder_(builder->rootObject()) { } diff --git a/src/gromacs/options/valuestore.h b/src/gromacs/options/valuestore.h index 1352f63e09..b014f63295 100644 --- a/src/gromacs/options/valuestore.h +++ b/src/gromacs/options/valuestore.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2021, 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. @@ -56,9 +56,7 @@ class OptionValueStorePlain : public IOptionValueStore { public: OptionValueStorePlain(T* store, int* storeCount, int initialCount) : - count_(initialCount), - store_(store), - storeCount_(storeCount) + count_(initialCount), store_(store), storeCount_(storeCount) { } diff --git a/src/gromacs/pbcutil/pbc_aiuc_cuda.cuh b/src/gromacs/pbcutil/pbc_aiuc_cuda.cuh index 4911850f4f..a2784a6d16 100644 --- a/src/gromacs/pbcutil/pbc_aiuc_cuda.cuh +++ b/src/gromacs/pbcutil/pbc_aiuc_cuda.cuh @@ -94,7 +94,7 @@ static inline __device__ int int3ToShiftIndex(int3 iv) */ template static __forceinline__ __device__ int - pbcDxAiuc(const PbcAiuc& pbcAiuc, const float4 r1, const float4 r2, float3& dr) +pbcDxAiuc(const PbcAiuc& pbcAiuc, const float4 r1, const float4 r2, float3& dr) { dr.x = r1.x - r2.x; dr.y = r1.y - r2.y; diff --git a/src/gromacs/pbcutil/tests/com.cpp b/src/gromacs/pbcutil/tests/com.cpp index 7442b01326..b1cbe034f1 100644 --- a/src/gromacs/pbcutil/tests/com.cpp +++ b/src/gromacs/pbcutil/tests/com.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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. @@ -144,8 +144,7 @@ private: }; COMInPlaceTest::COMInPlaceTest() : - testCoordinates_(initialCoordinates()), - checker_(data_.rootChecker()) + testCoordinates_(initialCoordinates()), checker_(data_.rootChecker()) { auto& moltype = testTopology_.moltype.emplace_back(); populateMoleculeType(&moltype); diff --git a/src/gromacs/pulling/pull.cpp b/src/gromacs/pulling/pull.cpp index e40cecf28c..2369e5acee 100644 --- a/src/gromacs/pulling/pull.cpp +++ b/src/gromacs/pulling/pull.cpp @@ -264,8 +264,8 @@ static void apply_forces_cyl_grp(const pull_group_work_t& pgrp, /* The cylinder group is always a slab in the system, thus large. * Therefore we always thread-parallelize this group. */ - const int numAtomsLocal = localAtomIndices.size(); - const int gmx_unused numThreads = pgrp.numThreads(); + const int numAtomsLocal = localAtomIndices.size(); + const int gmx_unused numThreads = pgrp.numThreads(); #pragma omp parallel for num_threads(numThreads) schedule(static) for (int i = 0; i < numAtomsLocal; i++) { diff --git a/src/gromacs/pulling/pull_internal.h b/src/gromacs/pulling/pull_internal.h index 749d70379c..6bffa018d0 100644 --- a/src/gromacs/pulling/pull_internal.h +++ b/src/gromacs/pulling/pull_internal.h @@ -219,7 +219,7 @@ struct pull_comm_t #if GMX_MPI MPI_Comm mpi_comm_com; /* Communicator for pulling */ #endif - int nparticipate; /* The number of ranks participating */ + int nparticipate; /* The number of ranks participating */ bool isMasterRank; /* Tells whether our rank is the master rank and thus should add the pull virial */ int64_t setup_count; /* The number of decomposition calls */ diff --git a/src/gromacs/pulling/pull_rotation.cpp b/src/gromacs/pulling/pull_rotation.cpp index f4e0ba526a..325c3f65b9 100644 --- a/src/gromacs/pulling/pull_rotation.cpp +++ b/src/gromacs/pulling/pull_rotation.cpp @@ -2479,7 +2479,7 @@ static real do_flex_lowlevel(gmx_enfrotgrp* erg, return V; } -static void sort_collective_coordinates(gmx_enfrotgrp* erg, +static void sort_collective_coordinates(gmx_enfrotgrp* erg, sort_along_vec_t* data) /* Buffer for sorting the positions */ { /* The projection of the position vector on the rotation vector is diff --git a/src/gromacs/random/gammadistribution.h b/src/gromacs/random/gammadistribution.h index 0b23b04c79..276fd4cf20 100644 --- a/src/gromacs/random/gammadistribution.h +++ b/src/gromacs/random/gammadistribution.h @@ -141,8 +141,7 @@ public: * \param beta Second parameter of gamma distribution */ explicit param_type(result_type alpha = 1.0, result_type beta = 1.0) : - alpha_(alpha), - beta_(beta) + alpha_(alpha), beta_(beta) { } diff --git a/src/gromacs/random/normaldistribution.h b/src/gromacs/random/normaldistribution.h index 4380758705..0925bf2689 100644 --- a/src/gromacs/random/normaldistribution.h +++ b/src/gromacs/random/normaldistribution.h @@ -126,8 +126,7 @@ public: * \param stddev Standard deviation of normal distribution */ explicit param_type(result_type mean = 0.0, result_type stddev = 1.0) : - mean_(mean), - stddev_(stddev) + mean_(mean), stddev_(stddev) { } @@ -158,9 +157,7 @@ public: * \param stddev Standard deviation of normal distribution */ explicit NormalDistribution(result_type mean = 0.0, result_type stddev = 1.0) : - param_(param_type(mean, stddev)), - hot_(false), - saved_(0) + param_(param_type(mean, stddev)), hot_(false), saved_(0) { } diff --git a/src/gromacs/random/tabulatednormaldistribution.h b/src/gromacs/random/tabulatednormaldistribution.h index 1664c286ca..fa69e62836 100644 --- a/src/gromacs/random/tabulatednormaldistribution.h +++ b/src/gromacs/random/tabulatednormaldistribution.h @@ -129,8 +129,7 @@ public: * */ explicit param_type(result_type mean = 0.0, result_type stddev = 1.0) : - mean_(mean), - stddev_(stddev) + mean_(mean), stddev_(stddev) { } @@ -219,9 +218,7 @@ public: * \param stddev Standard deviation of tabulated normal distribution */ explicit TabulatedNormalDistribution(result_type mean = 0.0, result_type stddev = 1.0) : - param_(param_type(mean, stddev)), - savedRandomBits_(0), - savedRandomBitsLeft_(0) + param_(param_type(mean, stddev)), savedRandomBits_(0), savedRandomBitsLeft_(0) { } @@ -230,9 +227,7 @@ public: * \param param Parameter class containing mean and standard deviation. */ explicit TabulatedNormalDistribution(const param_type& param) : - param_(param), - savedRandomBits_(0), - savedRandomBitsLeft_(0) + param_(param), savedRandomBits_(0), savedRandomBitsLeft_(0) { } diff --git a/src/gromacs/random/uniformintdistribution.h b/src/gromacs/random/uniformintdistribution.h index 2e2b4835ea..ded231121f 100644 --- a/src/gromacs/random/uniformintdistribution.h +++ b/src/gromacs/random/uniformintdistribution.h @@ -94,8 +94,7 @@ public: * \param b Upper end of range (inclusive) */ explicit param_type(result_type a = 0, result_type b = std::numeric_limits::max()) : - a_(a), - b_(b) + a_(a), b_(b) { GMX_RELEASE_ASSERT(a <= b, "The uniform integer distribution requires a<=b"); } @@ -129,9 +128,7 @@ public: */ explicit UniformIntDistribution(result_type a = 0, result_type b = std::numeric_limits::max()) : - param_(param_type(a, b)), - savedRandomBits_(0), - savedRandomBitsLeft_(0) + param_(param_type(a, b)), savedRandomBits_(0), savedRandomBitsLeft_(0) { } @@ -140,9 +137,7 @@ public: * \param param Parameter class as defined inside gmx::UniformIntDistribution. */ explicit UniformIntDistribution(const param_type& param) : - param_(param), - savedRandomBits_(0), - savedRandomBitsLeft_(0) + param_(param), savedRandomBits_(0), savedRandomBitsLeft_(0) { } diff --git a/src/gromacs/restraint/tests/manager.cpp b/src/gromacs/restraint/tests/manager.cpp index 1596a25be0..04b2c45c75 100644 --- a/src/gromacs/restraint/tests/manager.cpp +++ b/src/gromacs/restraint/tests/manager.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2021, 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. @@ -49,7 +49,7 @@ public: gmx::PotentialPointData evaluate(gmx::Vector gmx_unused r1, gmx::Vector gmx_unused r2, - double gmx_unused t) override + double gmx_unused t) override { return {}; } diff --git a/src/gromacs/selection/nbsearch.cpp b/src/gromacs/selection/nbsearch.cpp index 693b4e020e..37b2c8cf59 100644 --- a/src/gromacs/selection/nbsearch.cpp +++ b/src/gromacs/selection/nbsearch.cpp @@ -1203,9 +1203,7 @@ public: */ MindistAction(int* closestPoint, real* minDist2, rvec* dx) // NOLINT(readability-non-const-parameter) : - closestPoint_(*closestPoint), - minDist2_(*minDist2), - dx_(*dx) + closestPoint_(*closestPoint), minDist2_(*minDist2), dx_(*dx) { } //! Copies the action. diff --git a/src/gromacs/selection/nbsearch.h b/src/gromacs/selection/nbsearch.h index 5a445784b7..9fb86b6b33 100644 --- a/src/gromacs/selection/nbsearch.h +++ b/src/gromacs/selection/nbsearch.h @@ -111,33 +111,21 @@ public: * to methods that accept positions. */ AnalysisNeighborhoodPositions(const rvec& x) : - count_(1), - index_(-1), - x_(&x), - exclusionIds_(nullptr), - indices_(nullptr) + count_(1), index_(-1), x_(&x), exclusionIds_(nullptr), indices_(nullptr) { } /*! \brief * Initializes positions from an array of position vectors. */ AnalysisNeighborhoodPositions(const rvec x[], int count) : - count_(count), - index_(-1), - x_(x), - exclusionIds_(nullptr), - indices_(nullptr) + count_(count), index_(-1), x_(x), exclusionIds_(nullptr), indices_(nullptr) { } /*! \brief * Initializes positions from a vector of position vectors. */ AnalysisNeighborhoodPositions(const std::vector& x) : - count_(ssize(x)), - index_(-1), - x_(as_rvec_array(x.data())), - exclusionIds_(nullptr), - indices_(nullptr) + count_(ssize(x)), index_(-1), x_(as_rvec_array(x.data())), exclusionIds_(nullptr), indices_(nullptr) { } @@ -335,10 +323,7 @@ public: AnalysisNeighborhoodPair() : refIndex_(-1), testIndex_(0), distance2_(0.0), dx_() {} //! Initializes a pair object with the given data. AnalysisNeighborhoodPair(int refIndex, int testIndex, real distance2, const rvec dx) : - refIndex_(refIndex), - testIndex_(testIndex), - distance2_(distance2), - dx_() + refIndex_(refIndex), testIndex_(testIndex), distance2_(distance2), dx_() { copy_rvec(dx, dx_); } diff --git a/src/gromacs/selection/parsetree.cpp b/src/gromacs/selection/parsetree.cpp index 9f78139847..421e16f319 100644 --- a/src/gromacs/selection/parsetree.cpp +++ b/src/gromacs/selection/parsetree.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team. * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -330,16 +330,13 @@ namespace gmx */ SelectionParserValue::SelectionParserValue(e_selvalue_t type, const SelectionLocation& location) : - type(type), - location_(location) + type(type), location_(location) { memset(&u, 0, sizeof(u)); } SelectionParserValue::SelectionParserValue(const SelectionTreeElementPointer& expr) : - type(expr->v.type), - expr(expr), - location_(expr->location()) + type(expr->v.type), expr(expr), location_(expr->location()) { memset(&u, 0, sizeof(u)); } diff --git a/src/gromacs/selection/parsetree.h b/src/gromacs/selection/parsetree.h index d65ac8885d..7c46ea0009 100644 --- a/src/gromacs/selection/parsetree.h +++ b/src/gromacs/selection/parsetree.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2009-2018, The GROMACS development team. - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -237,7 +237,8 @@ public: //! String value for \a type ::STR_VALUE. std::string str; //! The actual value if \a expr is NULL and \a type is not ::STR_VALUE. - union { + union + { //! The integer value/range (\a type ::INT_VALUE). struct { @@ -295,9 +296,7 @@ public: // Default move constructor and assignment. Only needed for old compilers. //! \cond SelectionParserParameter(SelectionParserParameter&& o) noexcept : - name_(std::move(o.name_)), - location_(o.location_), - values_(std::move(o.values_)) + name_(std::move(o.name_)), location_(o.location_), values_(std::move(o.values_)) { } diff --git a/src/gromacs/selection/poscalc.cpp b/src/gromacs/selection/poscalc.cpp index 4e59956084..f64be4c2eb 100644 --- a/src/gromacs/selection/poscalc.cpp +++ b/src/gromacs/selection/poscalc.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team. * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -361,10 +361,7 @@ PositionCalculationCollection::requiredTopologyInfoForType(const char* post, boo */ PositionCalculationCollection::Impl::Impl() : - top_(nullptr), - first_(nullptr), - last_(nullptr), - bInit_(false) + top_(nullptr), first_(nullptr), last_(nullptr), bInit_(false) { } diff --git a/src/gromacs/selection/selectioncollection.cpp b/src/gromacs/selection/selectioncollection.cpp index ed13f9c69f..1baaa46985 100644 --- a/src/gromacs/selection/selectioncollection.cpp +++ b/src/gromacs/selection/selectioncollection.cpp @@ -85,9 +85,7 @@ namespace gmx */ SelectionCollection::Impl::Impl() : - debugLevel_(DebugLevel::None), - bExternalGroupsSet_(false), - grps_(nullptr) + debugLevel_(DebugLevel::None), bExternalGroupsSet_(false), grps_(nullptr) { sc_.nvars = 0; sc_.varstrs = nullptr; diff --git a/src/gromacs/selection/selectionenums.h b/src/gromacs/selection/selectionenums.h index 8ae77c809b..039423c7e8 100644 --- a/src/gromacs/selection/selectionenums.h +++ b/src/gromacs/selection/selectionenums.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2012,2013,2014,2015 by the GROMACS development team. - * Copyright (c) 2016,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2020,2021, 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. @@ -107,8 +107,7 @@ struct SelectionTopologyProperties SelectionTopologyProperties() : needsTopology(false), needsMasses(false) {} //! Initializes properties with the given flags. SelectionTopologyProperties(bool needsTopology, bool needsMasses) : - needsTopology(needsTopology), - needsMasses(needsMasses) + needsTopology(needsTopology), needsMasses(needsMasses) { } diff --git a/src/gromacs/selection/selectionoption.h b/src/gromacs/selection/selectionoption.h index a69b0ba1b1..c213d8e650 100644 --- a/src/gromacs/selection/selectionoption.h +++ b/src/gromacs/selection/selectionoption.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2011,2012,2013,2014 by the GROMACS development team. - * Copyright (c) 2015,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2018,2019,2020,2021, 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. @@ -84,9 +84,7 @@ public: //! Initializes an option with the given name. explicit SelectionOption(const char* name) : - MyBase(name), - defaultText_(""), - selectionFlags_(efSelection_DisallowEmpty) + MyBase(name), defaultText_(""), selectionFlags_(efSelection_DisallowEmpty) { } diff --git a/src/gromacs/selection/selectionoptionbehavior.cpp b/src/gromacs/selection/selectionoptionbehavior.cpp index 3da677e2b1..e45fb468c5 100644 --- a/src/gromacs/selection/selectionoptionbehavior.cpp +++ b/src/gromacs/selection/selectionoptionbehavior.cpp @@ -76,10 +76,7 @@ class SelectionOptionBehavior::Impl { public: Impl(SelectionCollection* selections, ITopologyProvider* topologyProvider) : - selections_(*selections), - topologyProvider_(*topologyProvider), - manager_(selections), - grps_(nullptr) + selections_(*selections), topologyProvider_(*topologyProvider), manager_(selections), grps_(nullptr) { } ~Impl() diff --git a/src/gromacs/selection/selelem.h b/src/gromacs/selection/selelem.h index b53bfca870..dfaeca25fa 100644 --- a/src/gromacs/selection/selelem.h +++ b/src/gromacs/selection/selelem.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2009-2017, The GROMACS development team. - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -426,7 +426,8 @@ public: */ int flags; //! Data required by the evaluation function. - union { + union + { /*! \brief Index group data for several element types. * * - \ref SEL_CONST : if the value type is \ref GROUP_VALUE, diff --git a/src/gromacs/selection/selhelp.cpp b/src/gromacs/selection/selhelp.cpp index 9e6362b579..69d93c3717 100644 --- a/src/gromacs/selection/selhelp.cpp +++ b/src/gromacs/selection/selhelp.cpp @@ -541,8 +541,7 @@ class KeywordDetailsHelpTopic : public AbstractSimpleHelpTopic public: //! Initialize help topic for the given selection method. KeywordDetailsHelpTopic(const std::string& name, const gmx_ana_selmethod_t& method) : - name_(name), - method_(method) + name_(name), method_(method) { } diff --git a/src/gromacs/selection/selmethod.h b/src/gromacs/selection/selmethod.h index 8836db6411..669f49c791 100644 --- a/src/gromacs/selection/selmethod.h +++ b/src/gromacs/selection/selmethod.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2009-2016, The GROMACS development team. - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2021, 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. @@ -330,9 +330,7 @@ struct SelMethodEvalContext { //! Initializes the context with given values. SelMethodEvalContext(const gmx_mtop_t* top, t_trxframe* fr, const t_pbc* pbc) : - top(top), - fr(fr), - pbc(pbc) + top(top), fr(fr), pbc(pbc) { } diff --git a/src/gromacs/selection/selvalue.h b/src/gromacs/selection/selvalue.h index 08872a29a9..d2a51c7d5e 100644 --- a/src/gromacs/selection/selvalue.h +++ b/src/gromacs/selection/selvalue.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2009,2010,2011,2014,2019, by the GROMACS development team, led by + * Copyright (c) 2009,2010,2011,2014,2019,2021, 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. @@ -79,7 +79,8 @@ typedef struct gmx_ana_selvalue_t */ int nr; /** Pointer to the value. */ - union { + union + { /*! \brief * Generic pointer for operations that do not need type information. * diff --git a/src/gromacs/selection/sm_same.cpp b/src/gromacs/selection/sm_same.cpp index abcd1745cd..ac3bc7f41b 100644 --- a/src/gromacs/selection/sm_same.cpp +++ b/src/gromacs/selection/sm_same.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2009,2010,2011,2012,2013 by the GROMACS development team. * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -68,7 +68,8 @@ typedef struct { /** Value for each atom to match. */ - union { + union + { int* i; char** s; void* ptr; @@ -81,7 +82,8 @@ typedef struct */ int nas; /** Values to match against. */ - union { + union + { int* i; char** s; void* ptr; diff --git a/src/gromacs/selection/tests/nbsearch.cpp b/src/gromacs/selection/tests/nbsearch.cpp index 4601e45fd5..fcc084b2dc 100644 --- a/src/gromacs/selection/tests/nbsearch.cpp +++ b/src/gromacs/selection/tests/nbsearch.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -85,11 +85,7 @@ public: struct RefPair { RefPair(int refIndex, real distance) : - refIndex(refIndex), - distance(distance), - bFound(false), - bExcluded(false), - bIndexed(true) + refIndex(refIndex), distance(distance), bFound(false), bExcluded(false), bIndexed(true) { } @@ -194,9 +190,7 @@ private: typedef std::vector RefPairList; NeighborhoodSearchTestData::NeighborhoodSearchTestData(uint64_t seed, real cutoff) : - rng_(seed), - cutoff_(cutoff), - refPosCount_(0) + rng_(seed), cutoff_(cutoff), refPosCount_(0) { clear_mat(box_); set_pbc(&pbc_, PbcType::No, box_); @@ -354,8 +348,7 @@ void ExclusionsHelper::markExcludedPairs(RefPairList* refPairs, int testIndex, c } ExclusionsHelper::ExclusionsHelper(int refPosCount, int testPosCount) : - refPosCount_(refPosCount), - testPosCount_(testPosCount) + refPosCount_(refPosCount), testPosCount_(testPosCount) { // Generate an array of 0, 1, 2, ... // TODO: Make the tests work also with non-trivial exclusion IDs, diff --git a/src/gromacs/selection/tests/poscalc.cpp b/src/gromacs/selection/tests/poscalc.cpp index f4f2fcafe3..8a558f89b0 100644 --- a/src/gromacs/selection/tests/poscalc.cpp +++ b/src/gromacs/selection/tests/poscalc.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -110,9 +110,7 @@ private: struct PositionTest { PositionTest(PositionPointer pos, gmx_ana_poscalc_t* pc, const char* name) : - pos(std::move(pos)), - pc(pc), - name(name) + pos(std::move(pos)), pc(pc), name(name) { } diff --git a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_float.h b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_float.h index 90ab9ef5a4..aaaf80f8d4 100644 --- a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_float.h +++ b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_float.h @@ -303,7 +303,7 @@ static inline SimdFloat gmx_simdcall frexp(SimdFloat value, SimdFInt32* exponent const int32x4_t exponentMask = vdupq_n_s32(0x7F800000); const int32x4_t mantissaMask = vdupq_n_s32(0x807FFFFF); const int32x4_t exponentBias = vdupq_n_s32(126); // add 1 to make our definition identical to frexp() - const float32x4_t half = vdupq_n_f32(0.5F); + const float32x4_t half = vdupq_n_f32(0.5F); int32x4_t iExponent; iExponent = vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), exponentMask); diff --git a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_double.h b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_double.h index a3d7454c87..3e4363517b 100644 --- a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_double.h +++ b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2018,2019,2021, 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. @@ -75,7 +75,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) { float64x2_t t1, t2; @@ -133,7 +133,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { float64x2_t t0, t1, t2; float64x1_t t3; @@ -162,7 +162,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { float64x2_t t0, t1, t2; float64x1_t t3; @@ -219,7 +219,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_DINT32_WIDTH]; @@ -232,7 +232,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_DINT32_WIDTH]; @@ -248,7 +248,7 @@ static inline void gmx_simdcall static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { float64x2_t t1, t2, t3, t4; diff --git a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_float.h b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_float.h index 25bd43b071..34815ccb3a 100644 --- a/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_float.h +++ b/src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_float.h @@ -78,7 +78,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) { assert(std::size_t(offset) % 16 == 0); assert(std::size_t(base) % 8 == 0); @@ -120,7 +120,7 @@ static inline void gmx_simdcall gatherLoadUTranspose(const float* base, template static inline void gmx_simdcall - transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { assert(std::size_t(offset) % 16 == 0); @@ -140,7 +140,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { assert(std::size_t(offset) % 16 == 0); @@ -191,7 +191,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { assert(std::size_t(offset) % 16 == 0); @@ -281,7 +281,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_FINT32_WIDTH]; @@ -292,7 +292,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_FINT32_WIDTH]; diff --git a/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h b/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h index 2945ea66a0..4af421f27b 100644 --- a/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h +++ b/src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2020 Research Organization for Information Science and Technology (RIST). - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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. @@ -386,7 +386,7 @@ static inline SimdFloat gmx_simdcall frexp(SimdFloat value, SimdFInt32* exponent const svint32_t exponentMask = svdup_n_s32(0x7F800000); const svint32_t mantissaMask = svdup_n_s32(0x807FFFFF); const svint32_t exponentBias = svdup_n_s32(126); // add 1 to make our definition identical to frexp() - const svfloat32_t half = svdup_n_f32(0.5f); + const svfloat32_t half = svdup_n_f32(0.5f); svint32_t iExponent; iExponent = svand_s32_x(pg, svreinterpret_s32_f32(value.simdInternal_), exponentMask); diff --git a/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_double.h b/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_double.h index d3d054c97d..d7c839303e 100644 --- a/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_double.h +++ b/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_double.h @@ -104,7 +104,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { // Base pointer must be aligned to the smaller of 2 elements and float SIMD width assert(std::size_t(base) % 8 == 0); @@ -121,7 +121,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) { assert(std::size_t(offset) % 64 == 0); assert(std::size_t(base) % 8 == 0); @@ -183,7 +183,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { assert(std::size_t(offset) % 32 == 0); @@ -214,7 +214,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { assert(std::size_t(offset) % 16 == 0); @@ -284,7 +284,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { svbool_t pg = svptrue_b64(); svint64_t offsets = svmul_n_s64_x(pg, offset.simdInternal_, align * sizeof(double)); @@ -294,7 +294,7 @@ static inline void gmx_simdcall } static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { assert(std::size_t(m) % 16 == 0); svbool_t pg = svptrue_b64(); diff --git a/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_float.h b/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_float.h index fc9fe74171..126e27b7b2 100644 --- a/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_float.h +++ b/src/gromacs/simd/impl_arm_sve/impl_arm_sve_util_float.h @@ -65,7 +65,7 @@ namespace gmx template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { // Base pointer must be aligned to the smaller of 2 elements and float SIMD width assert(std::size_t(base) % 8 == 0); @@ -123,7 +123,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) { assert(std::size_t(offset) % 64 == 0); assert(std::size_t(base) % 8 == 0); @@ -159,7 +159,7 @@ static inline void gmx_simdcall gatherLoadUTranspose(const float* base, template static inline void gmx_simdcall - transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { assert(std::size_t(offset) % 16 == 0); @@ -176,7 +176,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { assert(std::size_t(offset) % 64 == 0); @@ -197,7 +197,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { assert(std::size_t(offset) % 16 == 0); @@ -262,7 +262,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { svbool_t pg = svptrue_b32(); svint32_t offsets = svmul_n_s32_x(pg, offset.simdInternal_, align * 4); diff --git a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_double.h b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_double.h index a84317a3ed..fda07d674e 100644 --- a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_double.h +++ b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_double.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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 @@ static inline void gmx_simdcall gatherLoadTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) { __vector double t1, t2; @@ -101,10 +101,10 @@ static inline void gmx_simdcall gatherLoadUTranspose(const double* base, // gcc-4.9 fails to recognize that the argument to vec_extract() is used template -static inline void gmx_simdcall transposeScatterStoreU(double* base, - const std::int32_t offset[], - SimdDouble v0, - SimdDouble v1, +static inline void gmx_simdcall transposeScatterStoreU(double* base, + const std::int32_t offset[], + SimdDouble v0, + SimdDouble v1, SimdDouble gmx_unused v2) { SimdDouble t1, t2; @@ -120,7 +120,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { if (align % 4 == 0) { @@ -168,7 +168,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { if (align % 4 == 0) { @@ -240,7 +240,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_DINT32_WIDTH]; @@ -251,7 +251,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_DINT32_WIDTH]; @@ -264,7 +264,7 @@ static inline void gmx_simdcall } static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { __vector double t1, t2, t3, t4; diff --git a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h index da57a8ae66..17a5688d8d 100644 --- a/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h +++ b/src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -74,7 +74,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) { __vector float t0, t1, t2, t3; @@ -141,10 +141,10 @@ static inline void gmx_simdcall gatherLoadUTranspose(const float* base, // gcc-4.9 does not recognize that the argument to vec_extract() is used template -static inline void gmx_simdcall transposeScatterStoreU(float* base, - const std::int32_t offset[], - SimdFloat v0, - SimdFloat v1, +static inline void gmx_simdcall transposeScatterStoreU(float* base, + const std::int32_t offset[], + SimdFloat v0, + SimdFloat v1, SimdFloat gmx_unused v2) { __vector float t1, t2; @@ -167,7 +167,7 @@ static inline void gmx_simdcall transposeScatterStoreU(float* base, template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { if (align < 4) { @@ -242,7 +242,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { if (align < 4) { @@ -355,7 +355,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_FINT32_WIDTH]; @@ -365,7 +365,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t ioffset[GMX_SIMD_FINT32_WIDTH]; diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h b/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h index 6511c96b5d..e1f92051cc 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd4_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019,2021, 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. @@ -200,7 +200,8 @@ static inline Simd4Double gmx_simdcall operator&(Simd4Double a, Simd4Double b) { Simd4Double res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -228,7 +229,8 @@ static inline Simd4Double gmx_simdcall andNot(Simd4Double a, Simd4Double b) { Simd4Double res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -256,7 +258,8 @@ static inline Simd4Double gmx_simdcall operator|(Simd4Double a, Simd4Double b) { Simd4Double res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -283,7 +286,8 @@ static inline Simd4Double gmx_simdcall operator^(Simd4Double a, Simd4Double b) { Simd4Double res; - union { + union + { double r; std::int64_t i; } conv1, conv2; diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h b/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h index 81f81d2d83..bd6d240e3f 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd4_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019,2021, 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. @@ -200,7 +200,8 @@ static inline Simd4Float gmx_simdcall operator&(Simd4Float a, Simd4Float b) { Simd4Float res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -228,7 +229,8 @@ static inline Simd4Float gmx_simdcall andNot(Simd4Float a, Simd4Float b) { Simd4Float res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -256,7 +258,8 @@ static inline Simd4Float gmx_simdcall operator|(Simd4Float a, Simd4Float b) { Simd4Float res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -283,7 +286,8 @@ static inline Simd4Float gmx_simdcall operator^(Simd4Float a, Simd4Float b) { Simd4Float res; - union { + union + { float r; std::int32_t i; } conv1, conv2; diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd_double.h b/src/gromacs/simd/impl_reference/impl_reference_simd_double.h index 6640eb82f2..a2377f808c 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd_double.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2019,2020,2021, 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. @@ -364,7 +364,8 @@ static inline SimdDouble gmx_simdcall operator&(SimdDouble a, SimdDouble b) { SimdDouble res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -391,7 +392,8 @@ static inline SimdDouble gmx_simdcall andNot(SimdDouble a, SimdDouble b) { SimdDouble res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -418,7 +420,8 @@ static inline SimdDouble gmx_simdcall operator|(SimdDouble a, SimdDouble b) { SimdDouble res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -445,7 +448,8 @@ static inline SimdDouble gmx_simdcall operator^(SimdDouble a, SimdDouble b) { SimdDouble res; - union { + union + { double r; std::int64_t i; } conv1, conv2; @@ -975,7 +979,8 @@ static inline SimdDBool gmx_simdcall testBits(SimdDouble a) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - union { + union + { std::uint64_t i; double d; } conv; diff --git a/src/gromacs/simd/impl_reference/impl_reference_simd_float.h b/src/gromacs/simd/impl_reference/impl_reference_simd_float.h index aa740c7fec..4e05599007 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_simd_float.h +++ b/src/gromacs/simd/impl_reference/impl_reference_simd_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2019,2020,2021, 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. @@ -363,7 +363,8 @@ static inline SimdFloat gmx_simdcall operator&(SimdFloat a, SimdFloat b) { SimdFloat res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -390,7 +391,8 @@ static inline SimdFloat gmx_simdcall andNot(SimdFloat a, SimdFloat b) { SimdFloat res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -417,7 +419,8 @@ static inline SimdFloat gmx_simdcall operator|(SimdFloat a, SimdFloat b) { SimdFloat res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -444,7 +447,8 @@ static inline SimdFloat gmx_simdcall operator^(SimdFloat a, SimdFloat b) { SimdFloat res; - union { + union + { float r; std::int32_t i; } conv1, conv2; @@ -968,7 +972,8 @@ static inline SimdFBool gmx_simdcall testBits(SimdFloat a) for (std::size_t i = 0; i < res.simdInternal_.size(); i++) { - union { + union + { std::uint32_t i; float f; } conv; diff --git a/src/gromacs/simd/impl_reference/impl_reference_util_double.h b/src/gromacs/simd/impl_reference/impl_reference_util_double.h index 7c051f7e1c..777af5ba1a 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_util_double.h +++ b/src/gromacs/simd/impl_reference/impl_reference_util_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2019,2020,2021, 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. @@ -150,7 +150,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const double* base, */ template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) { // Offset list must be aligned for SIMD DINT32 assert(std::size_t(offset) % (GMX_SIMD_DINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -326,7 +326,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, */ template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { // Offset list must be aligned for SIMD DINT32 assert(std::size_t(offset) % (GMX_SIMD_DINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -381,7 +381,7 @@ static inline void gmx_simdcall */ template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { // Offset list must be aligned for SIMD DINT32 assert(std::size_t(offset) % (GMX_SIMD_DINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -504,7 +504,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const double* base, */ template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { for (std::size_t i = 0; i < v0->simdInternal_.size(); i++) { @@ -539,7 +539,7 @@ static inline void gmx_simdcall */ template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { // Base pointer must be aligned to the smaller of 2 elements and double SIMD width assert(std::size_t(base) % (std::min(GMX_SIMD_DOUBLE_WIDTH, 2) * sizeof(double)) == 0); @@ -580,7 +580,7 @@ static inline void gmx_simdcall * just ignore the return value (Checked with gcc-4.9.1 and clang-3.6 for AVX). */ static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { double sum[4]; // Note that the 4 here corresponds to the 4 m-elements, not any SIMD width diff --git a/src/gromacs/simd/impl_reference/impl_reference_util_float.h b/src/gromacs/simd/impl_reference/impl_reference_util_float.h index 5e2ac95fd5..c7e52fbe4a 100644 --- a/src/gromacs/simd/impl_reference/impl_reference_util_float.h +++ b/src/gromacs/simd/impl_reference/impl_reference_util_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2019,2020,2021, 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. @@ -157,7 +157,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const float* base, */ template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) { // Offset list must be aligned for SIMD FINT32 assert(std::size_t(offset) % (GMX_SIMD_FINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -286,7 +286,7 @@ static inline void gmx_simdcall gatherLoadUTranspose(const float* base, */ template static inline void gmx_simdcall - transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { // Offset list must be aligned for SIMD FINT32 assert(std::size_t(offset) % (GMX_SIMD_FINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -342,7 +342,7 @@ static inline void gmx_simdcall */ template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { // Offset list must be aligned for SIMD FINT32 assert(std::size_t(offset) % (GMX_SIMD_FINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -398,7 +398,7 @@ static inline void gmx_simdcall */ template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { // Offset list must be aligned for SIMD FINT32 assert(std::size_t(offset) % (GMX_SIMD_FINT32_WIDTH * sizeof(std::int32_t)) == 0); @@ -520,7 +520,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const float* base, */ template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { for (std::size_t i = 0; i < v0->simdInternal_.size(); i++) { @@ -555,7 +555,7 @@ static inline void gmx_simdcall */ template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { // Base pointer must be aligned to the smaller of 2 elements and float SIMD width assert(std::size_t(base) % (std::min(GMX_SIMD_FLOAT_WIDTH, 2) * sizeof(float)) == 0); diff --git a/src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_float.h b/src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_float.h index 7c027b10af..1c8809029a 100644 --- a/src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_float.h +++ b/src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_simd_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2019,2020,2021, 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. @@ -92,10 +92,10 @@ static inline SimdFBool gmx_simdcall testBits(SimdFloat a) template static inline SimdFloat gmx_simdcall frexp(SimdFloat value, SimdFInt32* exponent) { - const __m256 exponentMask = _mm256_castsi256_ps(_mm256_set1_epi32(0x7F800000)); - const __m256 mantissaMask = _mm256_castsi256_ps(_mm256_set1_epi32(0x807FFFFF)); + const __m256 exponentMask = _mm256_castsi256_ps(_mm256_set1_epi32(0x7F800000)); + const __m256 mantissaMask = _mm256_castsi256_ps(_mm256_set1_epi32(0x807FFFFF)); const __m256i exponentBias = _mm256_set1_epi32(126); // add 1 to make our definition identical to frexp() - const __m256 half = _mm256_set1_ps(0.5); + const __m256 half = _mm256_set1_ps(0.5); __m256i iExponent = _mm256_castps_si256(_mm256_and_ps(value.simdInternal_, exponentMask)); iExponent = _mm256_sub_epi32(_mm256_srli_epi32(iExponent, 23), exponentBias); diff --git a/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_double.h b/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_double.h index d404eb783f..19e6bc812e 100644 --- a/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_double.h +++ b/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2018,2019,2021, 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. @@ -85,7 +85,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) { __m128d t1, t2, t3, t4; __m256d tA, tB; @@ -176,7 +176,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { __m256d t0, t1; __m128d t2, tA, tB; @@ -238,7 +238,7 @@ static inline void gmx_simdcall } template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { __m256d t0, t1; __m128d t2, tA, tB; @@ -336,7 +336,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { __m128d t1, t2, t3, t4; __m256d tA, tB; @@ -360,7 +360,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { __m128d t1, t2, t3, t4; __m256d tA, tB; @@ -381,7 +381,7 @@ static inline void gmx_simdcall } static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { __m256d t0, t1, t2; __m128d a0, a1; diff --git a/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_float.h b/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_float.h index 532dd2eb1e..606bbcce97 100644 --- a/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_float.h +++ b/src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2018,2019,2020,2021, 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. @@ -128,7 +128,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) { __m128 t1, t2, t3, t4, t5, t6, t7, t8; __m256 tA, tB, tC, tD; @@ -219,7 +219,7 @@ static inline void gmx_simdcall gatherLoadUTranspose(const float* base, template static inline void gmx_simdcall - transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m256 tv3; __m128i mask = _mm_set_epi32(0, -1, -1, -1); @@ -239,7 +239,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m256 t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; __m128 tA, tB, tC, tD, tE, tF, tG, tH, tX; @@ -371,7 +371,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m256 t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; __m128 tA, tB, tC, tD, tE, tF, tG, tH, tX; @@ -530,7 +530,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 simdoffset, SimdFloat* v0, SimdFloat* v1) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 simdoffset, SimdFloat* v0, SimdFloat* v1) { alignas(GMX_SIMD_ALIGNMENT) std::int32_t offset[GMX_SIMD_FLOAT_WIDTH]; _mm256_store_si256(reinterpret_cast<__m256i*>(offset), simdoffset.simdInternal_); @@ -540,7 +540,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 simdoffset, SimdFloat* v0, SimdFloat* v1) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 simdoffset, SimdFloat* v0, SimdFloat* v1) { __m128 t1, t2, t3, t4, t5, t6, t7, t8; __m256 tA, tB, tC, tD; diff --git a/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_double.h b/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_double.h index acde31b609..9ae6999ce5 100644 --- a/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_double.h +++ b/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_double.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2014-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -105,7 +105,7 @@ inline void gmx_simdcall decrHsimd(double* m, SimdDouble a) template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v, Targs... Fargs) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v, Targs... Fargs) { if (align > 1) { @@ -118,21 +118,21 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v, Targs... Fargs) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v, Targs... Fargs) { gatherLoadBySimdIntTranspose(base, offset, v, Fargs...); } template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v, Targs... Fargs) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v, Targs... Fargs) { gatherLoadBySimdIntTranspose(base, simdLoad(offset, SimdDInt32Tag()), v, Fargs...); } template static inline void gmx_simdcall - gatherLoadUTranspose(const double* base, const std::int32_t offset[], SimdDouble* v, Targs... Fargs) +gatherLoadUTranspose(const double* base, const std::int32_t offset[], SimdDouble* v, Targs... Fargs) { gatherLoadBySimdIntTranspose(base, simdLoad(offset, SimdDInt32Tag()), v, Fargs...); } @@ -159,7 +159,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { __m512d t[4], t5, t6, t7, t8; alignas(GMX_SIMD_ALIGNMENT) std::int64_t o[8]; @@ -221,7 +221,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { __m512d t[4], t5, t6, t7, t8; alignas(GMX_SIMD_ALIGNMENT) std::int64_t o[8]; @@ -299,7 +299,7 @@ static inline void gmx_simdcall expandScalarsToTriplets(SimdDouble scalar, static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { __m512d t0, t2; __m256d t3, t4; diff --git a/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h b/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h index 65d1320d67..06c648d4bb 100644 --- a/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h +++ b/src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_util_float.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -104,7 +104,7 @@ inline void gmx_simdcall decrHsimd(float* m, SimdFloat a) template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v, Targs... Fargs) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v, Targs... Fargs) { // For align 1 or 2: No multiplication of offset is needed if (align > 2) @@ -120,28 +120,28 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v, Targs... Fargs) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v, Targs... Fargs) { gatherLoadBySimdIntTranspose(base, offset, v, Fargs...); } template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v, Targs... Fargs) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v, Targs... Fargs) { gatherLoadBySimdIntTranspose(base, simdLoad(offset, SimdFInt32Tag()), v, Fargs...); } template static inline void gmx_simdcall - gatherLoadUTranspose(const float* base, const std::int32_t offset[], SimdFloat* v, Targs... Fargs) +gatherLoadUTranspose(const float* base, const std::int32_t offset[], SimdFloat* v, Targs... Fargs) { gatherLoadBySimdIntTranspose(base, simdLoad(offset, SimdFInt32Tag()), v, Fargs...); } template static inline void gmx_simdcall - transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { SimdFInt32 simdoffset = simdLoad(offset, SimdFInt32Tag()); if (align > 2) @@ -157,7 +157,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m512 t[4], t5, t6, t7, t8; int i; @@ -235,7 +235,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m512 t[4], t5, t6, t7, t8; int i; diff --git a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_double.h b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_double.h index 01b2ca2059..e610bf273f 100644 --- a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_double.h +++ b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2019,2020,2021, 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. @@ -318,7 +318,7 @@ static inline SimdDouble frexp(SimdDouble value, SimdDInt32* exponent) const __m128d mantissaMask = _mm_castsi128_pd(_mm_set_epi32(0x800FFFFF, 0xFFFFFFFF, 0x800FFFFF, 0xFFFFFFFF)); const __m128i exponentBias = _mm_set1_epi32(1022); // add 1 to make our definition identical to frexp() - const __m128d half = _mm_set1_pd(0.5); + const __m128d half = _mm_set1_pd(0.5); __m128i iExponent = _mm_castpd_si128(_mm_and_pd(value.simdInternal_, exponentMask)); iExponent = _mm_sub_epi32(_mm_srli_epi64(iExponent, 52), exponentBias); diff --git a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h index 7bc392c5e8..dd8c6c47cc 100644 --- a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h +++ b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_simd_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2016,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2016,2017,2019,2020,2021, 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. @@ -310,7 +310,7 @@ static inline SimdFloat gmx_simdcall frexp(SimdFloat value, SimdFInt32* exponent const __m128 exponentMask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); const __m128 mantissaMask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF)); const __m128i exponentBias = _mm_set1_epi32(126); // add 1 to make our definition identical to frexp() - const __m128 half = _mm_set1_ps(0.5F); + const __m128 half = _mm_set1_ps(0.5F); __m128i iExponent = _mm_castps_si128(_mm_and_ps(value.simdInternal_, exponentMask)); iExponent = _mm_sub_epi32(_mm_srli_epi32(iExponent, 23), exponentBias); diff --git a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_double.h b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_double.h index 5183cb8fc6..6ffb8ad65c 100644 --- a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_double.h +++ b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_double.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2019,2021, 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. @@ -73,7 +73,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) +gatherLoadTranspose(const double* base, const std::int32_t offset[], SimdDouble* v0, SimdDouble* v1) { __m128d t1, t2; @@ -123,7 +123,7 @@ static inline void gmx_simdcall transposeScatterStoreU(double* base, template static inline void gmx_simdcall - transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterIncrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { __m128d t1, t2, t3, t4, t5, t6, t7; @@ -148,7 +148,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) +transposeScatterDecrU(double* base, const std::int32_t offset[], SimdDouble v0, SimdDouble v1, SimdDouble v2) { // This implementation is identical to the increment version, apart from using subtraction instead __m128d t1, t2, t3, t4, t5, t6, t7; @@ -247,7 +247,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const double* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { __m128d t1, t2; @@ -306,7 +306,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) +gatherLoadUBySimdIntTranspose(const double* base, SimdDInt32 offset, SimdDouble* v0, SimdDouble* v1) { __m128d t1, t2; // Use optimized bit-shift multiply for the most common alignments. @@ -338,7 +338,7 @@ static inline void gmx_simdcall // Override for AVX-128-FMA and higher #if GMX_SIMD_X86_SSE2 || GMX_SIMD_X86_SSE4_1 static inline double gmx_simdcall - reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) +reduceIncr4ReturnSum(double* m, SimdDouble v0, SimdDouble v1, SimdDouble v2, SimdDouble v3) { __m128d t1, t2, t3, t4; diff --git a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_float.h b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_float.h index 0c4de5265a..7d7be0b8a8 100644 --- a/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_float.h +++ b/src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_float.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2018,2019,2021, 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. @@ -74,7 +74,7 @@ static inline void gmx_simdcall gatherLoadTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) +gatherLoadTranspose(const float* base, const std::int32_t offset[], SimdFloat* v0, SimdFloat* v1) { __m128 t1, t2; @@ -129,7 +129,7 @@ static inline void gmx_simdcall gatherLoadUTranspose(const float* base, template static inline void gmx_simdcall - transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterStoreU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m128 t1, t2; @@ -152,7 +152,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterIncrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { __m128 t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; @@ -227,7 +227,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) +transposeScatterDecrU(float* base, const std::int32_t offset[], SimdFloat v0, SimdFloat v1, SimdFloat v2) { // This implementation is identical to the increment version, apart from using subtraction instead __m128 t1, t2, t3, t4, t5, t6, t7, t8, t9, t10; @@ -338,7 +338,7 @@ static inline void gmx_simdcall gatherLoadBySimdIntTranspose(const float* base, template static inline void gmx_simdcall - gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { // For present-generation x86 CPUs it appears to be faster to simply // store the SIMD integer to memory and then use the normal load operations. @@ -353,7 +353,7 @@ static inline void gmx_simdcall template static inline void gmx_simdcall - gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) +gatherLoadUBySimdIntTranspose(const float* base, SimdFInt32 offset, SimdFloat* v0, SimdFloat* v1) { // For present-generation x86 CPUs it appears to be faster to simply // store the SIMD integer to memory and then use the normal load operations. diff --git a/src/gromacs/simd/scalar/scalar.h b/src/gromacs/simd/scalar/scalar.h index 6beb22595d..9343602534 100644 --- a/src/gromacs/simd/scalar/scalar.h +++ b/src/gromacs/simd/scalar/scalar.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2020,2021, 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. @@ -325,7 +325,8 @@ static inline float reduce(float a) */ static inline float andNot(float a, float b) { - union { + union + { float r; std::uint32_t i; } conv1, conv2; @@ -353,7 +354,8 @@ static inline float andNot(float a, float b) */ static inline bool testBits(float a) { - union { + union + { std::uint32_t i; float f; } conv; @@ -731,7 +733,8 @@ static inline double reduce(double a) */ static inline double andNot(double a, double b) { - union { + union + { double r; std::uint64_t i; } conv1, conv2; @@ -759,7 +762,8 @@ static inline double andNot(double a, double b) */ static inline bool testBits(double a) { - union { + union + { std::uint64_t i; double f; } conv; diff --git a/src/gromacs/simd/simd_math.h b/src/gromacs/simd/simd_math.h index 5642c45e32..c919b3648b 100644 --- a/src/gromacs/simd/simd_math.h +++ b/src/gromacs/simd/simd_math.h @@ -1030,7 +1030,8 @@ static inline SimdFloat gmx_simdcall erfc(SimdFloat x) const int isieve = 0xFFFFF000; alignas(GMX_SIMD_ALIGNMENT) float mem[GMX_SIMD_FLOAT_WIDTH]; - union { + union + { float f; int i; } conv; diff --git a/src/gromacs/simd/tests/base.cpp b/src/gromacs/simd/tests/base.cpp index 31a39a3864..eb33c09e9f 100644 --- a/src/gromacs/simd/tests/base.cpp +++ b/src/gromacs/simd/tests/base.cpp @@ -81,7 +81,8 @@ int SimdBaseTest::s_nPoints = 10000; bool allOk; size_t i; - union { + union + { #if GMX_DOUBLE double r; std::int64_t i; diff --git a/src/gromacs/simd/tests/bootstrap_loadstore.cpp b/src/gromacs/simd/tests/bootstrap_loadstore.cpp index 52ba8e396b..8d64617b45 100644 --- a/src/gromacs/simd/tests/bootstrap_loadstore.cpp +++ b/src/gromacs/simd/tests/bootstrap_loadstore.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2014,2015,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2014,2015,2017,2018,2019,2021, 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. @@ -84,9 +84,9 @@ namespace */ template void loadStoreTester(TSimd gmx_simdcall loadFn(const T* mem), - void gmx_simdcall storeFn(T* mem, TSimd), - const int loadOffset, - const int storeOffset) + void gmx_simdcall storeFn(T* mem, TSimd), + const int loadOffset, + const int storeOffset) { /* We need simdWidth storage in the first place, another simdWidth elements * so we can create (deliberately) offset un-aligned pointers, and finally diff --git a/src/gromacs/simd/tests/simd_floatingpoint.cpp b/src/gromacs/simd/tests/simd_floatingpoint.cpp index dc5d157b1a..62f9574f95 100644 --- a/src/gromacs/simd/tests/simd_floatingpoint.cpp +++ b/src/gromacs/simd/tests/simd_floatingpoint.cpp @@ -517,9 +517,9 @@ TEST_F(SimdFloatingpointTest, cvtDouble2Float) { alignas(GMX_SIMD_ALIGNMENT) float f[GMX_SIMD_FLOAT_WIDTH]; alignas(GMX_SIMD_ALIGNMENT) double d[GMX_SIMD_FLOAT_WIDTH]; // Yes, double array length should be same as float - int i; - SimdFloat vf; - SimdDouble vd0; + int i; + SimdFloat vf; + SimdDouble vd0; FloatingPointTolerance tolerance(defaultRealTolerance()); // This fills elements for pd1 too when double width is 2*single width diff --git a/src/gromacs/simd/tests/simd_math.cpp b/src/gromacs/simd/tests/simd_math.cpp index 463790cb47..f7bad07115 100644 --- a/src/gromacs/simd/tests/simd_math.cpp +++ b/src/gromacs/simd/tests/simd_math.cpp @@ -115,10 +115,10 @@ public: MatchRule matchRule; //!< Decide what we consider a match }; - ::testing::AssertionResult compareSimdMathFunction(const char* refFuncExpr, - const char* simdFuncExpr, - const char* compareSettingsExpr, - real refFunc(real x), + ::testing::AssertionResult compareSimdMathFunction(const char* refFuncExpr, + const char* simdFuncExpr, + const char* compareSettingsExpr, + real refFunc(real x), SimdReal gmx_simdcall simdFunc(SimdReal x), const CompareSettings& compareSettings); @@ -208,7 +208,8 @@ std::vector SimdMathTest::generateTestPoints(Range inputRange, std::size_t points--; // Used one point } - union { + union + { real r; std::conditional::type i; } low, high, x; @@ -282,7 +283,8 @@ std::vector SimdMathTest::generateTestPoints(Range inputRange, std::size_t real refValMaxUlpDiff, simdValMaxUlpDiff; const int niter = s_nPoints / GMX_SIMD_REAL_WIDTH; - union { + union + { real r; std::conditional::type i; } conv0, conv1; diff --git a/src/gromacs/simd/vector_operations.h b/src/gromacs/simd/vector_operations.h index b97e21b302..a3fcc658f4 100644 --- a/src/gromacs/simd/vector_operations.h +++ b/src/gromacs/simd/vector_operations.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2017,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2017,2019,2021, 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. @@ -81,7 +81,7 @@ namespace gmx * \note The SIMD part is that we calculate many scalar products in one call. */ static inline SimdFloat gmx_simdcall - iprod(SimdFloat ax, SimdFloat ay, SimdFloat az, SimdFloat bx, SimdFloat by, SimdFloat bz) +iprod(SimdFloat ax, SimdFloat ay, SimdFloat az, SimdFloat bx, SimdFloat by, SimdFloat bz) { SimdFloat ret; @@ -168,7 +168,7 @@ static inline void gmx_simdcall cprod(SimdFloat ax, * \note The SIMD part is that we calculate many scalar products in one call. */ static inline SimdDouble gmx_simdcall - iprod(SimdDouble ax, SimdDouble ay, SimdDouble az, SimdDouble bx, SimdDouble by, SimdDouble bz) +iprod(SimdDouble ax, SimdDouble ay, SimdDouble az, SimdDouble bx, SimdDouble by, SimdDouble bz) { SimdDouble ret; diff --git a/src/gromacs/swap/swapcoords.cpp b/src/gromacs/swap/swapcoords.cpp index 947218eed1..172d4024a0 100644 --- a/src/gromacs/swap/swapcoords.cpp +++ b/src/gromacs/swap/swapcoords.cpp @@ -192,7 +192,7 @@ typedef struct swap_group gmx::EnumerationArray comp; /**< Distribution of particles of this group across the two compartments */ gmx::EnumerationArray vacancy; /**< How many molecules need to be swapped in? */ - gmx::EnumerationArray fluxfromAtoB; /**< Net flux of ions per channel */ + gmx::EnumerationArray fluxfromAtoB; /**< Net flux of ions per channel */ gmx::EnumerationArray nCyl; /**< Number of ions residing in a channel */ int nCylBoth = 0; /**< Ions assigned to cyl0 and cyl1. Not good. */ } t_swapgrp; diff --git a/src/gromacs/tables/cubicsplinetable.cpp b/src/gromacs/tables/cubicsplinetable.cpp index dcbdbfe7a2..740296624b 100644 --- a/src/gromacs/tables/cubicsplinetable.cpp +++ b/src/gromacs/tables/cubicsplinetable.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2020,2021, 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. @@ -306,8 +306,7 @@ const real CubicSplineTable::defaultTolerance = 10.0 * GMX_FLOAT_EPS; CubicSplineTable::CubicSplineTable(std::initializer_list analyticalInputList, const std::pair& range, real tolerance) : - numFuncInTable_(analyticalInputList.size()), - range_(range) + numFuncInTable_(analyticalInputList.size()), range_(range) { // Sanity check on input values if (range_.first < 0.0 || (range_.second - range_.first) < 0.001) @@ -395,8 +394,7 @@ CubicSplineTable::CubicSplineTable(std::initializer_list numericalInputList, const std::pair& range, real tolerance) : - numFuncInTable_(numericalInputList.size()), - range_(range) + numFuncInTable_(numericalInputList.size()), range_(range) { // Sanity check on input values if (range.first < 0.0 || (range.second - range.first) < 0.001) diff --git a/src/gromacs/tables/forcetable.cpp b/src/gromacs/tables/forcetable.cpp index 0705e7db79..6614b8f9b0 100644 --- a/src/gromacs/tables/forcetable.cpp +++ b/src/gromacs/tables/forcetable.cpp @@ -432,9 +432,7 @@ static void copy2table(int n, } t_tabledata::t_tabledata(int n, int nx0, double tabscale, bool bAlloc) : - nx(n), - nx0(nx0), - tabscale(tabscale) + nx(n), nx0(nx0), tabscale(tabscale) { if (bAlloc) { @@ -1449,14 +1447,7 @@ makeDispersionCorrectionTable(FILE* fp, const interaction_const_t* ic, real rtab } t_forcetable::t_forcetable(enum gmx_table_interaction interaction, enum gmx_table_format format) : - interaction(interaction), - format(format), - r(0), - n(0), - scale(0), - formatsize(0), - ninteractions(0), - stride(0) + interaction(interaction), format(format), r(0), n(0), scale(0), formatsize(0), ninteractions(0), stride(0) { } diff --git a/src/gromacs/tables/quadraticsplinetable.cpp b/src/gromacs/tables/quadraticsplinetable.cpp index af5129f2a3..fe90075a99 100644 --- a/src/gromacs/tables/quadraticsplinetable.cpp +++ b/src/gromacs/tables/quadraticsplinetable.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2017,2018,2019,2020,2021, 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. @@ -274,8 +274,7 @@ const real QuadraticSplineTable::defaultTolerance = 10.0 * GMX_FLOAT_EPS; QuadraticSplineTable::QuadraticSplineTable(std::initializer_list analyticalInputList, const std::pair& range, real tolerance) : - numFuncInTable_(analyticalInputList.size()), - range_(range) + numFuncInTable_(analyticalInputList.size()), range_(range) { // Sanity check on input values if (range_.first < 0.0 || (range_.second - range_.first) < 0.001) @@ -371,8 +370,7 @@ QuadraticSplineTable::QuadraticSplineTable(std::initializer_list numericalInputList, const std::pair& range, real tolerance) : - numFuncInTable_(numericalInputList.size()), - range_(range) + numFuncInTable_(numericalInputList.size()), range_(range) { // Sanity check on input values if (range.first < 0.0 || (range.second - range.first) < 0.001) diff --git a/src/gromacs/timing/cyclecounter.cpp b/src/gromacs/timing/cyclecounter.cpp index 878dcc937d..26b13bde14 100644 --- a/src/gromacs/timing/cyclecounter.cpp +++ b/src/gromacs/timing/cyclecounter.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2006 David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, 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. @@ -82,10 +82,10 @@ double gmx_cycles_calibrate(double sampletime) && defined(__x86_64__) && !defined(__ILP32__) && !defined(_CRAYC)) long gmx_unused tmp; int cpuid1; - int gmx_unused cpuid2; - const int l0 = 0x0; - const int l16 = 0x16; - gmx_cycles_t cycles; + int gmx_unused cpuid2; + const int l0 = 0x0; + const int l16 = 0x16; + gmx_cycles_t cycles; /* cpuid clobbers ebx but it must be restored for -fPIC so save * then restore ebx */ diff --git a/src/gromacs/topology/atomprop.cpp b/src/gromacs/topology/atomprop.cpp index 4516c324e0..b3d140ca29 100644 --- a/src/gromacs/topology/atomprop.cpp +++ b/src/gromacs/topology/atomprop.cpp @@ -72,10 +72,7 @@ struct BaseEntry { //! Default constructor. BaseEntry(const std::string& aName, const std::string& rName) : - atomName(aName), - residueName(rName), - isAvailable(false), - value(0.0) + atomName(aName), residueName(rName), isAvailable(false), value(0.0) { } //! Name for atom. diff --git a/src/gromacs/topology/idef.cpp b/src/gromacs/topology/idef.cpp index 9d33f271a6..b54d73c4f5 100644 --- a/src/gromacs/topology/idef.cpp +++ b/src/gromacs/topology/idef.cpp @@ -501,9 +501,7 @@ void init_idef(t_idef* idef) } InteractionDefinitions::InteractionDefinitions(const gmx_ffparams_t& ffparams) : - iparams(ffparams.iparams), - functype(ffparams.functype), - cmap_grid(ffparams.cmap_grid) + iparams(ffparams.iparams), functype(ffparams.functype), cmap_grid(ffparams.cmap_grid) { } diff --git a/src/gromacs/topology/idef.h b/src/gromacs/topology/idef.h index 1fb0a2fc2d..84ba6e8a58 100644 --- a/src/gromacs/topology/idef.h +++ b/src/gromacs/topology/idef.h @@ -49,7 +49,8 @@ struct gmx_ffparams_t; -typedef union t_iparams { +typedef union t_iparams +{ /* Some parameters have A and B values for free energy calculations. * The B values are not used for regular simulations of course. * Free Energy for nonbondeds can be computed by changing the atom type. diff --git a/src/gromacs/topology/residuetypes.cpp b/src/gromacs/topology/residuetypes.cpp index b60dd11802..02a5ff6f17 100644 --- a/src/gromacs/topology/residuetypes.cpp +++ b/src/gromacs/topology/residuetypes.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2013,2014,2015,2016 by the GROMACS development team. - * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019,2020,2021, 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. @@ -60,8 +60,7 @@ struct ResidueTypeEntry { //! Default constructor creates complete object. ResidueTypeEntry(const std::string& rName, const std::string& rType) : - residueName(rName), - residueType(rType) + residueName(rName), residueType(rType) { } //! Name of the residue in the entry. diff --git a/src/gromacs/trajectory/energyframe.cpp b/src/gromacs/trajectory/energyframe.cpp index ea48eb29cf..bf377d930c 100644 --- a/src/gromacs/trajectory/energyframe.cpp +++ b/src/gromacs/trajectory/energyframe.cpp @@ -54,8 +54,7 @@ namespace gmx { EnergyFrame::EnergyFrame(const t_enxframe& enxframe, const std::map& indicesOfEnergyFields) : - step_(enxframe.step), - time_(enxframe.t) + step_(enxframe.step), time_(enxframe.t) { for (const auto& index : indicesOfEnergyFields) { diff --git a/src/gromacs/trajectoryanalysis/analysissettings_impl.h b/src/gromacs/trajectoryanalysis/analysissettings_impl.h index a83eb39777..4fa009ee9e 100644 --- a/src/gromacs/trajectoryanalysis/analysissettings_impl.h +++ b/src/gromacs/trajectoryanalysis/analysissettings_impl.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2011,2012,2014,2015 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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,12 +64,7 @@ class TrajectoryAnalysisSettings::Impl public: //! Initializes the default values for the settings object. Impl() : - timeUnit(TimeUnit::Default), - flags(0), - frflags(0), - bRmPBC(true), - bPBC(true), - optionsModuleSettings_(nullptr) + timeUnit(TimeUnit::Default), flags(0), frflags(0), bRmPBC(true), bPBC(true), optionsModuleSettings_(nullptr) { } diff --git a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp index fb0d2e17bf..ec83323e58 100644 --- a/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp +++ b/src/gromacs/trajectoryanalysis/cmdlinerunner.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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,7 @@ class RunnerModule : public ICommandLineOptionsModule { public: explicit RunnerModule(TrajectoryAnalysisModulePointer module) : - module_(std::move(module)), - common_(&settings_) + module_(std::move(module)), common_(&settings_) { } diff --git a/src/gromacs/trajectoryanalysis/modules/angle.cpp b/src/gromacs/trajectoryanalysis/modules/angle.cpp index e94d5afd13..4e6dc802c0 100644 --- a/src/gromacs/trajectoryanalysis/modules/angle.cpp +++ b/src/gromacs/trajectoryanalysis/modules/angle.cpp @@ -121,10 +121,7 @@ public: * called, but values cannot be accessed. */ AnglePositionIterator(const SelectionList& selections, int posCountPerValue) : - selections_(selections), - posCountPerValue_(posCountPerValue), - currentSelection_(0), - nextPosition_(0) + selections_(selections), posCountPerValue_(posCountPerValue), currentSelection_(0), nextPosition_(0) { } diff --git a/src/gromacs/trajectoryanalysis/modules/msd.cpp b/src/gromacs/trajectoryanalysis/modules/msd.cpp index 52a89476ef..2c7479bc38 100644 --- a/src/gromacs/trajectoryanalysis/modules/msd.cpp +++ b/src/gromacs/trajectoryanalysis/modules/msd.cpp @@ -281,10 +281,7 @@ public: MsdCoordinateManager(const int numAtoms, ArrayRef molecules, ArrayRef moleculeIndexMapping) : - current_(numAtoms), - previous_(numAtoms), - molecules_(molecules), - moleculeIndexMapping_(moleculeIndexMapping) + current_(numAtoms), previous_(numAtoms), molecules_(molecules), moleculeIndexMapping_(moleculeIndexMapping) { } /*! \brief Prepares coordinates for the current frame. diff --git a/src/gromacs/trajectoryanalysis/modules/sasa.cpp b/src/gromacs/trajectoryanalysis/modules/sasa.cpp index 360e68c7a3..2ea05667e8 100644 --- a/src/gromacs/trajectoryanalysis/modules/sasa.cpp +++ b/src/gromacs/trajectoryanalysis/modules/sasa.cpp @@ -401,12 +401,7 @@ private: }; Sasa::Sasa() : - solsize_(0.14), - ndots_(24), - dgsDefault_(0), - bIncludeSolute_(true), - mtop_(nullptr), - atoms_(nullptr) + solsize_(0.14), ndots_(24), dgsDefault_(0), bIncludeSolute_(true), mtop_(nullptr), atoms_(nullptr) { // minarea_ = 0.5; registerAnalysisDataset(&area_, "area"); diff --git a/src/gromacs/trajectoryanalysis/modules/select.cpp b/src/gromacs/trajectoryanalysis/modules/select.cpp index 0ec05b077f..fef4745d7c 100644 --- a/src/gromacs/trajectoryanalysis/modules/select.cpp +++ b/src/gromacs/trajectoryanalysis/modules/select.cpp @@ -138,10 +138,7 @@ private: */ IndexFileWriterModule::IndexFileWriterModule() : - fp_(nullptr), - currentGroup_(-1), - currentSize_(0), - bAnyWritten_(false) + fp_(nullptr), currentGroup_(-1), currentSize_(0), bAnyWritten_(false) { } diff --git a/src/gromacs/trajectoryanalysis/tests/moduletest.cpp b/src/gromacs/trajectoryanalysis/tests/moduletest.cpp index bb1e0594f0..cadc4c9d39 100644 --- a/src/gromacs/trajectoryanalysis/tests/moduletest.cpp +++ b/src/gromacs/trajectoryanalysis/tests/moduletest.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2012,2013,2014,2015,2017 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -92,8 +92,7 @@ public: }; AbstractTrajectoryAnalysisModuleTestFixture::Impl::Impl(AbstractTrajectoryAnalysisModuleTestFixture* parent) : - parent_(*parent), - bDatasetsIncluded_(false) + parent_(*parent), bDatasetsIncluded_(false) { } diff --git a/src/gromacs/trajectoryanalysis/tests/surfacearea.cpp b/src/gromacs/trajectoryanalysis/tests/surfacearea.cpp index d860414771..da2735e447 100644 --- a/src/gromacs/trajectoryanalysis/tests/surfacearea.cpp +++ b/src/gromacs/trajectoryanalysis/tests/surfacearea.cpp @@ -72,13 +72,7 @@ class SurfaceAreaTest : public ::testing::Test { public: SurfaceAreaTest() : - box_(), - rng_(12345), - area_(0.0), - volume_(0.0), - atomArea_(nullptr), - dotCount_(0), - dots_(nullptr) + box_(), rng_(12345), area_(0.0), volume_(0.0), atomArea_(nullptr), dotCount_(0), dots_(nullptr) { } ~SurfaceAreaTest() override diff --git a/src/gromacs/trajectoryanalysis/topologyinformation.cpp b/src/gromacs/trajectoryanalysis/topologyinformation.cpp index d387e8b9dc..1ab936f1a2 100644 --- a/src/gromacs/trajectoryanalysis/topologyinformation.cpp +++ b/src/gromacs/trajectoryanalysis/topologyinformation.cpp @@ -61,11 +61,7 @@ namespace gmx { TopologyInformation::TopologyInformation() : - hasLoadedMtop_(false), - expandedTopology_(nullptr), - atoms_(nullptr), - bTop_(false), - pbcType_(PbcType::Unset) + hasLoadedMtop_(false), expandedTopology_(nullptr), atoms_(nullptr), bTop_(false), pbcType_(PbcType::Unset) { } diff --git a/src/gromacs/utility/datafilefinder.h b/src/gromacs/utility/datafilefinder.h index 4eda8b3afd..45e4c70133 100644 --- a/src/gromacs/utility/datafilefinder.h +++ b/src/gromacs/utility/datafilefinder.h @@ -91,9 +91,7 @@ public: } //! \copydoc DataFileOptions(const char *) DataFileOptions(const std::string& filename) : - filename_(filename.c_str()), - bCurrentDir_(true), - bThrow_(true) + filename_(filename.c_str()), bCurrentDir_(true), bThrow_(true) { } @@ -131,9 +129,7 @@ struct DataFileInfo { //! Initializes the structure with given values. DataFileInfo(const std::string& dir, const std::string& name, bool bDefault) : - dir(dir), - name(name), - bFromDefaultDir(bDefault) + dir(dir), name(name), bFromDefaultDir(bDefault) { } diff --git a/src/gromacs/utility/directoryenumerator.cpp b/src/gromacs/utility/directoryenumerator.cpp index 838bdee3d4..79bd062542 100644 --- a/src/gromacs/utility/directoryenumerator.cpp +++ b/src/gromacs/utility/directoryenumerator.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2010,2011,2014,2015,2016 by the GROMACS development team. - * Copyright (c) 2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2019,2020,2021, 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. @@ -112,9 +112,7 @@ public: return new Impl(handle, finddata); } Impl(intptr_t handle, _finddata_t finddata) : - windows_handle(handle), - finddata(finddata), - bFirst_(true) + windows_handle(handle), finddata(finddata), bFirst_(true) { } ~Impl() { _findclose(windows_handle); } diff --git a/src/gromacs/utility/inmemoryserializer.cpp b/src/gromacs/utility/inmemoryserializer.cpp index cdfc6ad9d2..8f23e41cbf 100644 --- a/src/gromacs/utility/inmemoryserializer.cpp +++ b/src/gromacs/utility/inmemoryserializer.cpp @@ -71,7 +71,8 @@ public: } private: - union { + union + { char c[ValueSize]; T v; } u; @@ -81,7 +82,8 @@ private: template T swapEndian(const T& value) { - union { + union + { T value_; std::array valueAsCharArray_; } endianessSwappedValue; diff --git a/src/gromacs/utility/keyvaluetree.cpp b/src/gromacs/utility/keyvaluetree.cpp index 028939954f..a4569e5e13 100644 --- a/src/gromacs/utility/keyvaluetree.cpp +++ b/src/gromacs/utility/keyvaluetree.cpp @@ -169,9 +169,7 @@ class CompareHelper { public: CompareHelper(TextWriter* writer, real ftol, real abstol) : - writer_(writer), - ftol_(ftol), - abstol_(abstol) + writer_(writer), ftol_(ftol), abstol_(abstol) { } void compareObjects(const KeyValueTreeObject& obj1, const KeyValueTreeObject& obj2) diff --git a/src/gromacs/utility/keyvaluetreetransform.cpp b/src/gromacs/utility/keyvaluetreetransform.cpp index 6c72642c69..e3060b14a8 100644 --- a/src/gromacs/utility/keyvaluetreetransform.cpp +++ b/src/gromacs/utility/keyvaluetreetransform.cpp @@ -65,8 +65,7 @@ class KeyValueTreeTransformRulesScoped::Impl : public IKeyValueTreeTransformRule { public: Impl(internal::KeyValueTreeTransformerImpl* impl, const KeyValueTreePath& prefix) : - impl_(impl), - prefix_(prefix) + impl_(impl), prefix_(prefix) { } @@ -97,8 +96,8 @@ KeyValueTreeTransformRulesScoped::KeyValueTreeTransformRulesScoped(internal::Key KeyValueTreeTransformRulesScoped::KeyValueTreeTransformRulesScoped(KeyValueTreeTransformRulesScoped&&) noexcept = default; -KeyValueTreeTransformRulesScoped& KeyValueTreeTransformRulesScoped:: - operator=(KeyValueTreeTransformRulesScoped&&) noexcept = default; +KeyValueTreeTransformRulesScoped& +KeyValueTreeTransformRulesScoped::operator=(KeyValueTreeTransformRulesScoped&&) noexcept = default; KeyValueTreeTransformRulesScoped::~KeyValueTreeTransformRulesScoped() {} @@ -198,8 +197,7 @@ public: typedef std::map ChildRuleMap; explicit Rule(StringCompareType keyMatchType) : - expectedType_(typeid(void)), - childRules_(keyMatchType) + expectedType_(typeid(void)), childRules_(keyMatchType) { } @@ -257,8 +255,7 @@ public: { public: explicit Transformer(IKeyValueTreeErrorHandler* errorHandler) : - errorHandler_(errorHandler), - backMapping_(new KeyValueTreeBackMapping) + errorHandler_(errorHandler), backMapping_(new KeyValueTreeBackMapping) { if (errorHandler_ == nullptr) { @@ -507,8 +504,7 @@ public: KeyValueTreeTransformRuleBuilder::KeyValueTreeTransformRuleBuilder(internal::KeyValueTreeTransformerImpl* impl, const KeyValueTreePath& prefix) : - impl_(impl), - data_(new Data(prefix)) + impl_(impl), data_(new Data(prefix)) { } diff --git a/src/gromacs/utility/keyvaluetreetransform.h b/src/gromacs/utility/keyvaluetreetransform.h index 27b6f7dc42..b6931860f7 100644 --- a/src/gromacs/utility/keyvaluetreetransform.h +++ b/src/gromacs/utility/keyvaluetreetransform.h @@ -372,8 +372,7 @@ private: typedef std::unique_ptr MappingPointer; KeyValueTreeTransformResult(KeyValueTreeObject&& object, MappingPointer&& mapping) : - object_(std::move(object)), - mapping_(std::move(mapping)) + object_(std::move(object)), mapping_(std::move(mapping)) { } diff --git a/src/gromacs/utility/logger.cpp b/src/gromacs/utility/logger.cpp index 14d73b13e6..46cdc3a8cc 100644 --- a/src/gromacs/utility/logger.cpp +++ b/src/gromacs/utility/logger.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2021, 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. @@ -68,11 +68,7 @@ LogEntryWriter& LogEntryWriter::appendTextFormatted(gmx_fmtstr const char* fmt, } MDLogger::MDLogger() : - warning(nullptr), - error(nullptr), - debug(nullptr), - verboseDebug(nullptr), - info(nullptr) + warning(nullptr), error(nullptr), debug(nullptr), verboseDebug(nullptr), info(nullptr) { } diff --git a/src/gromacs/utility/loggerbuilder.cpp b/src/gromacs/utility/loggerbuilder.cpp index 91e366f2f0..7a0467b2dd 100644 --- a/src/gromacs/utility/loggerbuilder.cpp +++ b/src/gromacs/utility/loggerbuilder.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2021, 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. @@ -108,14 +108,12 @@ public: */ LoggerOwner::LoggerOwner(std::unique_ptr impl) : - impl_(impl.release()), - logger_(&impl_->logger_) + impl_(impl.release()), logger_(&impl_->logger_) { } LoggerOwner::LoggerOwner(LoggerOwner&& other) noexcept : - impl_(std::move(other.impl_)), - logger_(&impl_->logger_) + impl_(std::move(other.impl_)), logger_(&impl_->logger_) { } diff --git a/src/gromacs/utility/path.h b/src/gromacs/utility/path.h index 354ae7ea80..9e1596c943 100644 --- a/src/gromacs/utility/path.h +++ b/src/gromacs/utility/path.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2011,2012,2013,2014,2015 by the GROMACS development team. - * Copyright (c) 2016,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2020,2021, 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. @@ -110,11 +110,7 @@ public: struct NotFoundInfo { NotFoundInfo(const char* filename, const char* message, const char* call, bool wasError, int err) : - filename(filename), - message(message), - call(call), - wasError(wasError), - err(err) + filename(filename), message(message), call(call), wasError(wasError), err(err) { } diff --git a/src/gromacs/utility/stringstream.cpp b/src/gromacs/utility/stringstream.cpp index 1219ea3470..1cefb1e216 100644 --- a/src/gromacs/utility/stringstream.cpp +++ b/src/gromacs/utility/stringstream.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2015,2017,2018,2019,2021, 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. @@ -61,15 +61,13 @@ void StringOutputStream::close() {} StringInputStream::StringInputStream(const std::string& input) : input_(input), pos_(0) {} StringInputStream::StringInputStream(const std::vector& input) : - input_(joinStrings(input.begin(), input.end(), "\n")), - pos_(0) + input_(joinStrings(input.begin(), input.end(), "\n")), pos_(0) { input_.append("\n"); } StringInputStream::StringInputStream(ArrayRef const& input) : - input_(joinStrings(input.begin(), input.end(), "\n")), - pos_(0) + input_(joinStrings(input.begin(), input.end(), "\n")), pos_(0) { input_.append("\n"); } diff --git a/src/gromacs/utility/stringutil.cpp b/src/gromacs/utility/stringutil.cpp index c818320e2e..779fa9ad7f 100644 --- a/src/gromacs/utility/stringutil.cpp +++ b/src/gromacs/utility/stringutil.cpp @@ -338,11 +338,7 @@ bool equalCaseInsensitive(const std::string& source, const std::string& target, */ TextLineWrapperSettings::TextLineWrapperSettings() : - maxLength_(0), - indent_(0), - firstLineIndent_(-1), - bKeepFinalSpaces_(false), - continuationChar_('\0') + maxLength_(0), indent_(0), firstLineIndent_(-1), bKeepFinalSpaces_(false), continuationChar_('\0') { } diff --git a/src/gromacs/utility/tests/inmemoryserializer.cpp b/src/gromacs/utility/tests/inmemoryserializer.cpp index ed502096d3..0fb8cbfe7c 100644 --- a/src/gromacs/utility/tests/inmemoryserializer.cpp +++ b/src/gromacs/utility/tests/inmemoryserializer.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -53,12 +53,14 @@ namespace test { namespace { -union IntAndFloat32 { +union IntAndFloat32 +{ std::int32_t int32Value_; float floatValue_; }; -union IntAndFloat64 { +union IntAndFloat64 +{ std::int64_t int64Value_; double doubleValue_; }; @@ -88,8 +90,9 @@ constexpr int integerSizeDependentTestingValue() //! Return the endianess-swapped integer used for testing, depending on the size of int. constexpr int integerSizeDependentTestingValueEndianessSwapped() { - return sizeof(int) == 4 ? c_int32ValueSwapped - : sizeof(int) == 8 ? c_int64ValueSwapped : c_int16ValueSwapped; + return sizeof(int) == 4 ? c_int32ValueSwapped + : sizeof(int) == 8 ? c_int64ValueSwapped + : c_int16ValueSwapped; } class InMemorySerializerTest : public ::testing::Test diff --git a/src/gromacs/utility/textwriter.cpp b/src/gromacs/utility/textwriter.cpp index 3f99ed5f9d..18be9ad467 100644 --- a/src/gromacs/utility/textwriter.cpp +++ b/src/gromacs/utility/textwriter.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019,2021, 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. @@ -57,10 +57,7 @@ class TextWriter::Impl { public: explicit Impl(const TextOutputStreamPointer& stream) : - stream_(stream), - newLineCount_(2), - currentLineLength_(0), - pendingNewLine_(false) + stream_(stream), newLineCount_(2), currentLineLength_(0), pendingNewLine_(false) { wrapper_.settings().setKeepFinalSpaces(true); } diff --git a/src/programs/mdrun/tests/energycomparison.cpp b/src/programs/mdrun/tests/energycomparison.cpp index fa9823675a..da828c0f56 100644 --- a/src/programs/mdrun/tests/energycomparison.cpp +++ b/src/programs/mdrun/tests/energycomparison.cpp @@ -79,8 +79,7 @@ EnergyTermsToCompare EnergyComparison::defaultEnergyTermsToCompare() EnergyComparison::EnergyComparison(const EnergyTermsToCompare& energyTermsToCompare, MaxNumFrames maxNumFrames) : - energyTermsToCompare_(energyTermsToCompare), - maxNumFrames_(maxNumFrames) + energyTermsToCompare_(energyTermsToCompare), maxNumFrames_(maxNumFrames) { } diff --git a/src/programs/mdrun/tests/mdruncomparison.h b/src/programs/mdrun/tests/mdruncomparison.h index 58809a1f54..e9dcbe11a8 100644 --- a/src/programs/mdrun/tests/mdruncomparison.h +++ b/src/programs/mdrun/tests/mdruncomparison.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2021, 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,8 +69,7 @@ public: typedef std::unique_ptr FrameReaderPtr; //! Constructor FramePairManager(FrameReaderPtr first, FrameReaderPtr second) : - first_(std::move(first)), - second_(std::move(second)) + first_(std::move(first)), second_(std::move(second)) { } diff --git a/src/programs/mdrun/tests/multiple_time_stepping.cpp b/src/programs/mdrun/tests/multiple_time_stepping.cpp index 6851b7bdc1..b663fd733a 100644 --- a/src/programs/mdrun/tests/multiple_time_stepping.cpp +++ b/src/programs/mdrun/tests/multiple_time_stepping.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2020, by the GROMACS development team, led by + * Copyright (c) 2020,2021, 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. @@ -126,31 +126,31 @@ TEST_P(MtsComparisonTest, WithinTolerances) const int nstfout = 2 * numSteps; auto refMdpOptions = sharedMdpOptions + gmx::formatString( - "mts = no\n" - "nstcalcenergy = %d\n" - "nstenergy = %d\n" - "nstxout = 0\n" - "nstvout = 0\n" - "nstfout = %d\n", - numSteps, - numSteps, - nstfout); + "mts = no\n" + "nstcalcenergy = %d\n" + "nstenergy = %d\n" + "nstxout = 0\n" + "nstvout = 0\n" + "nstfout = %d\n", + numSteps, + numSteps, + nstfout); auto mtsMdpOptions = sharedMdpOptions + gmx::formatString( - "mts = yes\n" - "mts-levels = 2\n" - "mts-level2-forces = %s\n" - "mts-level2-factor = 2\n" - "nstcalcenergy = %d\n" - "nstenergy = %d\n" - "nstxout = 0\n" - "nstvout = 0\n" - "nstfout = %d\n", - mtsScheme.c_str(), - numSteps, - numSteps, - nstfout); + "mts = yes\n" + "mts-levels = 2\n" + "mts-level2-forces = %s\n" + "mts-level2-factor = 2\n" + "nstcalcenergy = %d\n" + "nstenergy = %d\n" + "nstxout = 0\n" + "nstvout = 0\n" + "nstfout = %d\n", + mtsScheme.c_str(), + numSteps, + numSteps, + nstfout); // At step 0 the energy and virial should only differ due to rounding errors EnergyTermsToCompare energyTermsToCompareStep0 = energyTermsToCompare(0.001, 0.01); diff --git a/src/programs/mdrun/tests/terminationhelper.cpp b/src/programs/mdrun/tests/terminationhelper.cpp index 06afc5b658..180f2e7e79 100644 --- a/src/programs/mdrun/tests/terminationhelper.cpp +++ b/src/programs/mdrun/tests/terminationhelper.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2016,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2016,2018,2019,2021, 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,8 +58,7 @@ namespace test TerminationHelper::TerminationHelper(TestFileManager* fileManager, CommandLine* mdrunCaller, SimulationRunner* runner) : - mdrunCaller_(mdrunCaller), - runner_(runner) + mdrunCaller_(mdrunCaller), runner_(runner) { runner_->cptFileName_ = fileManager->getTemporaryFilePath(".cpt"); runner_->useTopGroAndNdxFromDatabase("spc2"); diff --git a/src/programs/mdrun/tests/trajectorycomparison.cpp b/src/programs/mdrun/tests/trajectorycomparison.cpp index c4df99d910..653fca6fed 100644 --- a/src/programs/mdrun/tests/trajectorycomparison.cpp +++ b/src/programs/mdrun/tests/trajectorycomparison.cpp @@ -251,8 +251,7 @@ const TrajectoryTolerances TrajectoryComparison::s_defaultTrajectoryTolerances{ TrajectoryComparison::TrajectoryComparison(const TrajectoryFrameMatchSettings& matchSettings, const TrajectoryTolerances& tolerances) : - matchSettings_(matchSettings), - tolerances_(tolerances) + matchSettings_(matchSettings), tolerances_(tolerances) { } diff --git a/src/programs/view/xdlgitem.h b/src/programs/view/xdlgitem.h index a4e0fff0f2..31ea19daf6 100644 --- a/src/programs/view/xdlgitem.h +++ b/src/programs/view/xdlgitem.h @@ -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,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2019,2021, 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. @@ -119,7 +119,8 @@ typedef struct t_dlgitem char * set, *get, *help; edlgitem type; int (*WndProc)(t_x11* x11, struct t_dlgitem* dlgitem, XEvent* event); - union { + union + { t_button button; t_radiobutton radiobutton; t_groupbox groupbox; diff --git a/src/testutils/cmdlinetest.cpp b/src/testutils/cmdlinetest.cpp index ab2b4c0b2e..a03b895abb 100644 --- a/src/testutils/cmdlinetest.cpp +++ b/src/testutils/cmdlinetest.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team. - * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019,2020,2021, 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. @@ -267,9 +267,7 @@ public: struct OutputFileInfo { OutputFileInfo(const char* option, const std::string& path, FileMatcherPointer matcher) : - option(option), - path(path), - matcher(move(matcher)) + option(option), path(path), matcher(move(matcher)) { } diff --git a/src/testutils/interactivetest.cpp b/src/testutils/interactivetest.cpp index e28dbd751d..20ce19ea7f 100644 --- a/src/testutils/interactivetest.cpp +++ b/src/testutils/interactivetest.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019,2020,2021, 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. @@ -84,10 +84,7 @@ class InteractiveTestHelper::Impl { public: explicit Impl(TestReferenceChecker checker) : - checker_(std::move(checker)), - bLastNewline_(true), - currentLine_(0), - bHasOutput_(false) + checker_(std::move(checker)), bLastNewline_(true), currentLine_(0), bHasOutput_(false) { using ::testing::_; using ::testing::Invoke; diff --git a/src/testutils/mpi_printer.cpp b/src/testutils/mpi_printer.cpp index 15778e154f..7d3a5b7abf 100644 --- a/src/testutils/mpi_printer.cpp +++ b/src/testutils/mpi_printer.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2016,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2016,2019,2021, 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. @@ -75,9 +75,7 @@ class MPIEventForward : public ::testing::TestEventListener { public: MPIEventForward(TestEventListener* defaultPrinter, int rank, int size) : - defaultPrinter_(defaultPrinter), - rank_(rank), - size_(size) + defaultPrinter_(defaultPrinter), rank_(rank), size_(size) { } diff --git a/src/testutils/refdata.cpp b/src/testutils/refdata.cpp index cfc320c04b..ba11935558 100644 --- a/src/testutils/refdata.cpp +++ b/src/testutils/refdata.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2011-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, 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. @@ -288,12 +288,10 @@ namespace internal { TestReferenceDataImpl::TestReferenceDataImpl(ReferenceDataMode mode, bool bSelfTestMode) : - updateMismatchingEntries_(false), - bSelfTestMode_(bSelfTestMode), - bInUse_(false) + updateMismatchingEntries_(false), bSelfTestMode_(bSelfTestMode), bInUse_(false) { - const std::string dirname = bSelfTestMode ? TestFileManager::getGlobalOutputTempDirectory() - : TestFileManager::getInputDataDirectory(); + const std::string dirname = bSelfTestMode ? TestFileManager::getGlobalOutputTempDirectory() + : TestFileManager::getInputDataDirectory(); const std::string filename = TestFileManager::getTestSpecificFileName(".xml"); fullFilename_ = Path::join(dirname, "refdata", filename); diff --git a/src/testutils/refdata_checkers.h b/src/testutils/refdata_checkers.h index 9b5c7c2faa..6400f1f2f2 100644 --- a/src/testutils/refdata_checkers.h +++ b/src/testutils/refdata_checkers.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019,2020,2021, 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. @@ -148,8 +148,7 @@ class FloatingPointChecker : public IReferenceDataEntryChecker { public: FloatingPointChecker(FloatType value, const FloatingPointTolerance& tolerance) : - value_(value), - tolerance_(tolerance) + value_(value), tolerance_(tolerance) { } @@ -183,8 +182,7 @@ class FloatingPointFromStringChecker : public IReferenceDataEntryChecker { public: FloatingPointFromStringChecker(const std::string& value, const FloatingPointTolerance& tolerance) : - value_(value), - tolerance_(tolerance) + value_(value), tolerance_(tolerance) { } diff --git a/src/testutils/testinit.cpp b/src/testutils/testinit.cpp index e88d74c92a..834aa5cffa 100644 --- a/src/testutils/testinit.cpp +++ b/src/testutils/testinit.cpp @@ -102,8 +102,7 @@ public: * \param[in] context Current \Gromacs program context. */ explicit TestProgramContext(const IProgramContext& context) : - context_(context), - dataPath_(CMAKE_SOURCE_DIR) + context_(context), dataPath_(CMAKE_SOURCE_DIR) { } diff --git a/src/testutils/tests/interactivetest.cpp b/src/testutils/tests/interactivetest.cpp index 93bfb2f178..108456cd49 100644 --- a/src/testutils/tests/interactivetest.cpp +++ b/src/testutils/tests/interactivetest.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2019,2020,2021, 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. @@ -63,9 +63,7 @@ class InteractiveSession { public: explicit InteractiveSession(ReferenceDataMode mode) : - data_(mode), - helper_(data_.rootChecker()), - nextInputLine_(0) + data_(mode), helper_(data_.rootChecker()), nextInputLine_(0) { } -- 2.22.0