Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Oct 10, 2024
1 parent c4d8c9d commit 48657cb
Show file tree
Hide file tree
Showing 65 changed files with 361 additions and 411 deletions.
11 changes: 11 additions & 0 deletions README-versions.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
[Versions included in GROMACS](#versions-included-in-GROMACS)

[Versions included in LAMMPS](#versions-included-in-LAMMPS)

[Versions included in NAMD](#versions-included-in-NAMD)

[Versions included in VMD](#versions-included-in-VMD)

### Versions included in GROMACS
GROMACS version | Colvars version
-------------- | ---------------
2024 | [2023-12-05](https://github.com/Colvars/colvars/tree/gromacs-2024)

### Versions included in LAMMPS
LAMMPS version | Colvars version
-------------- | ---------------
stable_29Aug2024 | [2024-06-04](https://github.com/Colvars/colvars/releases/tag/lammps-stable_29Aug2024)
stable_2Aug2023 | [2023-05-01](https://github.com/Colvars/colvars/releases/tag/lammps-stable_2Aug2023)
stable_23Jun2022 | [2022-05-24](https://github.com/Colvars/colvars/releases/tag/lammps-stable_23Jun2022)
stable_29Sep2021 | [2021-09-13](https://github.com/Colvars/colvars/releases/tag/lammps-stable_29Sep2021)
stable_29Oct2020 | [2020-09-17](https://github.com/Colvars/colvars/releases/tag/lammps-stable_29Oct2020)
Expand All @@ -27,6 +36,7 @@ stable_4Nov2016 | [2016-10-21](https://github.com/Colvars/colvars/releases/tag/l

NAMD version | Colvars version
-------------- | ---------------
3.0 | [2024-06-04](https://github.com/Colvars/colvars/tree/namd-3.0)
2.14 | [2020-07-07](https://github.com/Colvars/colvars/releases/tag/namd-2.14)
2.13b2 | [2018-10-12](https://github.com/Colvars/colvars/releases/tag/namd-2.13b2)
2.13b1 | [2018-09-07](https://github.com/Colvars/colvars/releases/tag/namd-2.13b1)
Expand All @@ -40,6 +50,7 @@ VMD version | Colvars version
-------------- | ---------------
1.9.4a58 | [2022-04-14](https://github.com/Colvars/colvars/releases/tag/vmd-1.9.4a58)
1.9.4a49 | [2020-10-22](https://github.com/Colvars/colvars/releases/tag/vmd-1.9.4a49)
1.9.4a12 | [2017-10-11](https://github.com/Colvars/colvars/releases/tag/vmd-1.9.4a12)
1.9.3 | [2016-10-26](https://github.com/Colvars/colvars/releases/tag/vmd-1.9.3)
1.9.2 | [2014-10-13](https://github.com/Colvars/colvars/releases/tag/vmd-1.9.2)

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ All of the above MD engine versions are automatically tested as part of GitHub A

## Legacy GROMACS-Colvars patched releases

Versions GROMACS prior to 2024 are supported through the use of a customized `mdrun` command line; source code of these patched releases is available [here](https://github.com/Colvars/gromacs). When posting a message to the [Gromacs forum](https://gromacs.bioexcel.eu/) regarding the use of these patched releases, please specify "GROMACS modification: **Yes**".
Versions GROMACS prior to 2024 are no longer supported by the current version of Colvars: please use GROMACS 2024 or later.


## Which version of Colvars is recommended?
Expand Down
19 changes: 19 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@ endif()

include(buildColvarsLepton)


option(COLVARS_MPI "Link against a MPI library" OFF)

if(COLVARS_MPI)
find_package(MPI)
if(${MPI_FOUND})
include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH})
target_compile_options(colvars PRIVATE -DCOLVARS_MPI)
add_compile_options(-DCOLVARS_MPI)
target_link_libraries(colvars ${MPI_CXX_LIBRARIES})
set(COLVARS_MPI ON)
else()
if(NOT ${MPI_FOUND})
message(FATAL_ERROR "MPI not found.")
endif()
endif()
endif()


option(COLVARS_TCL "Link against the Tcl library" OFF)

if(COLVARS_TCL)
Expand Down
4 changes: 2 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all pdf html doxygen webpage webpage-legacy images \
install clean clean-all \
update-code-refs update-cvscript-cmdline-doc updates
update-code-refs update-cvscript-cmdline-doc updates update-version-list

ifeq ($(COLVARS_RELEASE),)
# Unless defined otherwise, the release label is the name of the branch
Expand Down Expand Up @@ -90,7 +90,7 @@ clean-all: clean
@echo
@echo "Note: only removed files that this branch is set to build."

version-list:
update-version-list:
./print_engine_versions.sh > ../README-versions.md

update-code-refs:
Expand Down
2 changes: 1 addition & 1 deletion doc/cv_version.tex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
\newcommand{\cvversion}{2024-09-17}
\newcommand{\cvversion}{2024-10-05}
46 changes: 35 additions & 11 deletions doc/print_engine_versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash

source ../devel-tools/version_functions.sh
TOPDIR=$(git rev-parse --show-toplevel)
if [ ! -d ${TOPDIR} ] ; then
echo "Error: cannot identify top project directory." >& 2
exit 1
fi

source ${TOPDIR}/devel-tools/version_functions.sh


reformat_lammps_version() {
Expand All @@ -18,20 +24,32 @@ print_tag_versions() {
local tag
local colvars_version
local lammps_version=""
for tag in $(git tag -l|grep ^${tag_prefix}); do

for tag in $(git tag -l | grep ^${tag_prefix}) ; do
local package_version=${tag#${tag_prefix}}
colvars_version=$(get_colvarmodule_version ${tag})
if [ ${package} = LAMMPS ] ; then
if [ ${package} == LAMMPS ] ; then
lammps_version=$(reformat_lammps_version ${package_version#*_})" "
fi
echo "${lammps_version}${package_version} | [${colvars_version}](https://github.com/Colvars/colvars/releases/tag/${tag})"
done

for branch in $(git branch -l --format='%(refname)' | sed -s 's/refs\/heads\///' | grep ^${tag_prefix}) ; do
local package_version=${branch#${tag_prefix}}
colvars_version=$(get_colvarmodule_version ${branch})
if [ ${package} == LAMMPS ] ; then
lammps_version=$(reformat_lammps_version ${package_version#*_})" "
fi
if [ ${package} == GROMACS ] ; then
if [ ${branch} == gromacs-2023 ] || [ ${branch} == gromacs-2022 ] ; then
# These branches do not reflect GROMACS standard releases
continue
fi
fi
echo "${lammps_version}${package_version} | [${colvars_version}](https://github.com/Colvars/colvars/tree/${branch})"
done
}

for package in LAMMPS NAMD VMD ; do
echo "[Versions included in ${package}](#versions-included-in-${package})"
echo
done

sort_versions(){
sort -r
Expand All @@ -43,18 +61,24 @@ sort_lammps_versions(){
}


for package in LAMMPS NAMD VMD ; do
for package in GROMACS LAMMPS NAMD VMD ; do
echo "[Versions included in ${package}](#versions-included-in-${package})"
echo
done


for package in GROMACS LAMMPS NAMD VMD ; do
echo "### Versions included in ${package}"
if [ ${package} = NAMD ] ; then
if [ ${package} == NAMD ] ; then
echo "(Note: the Colvars version included in NAMD 2.12 is the same as the one included in 2.12b1 with only bugfixes applied: therefore, NAMD 2.12 does not correspond to a specific version of the Colvars source tree)"
echo
fi
echo "${package} version | Colvars version"
echo "-------------- | ---------------"
sort_command=sort_versions
if [ ${package} = LAMMPS ] ; then
if [ ${package} == LAMMPS ] ; then
sort_command=sort_lammps_versions
fi
print_tag_versions ${package} $(echo ${package}- | tr '[:upper:]' '[:lower:]') | ${sort_command}
print_tag_versions ${package} ${package,,}- | ${sort_command}
echo
done
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions gromacs/CMakeLists.txt.diff
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70b0369bed..cccfe2aa1b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -678,6 +678,8 @@ include(gmxManageLmfit)

include(gmxManageMuparser)

+include(gmxManageLepton)
+
include(gmxManageColvars)

##################################################
37 changes: 18 additions & 19 deletions gromacs/cmake/gmxManageColvars.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ gmx_option_multichoice(GMX_USE_COLVARS
INTERNAL NONE)
mark_as_advanced(GMX_USE_COLVARS)

function(gmx_set_colvars_torch)
find_package(Torch)
if (Torch_FOUND)
message(STATUS "Torch found, enabling for Colvars")
set_property(TARGET colvars_objlib PROPERTY CXX_STANDARD 17)
target_compile_definitions(colvars_objlib PRIVATE -DTORCH)
target_compile_options(colvars_objlib PRIVATE ${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS})
target_include_directories(colvars_objlib PRIVATE ${TORCH_INCLUDE_DIRS})
target_link_libraries(libgromacs PRIVATE "${TORCH_LIBRARIES}")
endif()
endfunction()


function(gmx_manage_colvars)
if(GMX_USE_COLVARS STREQUAL "INTERNAL")

# Create an object library for the colvars sources
set(COLVARS_DIR "${CMAKE_SOURCE_DIR}/src/external/colvars")
file(GLOB COLVARS_SOURCES ${COLVARS_DIR}/*.cpp)
add_library(colvars_objlib OBJECT ${COLVARS_SOURCES})
if(GMX_LIB_MPI)
target_compile_definitions(colvars_objlib PRIVATE -DCOLVARS_MPI)
endif()
if(GMX_OPENMP)
target_link_libraries(colvars_objlib PRIVATE OpenMP::OpenMP_CXX)
endif()
if(GMX_TORCH)
target_compile_options(colvars_objlib PRIVATE ${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS})
target_include_directories(colvars_objlib PRIVATE ${TORCH_INCLUDE_DIRS})
target_compile_definitions(colvars_objlib PRIVATE -DCOLVARS_TORCH)
endif()

# Set correctly the value of __cplusplus, which MSVC doesn't do by default
target_compile_options(colvars_objlib PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>)
# Ensure that colvars_objlib can be used in both STATIC and SHARED libraries.
Expand All @@ -66,10 +66,11 @@ function(gmx_manage_colvars)
add_library(colvars INTERFACE)
target_sources(colvars INTERFACE $<TARGET_OBJECTS:colvars_objlib>)
target_include_directories(colvars SYSTEM INTERFACE $<BUILD_INTERFACE:${COLVARS_DIR}>)

if(GMX_OPENMP)
target_compile_options(colvars_objlib PRIVATE ${OpenMP_CXX_FLAGS})
target_link_libraries(colvars_objlib PRIVATE OpenMP::OpenMP_CXX)
if(GMX_LIB_MPI)
target_compile_definitions(colvars INTERFACE -DCOLVARS_MPI)
endif()
if(GMX_TORCH)
target_compile_definitions(colvars INTERFACE -DCOLVARS_TORCH)
endif()

set(GMX_HAVE_COLVARS 1 CACHE INTERNAL "Is colvars found?")
Expand All @@ -81,7 +82,5 @@ function(gmx_manage_colvars)

set(GMX_HAVE_COLVARS 0 CACHE INTERNAL "Is colvars found?")
endif()

gmx_set_colvars_torch()
mark_as_advanced(GMX_HAVE_COLVARS)
endfunction()
Empty file.
Empty file added gromacs/gromacs-mdmodules.patch
Empty file.
1 change: 0 additions & 1 deletion gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "gromacs/domdec/localatomsetmanager.h"
#include "gromacs/fileio/checkpoint.h"
#include "gromacs/mdrunutility/mdmodulesnotifiers.h"
#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/iforceprovider.h"
#include "gromacs/mdtypes/imdmodule.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ class ColvarsMDModule final : public IMDModule
* KeyValueTreeObjectBuilder as parameter
* - Acess topology using gmx_mtop_t notification
* - Access MDLogger for notifications output
* - Access warninp for for grompp warnings output
* - Access warning for for grompp warnings output
* - Coordinates, PBC and box for setting up the proxy
*/
void subscribeToPreProcessingNotifications(MDModulesNotifiers* notifier) override
Expand Down Expand Up @@ -192,6 +193,12 @@ class ColvarsMDModule final : public IMDModule
};
notifier->simulationSetupNotifier_.subscribe(setCommFunction);

// Retrieve the Multisim Record during simulations setup
const auto setMultisimFunction = [this](const gmx_multisim_t* ms) {
this->ColvarsSimulationsParameters_.setMultisim(ms);
};
notifier->simulationSetupNotifier_.subscribe(setMultisimFunction);

// setting the simulation time step
const auto setSimulationTimeStepFunction = [this](const SimulationTimeStep& simulationTimeStep) {
this->ColvarsSimulationsParameters_.setSimulationTimeStep(simulationTimeStep.delta_t);
Expand Down Expand Up @@ -251,6 +258,7 @@ class ColvarsMDModule final : public IMDModule
colvarsOptions_.colvarsSeed(),
ColvarsSimulationsParameters_.localAtomSetManager(),
ColvarsSimulationsParameters_.comm(),
ColvarsSimulationsParameters_.ms(),
ColvarsSimulationsParameters_.simulationTimeStep(),
colvarsOptions_.colvarsAtomCoords(),
colvarsOptions_.colvarsOutputPrefix(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "gromacs/math/vec.h"
#include "gromacs/mdlib/broadcaststructs.h"
#include "gromacs/mdlib/groupcoord.h"
#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/enerdata.h"
#include "gromacs/mdtypes/forceoutput.h"
Expand All @@ -65,6 +66,7 @@
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/keyvaluetree.h"
#include "gromacs/utility/keyvaluetreebuilder.h"
#include "gromacs/utility/smalloc.h"
Expand Down Expand Up @@ -173,6 +175,7 @@ ColvarsForceProvider::ColvarsForceProvider(const std::string& colvarsConfigStrin
int seed,
LocalAtomSetManager* localAtomSetManager,
const t_commrec* cr,
const gmx_multisim_t* ms,
double simulationTimeStep,
const std::vector<RVec>& colvarsCoords,
const std::string& outputPrefix,
Expand Down Expand Up @@ -236,6 +239,17 @@ ColvarsForceProvider::ColvarsForceProvider(const std::string& colvarsConfigStrin
snew(fColvars, nColvarsAtoms);
snew(xColvarsOldWhole, nColvarsAtoms);

#if GMX_MPI
if (MAIN(cr))
{
if (isMultiSim(ms))
{
colvarproxy::set_replicas_mpi_communicator(ms->mainRanksComm_);
}
}
#else
GMX_UNUSED_VALUE(ms);
#endif

// Check state status (did we read a cpt file?)
if (MAIN(cr))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

enum class PbcType : int;
struct t_commrec;
struct gmx_multisim_t;


namespace gmx
Expand Down Expand Up @@ -182,6 +183,7 @@ class ColvarsForceProvider final : public ColvarProxyGromacs, public IForceProvi
* \param[in] seed The colvars seed for random number generator
* \param[in] localAtomSetManager Atom Manager to retrieve Colvars index atoms
* \param[in] cr Communication Record
* \param[in] ms Multi-simulation record
* \param[in] simulationTimeStep The simulation time step
* \param[in] colvarsCoords The colvars atoms coordinates retrived from the TPR's KVT
* \param[in] outputPrefix The prefix for output colvars files
Expand All @@ -196,6 +198,7 @@ class ColvarsForceProvider final : public ColvarProxyGromacs, public IForceProvi
int seed,
LocalAtomSetManager* localAtomSetManager,
const t_commrec* cr,
const gmx_multisim_t* ms,
double simulationTimeStep,
const std::vector<RVec>& colvarsCoords,
const std::string& outputPrefix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ const t_commrec* ColvarsSimulationsParameters::comm() const
return cr_;
}

void ColvarsSimulationsParameters::setMultisim(const gmx_multisim_t* ms)
{
ms_ = ms;
}

const gmx_multisim_t* ColvarsSimulationsParameters::ms() const
{
return ms_;
}


void ColvarsSimulationsParameters::setLogger(const MDLogger& logger)
{
Expand Down
Loading

0 comments on commit 48657cb

Please sign in to comment.