From: Paul Bauer Date: Tue, 29 Jun 2021 07:54:40 +0000 (+0200) Subject: Merge branch release-2021 into master X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=ba073be8c4094771c8899f2c0cc3ca2937720831;p=alexxy%2Fgromacs.git Merge branch release-2021 into master Resolved Conflicts: api/gmxapi/CMakeLists.txt cmake/gmxGenerateVersionInfoWithoutGit.cmake cmake/gmxManageClangCudaConfig.cmake python_packaging/sample_restraint/src/cpp/CMakeLists.txt python_packaging/src/CMakeLists.txt python_packaging/src/gmxapi/export_system.cpp python_packaging/src/gmxapi/version.py python_packaging/src/setup.py src/gromacs/applied_forces/awh/awh.cpp src/gromacs/ewald/pme_gpu_program_impl.cu src/gromacs/gmxana/gmx_dipoles.cpp src/gromacs/tools/convert_tpr.cpp --- ba073be8c4094771c8899f2c0cc3ca2937720831 diff --cc api/gmxapi/cpp/system.cpp index a41c021b78,8441d1f443..4b93afeded --- a/api/gmxapi/cpp/system.cpp +++ b/api/gmxapi/cpp/system.cpp @@@ -116,8 -119,14 +119,13 @@@ System fromTprFile(const std::string& f return system; } + std::shared_ptr getWork(const System::Impl& system) + { + return system.workflow_; + } + 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 --cc python_packaging/sample_restraint/CMakeLists.txt index 352bb16c0a,cb763b4ae6..adefa624cf --- a/python_packaging/sample_restraint/CMakeLists.txt +++ b/python_packaging/sample_restraint/CMakeLists.txt @@@ -1,7 -1,7 +1,7 @@@ -cmake_minimum_required(VERSION 3.13.0) +cmake_minimum_required(VERSION 3.16.3) # If you are using this repository as a template, you should probably change the # project name and adopt your own versioning scheme. - project(sample_restraint VERSION 0.0.8) + project(sample_restraint VERSION 0.2.1) find_package(PythonInterp) diff --cc python_packaging/src/gmxapi/export_system.cpp index bbb68ed0f8,25d6206f38..b504ccb9e7 --- a/python_packaging/src/gmxapi/export_system.cpp +++ b/python_packaging/src/gmxapi/export_system.cpp @@@ -81,16 -80,16 +81,18 @@@ void export_system(py::module& m // Export system container class py::class_> system(m, "MDSystem"); -- system.def("launch", -- [](System* system, std::shared_ptr context) { - auto newSession = system->launch(context->get()); - auto work = gmxapi::getWork(*system->get()); - auto newSession = context->launch(*work); -- return newSession; -- }, -- "Launch the configured workflow in the provided context."); ++ system.def( ++ "launch", ++ [](System* system, std::shared_ptr context) { ++ auto work = gmxapi::getWork(*system->get()); ++ auto newSession = context->launch(*work); ++ return newSession; ++ }, ++ "Launch the configured workflow in the provided context."); // Module-level function - m.def("from_tpr", &gmxpy::from_tpr, + m.def("from_tpr", + &gmxpy::from_tpr, "Return a system container initialized from the given input record."); } diff --cc src/gromacs/applied_forces/awh/awh.cpp index 5c35e30689,02f030b08c..1455c0776a --- a/src/gromacs/applied_forces/awh/awh.cpp +++ b/src/gromacs/applied_forces/awh/awh.cpp @@@ -109,29 -107,42 +109,35 @@@ struct BiasCoupledToSyste /* Here AWH can be extended to work on other coordinates than pull. */ }; - /*! \brief Checks whether any dimension uses pulling as a coordinate provider. + /*! \brief Checks whether any dimension uses the given coordinate provider type. * * \param[in] awhBiasParams The bias params to check. - * \returns true if any dimension of the bias is linked to pulling. + * \param[in] awhCoordProvider The type of coordinate provider + * \returns true if any dimension of the bias is linked to the given provider */ - static bool anyDimUsesPull(const AwhBiasParams& awhBiasParams) -static bool anyDimUsesProvider(const AwhBiasParams& awhBiasParams, const int awhCoordProvider) ++static bool anyDimUsesProvider(const AwhBiasParams& awhBiasParams, ++ const AwhCoordinateProviderType awhCoordProvider) { - return std::any_of( - awhBiasParams.dimParams().begin(), awhBiasParams.dimParams().end(), [](const auto& awhDimParam) { - return awhDimParam.coordinateProvider() == AwhCoordinateProviderType::Pull; - }); - for (int d = 0; d < awhBiasParams.ndim; d++) - { - const AwhDimParams& awhDimParams = awhBiasParams.dimParams[d]; - if (awhDimParams.eCoordProvider == awhCoordProvider) - { - return true; - } - } - return false; ++ return std::any_of(awhBiasParams.dimParams().begin(), ++ awhBiasParams.dimParams().end(), ++ [&awhCoordProvider](const auto& awhDimParam) { ++ return awhDimParam.coordinateProvider() == awhCoordProvider; ++ }); } - /*! \brief Checks whether any dimension uses pulling as a coordinate provider. + /*! \brief Checks whether any dimension uses the given coordinate provider type. * * \param[in] awhParams The AWH params to check. - * \returns true if any dimension of awh is linked to pulling. + * \param[in] awhCoordProvider The type of coordinate provider + * \returns true if any dimension of awh is linked to the given provider type. */ - static bool anyDimUsesPull(const AwhParams& awhParams) -static bool anyDimUsesProvider(const AwhParams& awhParams, const int awhCoordProvider) ++static bool anyDimUsesProvider(const AwhParams& awhParams, const AwhCoordinateProviderType awhCoordProvider) { - for (int k = 0; k < awhParams.numBias; k++) - { - const AwhBiasParams& awhBiasParams = awhParams.awhBiasParams[k]; - if (anyDimUsesProvider(awhBiasParams, awhCoordProvider)) - { - return true; - } - } - return false; + return std::any_of(awhParams.awhBiasParams().begin(), + awhParams.awhBiasParams().end(), - [](const auto& awhBiasParam) { return anyDimUsesPull(awhBiasParam); }); ++ [&awhCoordProvider](const auto& awhBiasParam) { ++ return anyDimUsesProvider(awhBiasParam, awhCoordProvider); ++ }); } /*! \brief Checks whether any dimension uses pulling as a coordinate provider. @@@ -173,7 -190,7 +179,7 @@@ Awh::Awh(FILE* fplog numFepLambdaStates_(numFepLambdaStates), fepLambdaState_(fepLambdaState) { - if (anyDimUsesPull(awhParams)) - if (anyDimUsesProvider(awhParams, eawhcoordproviderPULL)) ++ if (anyDimUsesProvider(awhParams, AwhCoordinateProviderType::Pull)) { GMX_RELEASE_ASSERT(inputRecord.pull != nullptr, "With AWH we should have pull parameters"); GMX_RELEASE_ASSERT(pull_work != nullptr, @@@ -183,6 -200,11 +189,11 @@@ if (fplog != nullptr) { please_cite(fplog, "Lindahl2014"); + - if (anyDimUsesProvider(awhParams, eawhcoordproviderFREE_ENERGY_LAMBDA)) ++ if (anyDimUsesProvider(awhParams, AwhCoordinateProviderType::FreeEnergyLambda)) + { + please_cite(fplog, "Lundborg2021"); + } } if (haveBiasSharingWithinSimulation(awhParams)) @@@ -462,16 -468,19 +473,17 @@@ const char* Awh::externalPotentialStrin void Awh::registerAwhWithPull(const AwhParams& awhParams, pull_t* pull_work) { - GMX_RELEASE_ASSERT(!anyDimUsesPull(awhParams) || pull_work, "Need a valid pull object"); - GMX_RELEASE_ASSERT(!anyDimUsesProvider(awhParams, eawhcoordproviderPULL) || pull_work, ++ GMX_RELEASE_ASSERT(!anyDimUsesProvider(awhParams, AwhCoordinateProviderType::Pull) || pull_work, + "Need a valid pull object"); - for (int k = 0; k < awhParams.numBias; k++) + for (const auto& biasParam : awhParams.awhBiasParams()) { - const AwhBiasParams& biasParams = awhParams.awhBiasParams[k]; - - for (int d = 0; d < biasParams.ndim; d++) + for (const auto& dimParam : biasParam.dimParams()) { - if (biasParams.dimParams[d].eCoordProvider == eawhcoordproviderPULL) + if (dimParam.coordinateProvider() == AwhCoordinateProviderType::Pull) { - register_external_pull_potential(pull_work, biasParams.dimParams[d].coordIndex, - Awh::externalPotentialString()); + register_external_pull_potential( + pull_work, dimParam.coordinateIndex(), Awh::externalPotentialString()); } } } diff --cc src/gromacs/domdec/partition.cpp index 4ec9098b93,44453ac334..eccf1475ee --- a/src/gromacs/domdec/partition.cpp +++ b/src/gromacs/domdec/partition.cpp @@@ -3141,10 -3019,10 +3141,10 @@@ void dd_partition_system(FILE state_change_natoms(state_local, comm->atomRanges.numHomeAtoms()); /* Rebuild all the indices */ - dd->ga2la->clear(); + dd->ga2la->clear(false); ncgindex_set = 0; - wallcycle_sub_stop(wcycle, ewcsDD_GRID); + wallcycle_sub_stop(wcycle, WallCycleSubCounter::DDGrid); } else { diff --cc src/gromacs/utility/pleasecite.cpp index 65bfe5c7db,e333ca5d72..1d5852a6b1 --- a/src/gromacs/utility/pleasecite.cpp +++ b/src/gromacs/utility/pleasecite.cpp @@@ -517,46 -279,26 +517,53 @@@ void please_cite(FILE* fp, const char* "M. J. Abraham, T. Murtola, R. Schulz, S. Páll, J. C. Smith, B. Hess, E. Lindahl", "GROMACS: High performance molecular simulations through multi-level parallelism from " "laptops to supercomputers", - "SoftwareX", 1, 2015, "19-25" }, - { "Ballenegger2009", "V. Ballenegger, A. Arnold, J. J. Cerdà", + "SoftwareX", + 1, + 2015, + "19-25" }, + { "Ballenegger2009", + "V. Ballenegger, A. Arnold, J. J. Cerdà", "Simulations of non-neutral slab systems with long-range electrostatic interactions in " "two-dimensional periodic boundary conditions", - "J. Chem. Phys", 131, 2009, "094107" }, - { "Hub2014a", "J. S. Hub, B. L. de Groot, H. Grubmueller, G. Groenhof", + "J. Chem. Phys", + 131, + 2009, + "094107" }, + { "Hub2014a", + "J. S. Hub, B. L. de Groot, H. Grubmueller, G. Groenhof", "Quantifying Artifacts in Ewald Simulations of Inhomogeneous Systems with a Net Charge", - "J. Chem. Theory Comput.", 10, 2014, "381-393" }, - { "Spoel2018a", "D. van der Spoel, M. M. Ghahremanpour, J. Lemkul", + "J. Chem. Theory Comput.", + 10, + 2014, + "381-393" }, + { "Spoel2018a", + "D. van der Spoel, M. M. Ghahremanpour, J. Lemkul", "Small Molecule Thermochemistry: A Tool For Empirical Force Field Development", - "J. Phys. Chem. A", 122, 2018, "8982-8988" }, - { "Lindahl2014", "V. Lindahl, J. Lidmar, B. Hess", + "J. Phys. Chem. A", + 122, + 2018, + "8982-8988" }, + { "Lindahl2014", + "V. Lindahl, J. Lidmar, B. Hess", "Accelerated weight histogram method for exploring free energy landscapes", - "J. Chem. Phys.", 141, 2014, "044110" }, - { "Bernetti2020", "M. Bernetti, G. Bussi", - "Pressure control using stochastic cell rescaling", "J. Chem. Phys.", 153, 2020, + "J. Chem. Phys.", + 141, + 2014, + "044110" }, + { "Bernetti2020", + "M. Bernetti, G. Bussi", + "Pressure control using stochastic cell rescaling", + "J. Chem. Phys.", + 153, + 2020, "114107" }, - { "Lundborg2021", "M. Lundborg, J. Lidmar, B. Hess", ++ { "Lundborg2021", ++ "M. Lundborg, J. Lidmar, B. Hess", + "The accelerated weight histogram method for alchemical free energy calculations", - "J. Chem. Phys.", 154, 2021, "204103" }, ++ "J. Chem. Phys.", ++ 154, ++ 2021, ++ "204103" }, }; #define NSTR static_cast(asize(citedb))