Merge release-2021 into master
authorAndrey Alekseenko <al42and@gmail.com>
Mon, 18 Oct 2021 14:31:36 +0000 (16:31 +0200)
committerAndrey Alekseenko <al42and@gmail.com>
Mon, 18 Oct 2021 14:39:47 +0000 (16:39 +0200)
Brings the following fixes from the release branch into master:

- #4148 (!1941)
- #4167 (!1966)
- #4190 (!2050)
- !2039

1  2 
docs/gmxapi/userguide/install.rst
src/gromacs/ewald/pme.cpp
src/gromacs/ewald/pme.h
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/selection/evaluate.cpp
src/gromacs/taskassignment/decidegpuusage.cpp
src/gromacs/taskassignment/decidegpuusage.h

index f0ab2210fb9ced25c1be0cb28f42833538b96ce8,8588156a48b3d85140459260e93457ec49e99d3f..e1994e9c74b343f80ed9c496eafad0eb6a494693
@@@ -502,22 -496,9 +502,22 @@@ This will first build the *gmxapi* Pyth
  location in the build tree. Sphinx can then import the package to automatically
  extract Python docstrings.
  
 +Note that this is an entirely CMake-driven installation and Python dependencies
 +will not be installed automatically. You can update your Python environment
 +(before configuring with CMake) using the :file:`requirements.txt` files provided
 +in the :file:`python_packaging/` directory of the repository. Example::
 +
 +    pip install -r python_packaging/requirements-docs.txt
 +
 +or
 +
 +::
 +
 +    pip install -r python_packaging/requirements-test.txt
 +
  Sometimes the build environment can choose a different Python interpreter than
  the one you intended.
- You can set the ``Python3_ROOT`` or ``CMAKE_PREFIX_PATH`` CMake variable to
+ You can set the ``Python3_ROOT_DIR`` or ``CMAKE_PREFIX_PATH`` CMake variable to
  explicitly choose the Python installation or *venv* directory.
  
  If you use pyenv or pyenv-virtualenv to dynamically manage your Python version,
