Merge branch release-2021 into master
authorPaul Bauer <paul.bauer.q@gmail.com>
Tue, 29 Jun 2021 07:54:40 +0000 (09:54 +0200)
committerPaul Bauer <paul.bauer.q@gmail.com>
Tue, 29 Jun 2021 07:54:40 +0000 (09:54 +0200)
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

14 files changed:
1  2 
api/gmxapi/cpp/system.cpp
api/nblib/CMakeLists.txt
cmake/gmxVersionInfo.cmake
docs/reference-manual/topologies/topology-file-formats.rst
python_packaging/sample_restraint/CMakeLists.txt
python_packaging/src/CMakeLists.txt
python_packaging/src/gmxapi/export_system.cpp
src/gromacs/applied_forces/awh/awh.cpp
src/gromacs/domdec/domdec_constraints.cpp
src/gromacs/domdec/domdec_vsite.cpp
src/gromacs/domdec/ga2la.h
src/gromacs/domdec/partition.cpp
src/gromacs/mdlib/updategroupscog.cpp
src/gromacs/utility/pleasecite.cpp

index a41c021b78fd6381b24dbf5292e59af26ad5b179,8441d1f4433f2d329e3c6c62859568fe0cc69726..4b93afededc4739a52bb54b5cae0bf979263d4d3
@@@ -116,8 -119,14 +119,13 @@@ System fromTprFile(const std::string& f
      return system;
  }
  
+ std::shared_ptr<Workflow> getWork(const System::Impl& system)
+ {
+     return system.workflow_;
+ }
  System::Impl::Impl(std::unique_ptr<gmxapi::Workflow> workflow) noexcept :
 -    workflow_(std::move(workflow)),
 -    spec_(std::make_shared<MDWorkSpec>())
 +    workflow_(std::move(workflow)), spec_(std::make_shared<MDWorkSpec>())
  {
      GMX_ASSERT(workflow_, "Class invariant implies non-null workflow_ member");
      GMX_ASSERT(spec_, "Class invariant implies non-null work specification member.");
Simple merge
Simple merge
index 352bb16c0a768d1523c5560475ffd8dc36011faf,cb763b4ae61ec21f3f2117611caba3251509e515..adefa624cf7bd6db8ae0d38ea578ae7e905fa17f
@@@ -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)
  
Simple merge
index bbb68ed0f834a25eea3619fc1e8daea21a47472f,25d6206f384b23908754014a6092d4129b54a8d9..b504ccb9e74599b62bc3af6d1c91e722ecd7b33f
@@@ -81,16 -80,16 +81,18 @@@ void export_system(py::module& m
  
      // Export system container class
      py::class_<System, std::shared_ptr<System>> system(m, "MDSystem");
--    system.def("launch",
--               [](System* system, std::shared_ptr<PyContext> 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<PyContext> 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.");
  }
  
index 5c35e306896c07abf68c8e8544edb12854798db4,02f030b08c08c5d84ce59390ac535c36887ec51d..1455c0776aaa1f9c81e387bfc9ffc61e2484164f
@@@ -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,
      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());
              }
          }
      }
Simple merge
Simple merge
index 4ec9098b9385f9022e9aba90a717e0249be4a4dd,44453ac334098c3d87275432d8eaf5c9d6b9acc9..eccf1475ee33ba39f17a0a8f3292868a103b21d0
@@@ -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
      {
Simple merge
index 65bfe5c7dbd9cd54f01c7db13e23bf7fc5b8bd97,e333ca5d729731430acb1fbe507493832e356e51..1d5852a6b1d959d7b17ad2f2cd7a689664616224
@@@ -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<int>(asize(citedb))