index 7438077d0b26031ecaf055243eea06eb928dc27a,b0b59e6eedbaf7fe8f37134805eab50a5280b711..e2c87459a0589403888d57fdfead803bbabb869f
@@@ -164,22 -185,38 +164,36 @@@ bool pme_gpu_supports_hardware(const gm
  
  bool pme_gpu_supports_input(const t_inputrec& ir, std::string* error)
  {
 -    std::list<std::string> errorReasons;
 -    if (!EEL_PME(ir.coulombtype))
 -    {
 -        errorReasons.emplace_back("systems that do not use PME for electrostatics");
 -    }
 -    if (ir.pme_order != 4)
 -    {
 -        errorReasons.emplace_back("interpolation orders other than 4");
 -    }
 -    if (EVDW_PME(ir.vdwtype))
 -    {
 -        errorReasons.emplace_back("Lennard-Jones PME");
 -    }
 -    if (!EI_DYNAMICS(ir.eI))
 -    {
 -        errorReasons.emplace_back(
 -                "Cannot compute PME interactions on a GPU, because PME GPU requires a dynamical "
 -                "integrator (md, sd, etc).");
 -    }
 -    return addMessageIfNotSupported(errorReasons, error);
 +    gmx::MessageStringCollector errorReasons;
 +    // Before changing the prefix string, make sure that it is not searched for in regression tests.
 +    errorReasons.startContext("PME GPU does not support:");
 +    errorReasons.appendIf(!EEL_PME(ir.coulombtype),
 +                          "Systems that do not use PME for electrostatics.");
 +    errorReasons.appendIf((ir.pme_order != 4), "Interpolation orders other than 4.");
 +    errorReasons.appendIf(EVDW_PME(ir.vdwtype), "Lennard-Jones PME.");
 +    errorReasons.appendIf(!EI_DYNAMICS(ir.eI), "Non-dynamical integrator (use md, sd, etc).");
 +    errorReasons.finishContext();
 +    if (error != nullptr)
 +    {
 +        *error = errorReasons.toString();
 +    }
 +    return errorReasons.isEmpty();
  }
  
 -    std::list<std::string> errorReasons;
 -    if (ir.efep != efepNO)
+ bool pme_gpu_mixed_mode_supports_input(const t_inputrec& ir, std::string* error)
+ {
 -        errorReasons.emplace_back("Free Energy Perturbation (in PME GPU mixed mode)");
++    gmx::MessageStringCollector errorReasons;
++    // Before changing the prefix string, make sure that it is not searched for in regression tests.
++    errorReasons.startContext("PME GPU in Mixed mode does not support:");
++    errorReasons.appendIf(ir.efep != FreeEnergyPerturbationType::No, "Free Energy Perturbation.");
++    errorReasons.finishContext();
++    if (error != nullptr)
+     {
 -    return addMessageIfNotSupported(errorReasons, error);
++        *error = errorReasons.toString();
+     }
++    return errorReasons.isEmpty();
+ }
  /*! \brief \libinternal
   * Finds out if PME with given inputs is possible to run on GPU.
   * This function is an internal final check, validating the whole PME structure on creation,
Simple merge
Simple merge
index 3bf1d5071cd6d9d21bb56dd62ad182f178488c99,423a90905cbb3eb86779f38271287c9ee0df3912..887e7ba7093ee95bbfddcea4cbdce399c1f34446
@@@ -905,14 -814,9 +905,15 @@@ int Mdrunner::mdrunner(
                      canUseGpuForNonbonded,
                      gpuAccelerationOfNonbondedIsUseful(mdlog, *inputrec, GMX_THREAD_MPI),
                      hw_opt.nthreads_tmpi);
 -            useGpuForPme = decideWhetherToUseGpusForPmeWithThreadMpi(
 -                    useGpuForNonbonded, pmeTarget, pmeFftTarget, numDevicesToUse, userGpuTaskAssignment,
 -                    *hwinfo_, *inputrec, hw_opt.nthreads_tmpi, domdecOptions.numPmeRanks);
 +            useGpuForPme = decideWhetherToUseGpusForPmeWithThreadMpi(useGpuForNonbonded,
 +                                                                     pmeTarget,
++                                                                     pmeFftTarget,
 +                                                                     numAvailableDevices,
 +                                                                     userGpuTaskAssignment,
 +                                                                     *hwinfo_,
 +                                                                     *inputrec,
 +                                                                     hw_opt.nthreads_tmpi,
 +                                                                     domdecOptions.numPmeRanks);
          }
          GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR
  
          // assignment.
          auto canUseGpuForNonbonded = buildSupportsNonbondedOnGpu(nullptr);
          useGpuForNonbonded         = decideWhetherToUseGpusForNonbonded(
 -                nonbondedTarget, userGpuTaskAssignment, emulateGpuNonbonded, canUseGpuForNonbonded,
 -                gpuAccelerationOfNonbondedIsUseful(mdlog, *inputrec, !GMX_THREAD_MPI), gpusWereDetected);
 -        useGpuForPme = decideWhetherToUseGpusForPme(
 -                useGpuForNonbonded, pmeTarget, pmeFftTarget, userGpuTaskAssignment, *hwinfo_,
 -                *inputrec, cr->sizeOfDefaultCommunicator, domdecOptions.numPmeRanks, gpusWereDetected);
 -        useGpuForBonded = decideWhetherToUseGpusForBonded(useGpuForNonbonded, useGpuForPme,
 -                                                          bondedTarget, *inputrec, mtop,
 -                                                          domdecOptions.numPmeRanks, gpusWereDetected);
 +                nonbondedTarget,
 +                userGpuTaskAssignment,
 +                emulateGpuNonbonded,
 +                canUseGpuForNonbonded,
 +                gpuAccelerationOfNonbondedIsUseful(mdlog, *inputrec, !GMX_THREAD_MPI),
 +                gpusWereDetected);
 +        useGpuForPme    = decideWhetherToUseGpusForPme(useGpuForNonbonded,
 +                                                    pmeTarget,
++                                                    pmeFftTarget,
 +                                                    userGpuTaskAssignment,
 +                                                    *hwinfo_,
 +                                                    *inputrec,
 +                                                    cr->sizeOfDefaultCommunicator,
 +                                                    domdecOptions.numPmeRanks,
 +                                                    gpusWereDetected);
 +        useGpuForBonded = decideWhetherToUseGpusForBonded(
 +                useGpuForNonbonded, useGpuForPme, bondedTarget, *inputrec, mtop, domdecOptions.numPmeRanks, gpusWereDetected);
      }
      GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR
  
Simple merge