Skip to content

Commit

Permalink
Merge branch 'master' into torchann
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpku committed Feb 22, 2024
2 parents 82ce569 + 9c25aeb commit 7e07b4a
Show file tree
Hide file tree
Showing 50 changed files with 2,102 additions and 2,713 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ jobs:
path: ${{ github.workspace }}/${{ inputs.test_interface_directory }}/*/*.diff

- name: Run regression tests for library code with ${{ inputs.backend_name }} (binary restarts)
if: ${{ inputs.test_lib_directory }}
# Skipping GROMACS, because its restarts are always binary anyway
if: inputs.test_lib_directory != '' && inputs.backend_name != 'GROMACS-main'
shell: bash
working-directory: ${{ inputs.test_lib_directory }}
env:
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/test-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,6 @@ jobs:
private_key: ${{ secrets.PULL_VMD_KEY }}
private_key_vmd_plugins: ${{ secrets.PULL_VMD_PLUGINS_KEY }}

gromacs-2022:
name: GROMACS (release-2022)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-2022
backend_repo: gromacs/gromacs
backend_repo_ref: release-2022
container_name: CentOS9-devel
path_compile_script: devel-tools/compile-gromacs.sh
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d

gromacs-2023:
name: GROMACS (release-2023)
uses: ./.github/workflows/backend-template.yml
Expand All @@ -94,7 +82,7 @@ jobs:
container_name: CentOS9-devel
path_compile_script: devel-tools/compile-gromacs.sh
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d
rpath_exe: install/bin/gmx_mpi_d

gromacs-main:
name: GROMACS (main)
Expand All @@ -106,4 +94,5 @@ jobs:
container_name: CentOS9-devel
path_compile_script: devel-tools/compile-gromacs.sh
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d
test_interface_directory: gromacs/tests/interface
rpath_exe: install/bin/gmx_mpi_d
15 changes: 11 additions & 4 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ jobs:
key: ${{ runner.os }}-build-asan-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-asan-

- name: Install build dependencies for library
run: |
sudo apt -y install tcl8.6-dev clang-14 clang-tools-14
- name: Checkout OpenMM (for Lepton library)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -430,6 +426,17 @@ jobs:
scl enable gcc-toolset-12 -- \
cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake
- name: GCC 13, C++20 (CentOS 9)
env:
CXX_STANDARD: 20
CXX: g++
CXX_VERSION: 13
CC: gcc
run: |
apptainer exec ${{github.workspace}}/devel-tools/CentOS9-devel.sif \
scl enable gcc-toolset-13 -- \
cmake -D CMAKE_CXX_STANDARD=${CXX_STANDARD} -P devel-tools/build_test_library.cmake
- name: Clang 16, C++11 (CentOS 9)
env:
CXX_STANDARD: 11
Expand Down
51 changes: 21 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# Collective variables module (Colvars)

A software module for molecular simulation and analysis that provides a high-performance implementation of sampling algorithms defined on a reduced space of continuously differentiable functions (aka collective variables).
A software library for molecular simulation and analysis that provides a high-performance implementation of sampling algorithms defined on a reduced space of continuously differentiable functions (aka collective variables).

First released in 2008 as part of the standard distribution of [NAMD](https://www.ks.uiuc.edu/Research/namd/) version 2.7b1, Colvars has also been integrated in [LAMMPS](https://lammps.sandia.gov/download.html), [VMD](https://www.ks.uiuc.edu/Research/vmd/), [GROMACS](http://www.gromacs.org/), and [Tinker-HP](https://tinker-hp.org/). In VMD, interactive use is possible both from the command line and through the [Dashboard](vmd/cv_dashboard/README.md) graphical user interface.

The functionality provided to those packages by the Colvars library includes a variety of functions and algorithms, including free-energy estimators based on thermodynamic forces, non-equilibrium work and probability distributions.
The functionality provided to those packages by Colvars includes a variety of functions and algorithms, including free-energy estimators based on thermodynamic forces, non-equilibrium work and probability distributions.

## Obtaining and using

The easiest way to obtain pre-compiled versions of Colvars is via one of following:
- the molecular simulation program [LAMMPS](https://lammps.sandia.gov/download.html);
- the molecular simulation program [NAMD](https://www.ks.uiuc.edu/Research/namd/);
- the molecular simulation program [Tinker-HP](https://tinker-hp.org/);
- the molecular visualization program [VMD](https://www.ks.uiuc.edu/Research/vmd/).
The easiest way to obtain pre-compiled versions of Colvars is via one of the following software packages:
- [GROMACS](https://manual.gromacs.org/)
- [LAMMPS](https://lammps.sandia.gov/download.html)
- [NAMD](https://www.ks.uiuc.edu/Research/namd/)
- [Tinker-HP](https://tinker-hp.org/)
- [VMD](https://www.ks.uiuc.edu/Research/vmd/)

Please check [here](https://github.com/Colvars/colvars/wiki/List-of-Colvars-versions-included-in-simulation-and-analysis-packages) to see which version of Colvars is included with the round-number or "stable" versions of each code.

For the molecular simulation program [GROMACS](http://www.gromacs.org/), code may be compiled via our Colvars-patched [releases](#gromacs-colvars-releases).

## Documentation

The [Colvars webpage](https://colvars.github.io/) includes user documentation for all codes, as well as a Doxygen-based [developer documentation](https://colvars.github.io/doxygen/html/).

To reflect the different availability of features in each engine, the Colvars reference manual comes in several flavors: [GROMACS](https://colvars.github.io/colvars-refman-gromacs/colvars-refman-gromacs.html) [LAMMPS](https://colvars.github.io/colvars-refman-lammps/colvars-refman-lammps.html) [NAMD](https://colvars.github.io/colvars-refman-namd/colvars-refman-namd.html) [Tinker-HP](https://colvars.github.io/colvars-refman-tinkerhp/colvars-refman-tinkerhp.html) [VMD](https://colvars.github.io/colvars-refman-vmd/colvars-refman-vmd.html)
To reflect the different availability of features in each engine, the Colvars reference manual comes in several flavors: [GROMACS](https://colvars.github.io/master/colvars-refman-gromacs.html) [LAMMPS](https://colvars.github.io/master/colvars-refman-lammps.html) [NAMD](https://colvars.github.io/master/colvars-refman-namd.html) [Tinker-HP](https://colvars.github.io/master/colvars-refman-tinkerhp.html) [VMD](https://colvars.github.io/master/colvars-refman-vmd.html)

## Citing

Expand Down Expand Up @@ -87,7 +86,7 @@ The [tests](https://github.com/Colvars/colvars/tree/master/tests?raw=true) folde

## Updating to the latest version

To recompile each program with the most recent version of the module, [download](https://github.com/Colvars/colvars/archive/master.zip) the `master` branch of this repository, or clone it via git:
To recompile each program with the most recent version of the library, [download](https://github.com/Colvars/colvars/archive/master.zip) the `master` branch of this repository, or clone it via git:
```
git clone https://github.com/Colvars/colvars.git
```
Expand All @@ -109,45 +108,37 @@ The `update-colvars-code.sh` script support patching the latest development vers

All of the above MD engine versions are automatically tested as part of GitHub Actions [workflows](https://github.com/Colvars/colvars/actions?query=branch%3Amaster).

## GROMACS-Colvars releases

Colvars can interface to GROMACS in two ways, depending on the version of GROMACS:
1. Using a customized `mdrun` command line (GROMACS releases up to 2023); source code is available as patched versions of past GROMACS releases [here](https://github.com/Colvars/gromacs/tags).
2. Using a standard `mdrun` command line (supported in the 2024-beta release); source code is available directly from the [GROMACS repository](https://github.com/gromacs/gromacs).

The standard GROMACS installation procedure is supported in either case.
## Legacy GROMACS-Colvars patched releases

To update the version of Colvars to GROMACS in a given release, the Colvars [patching procedure](#updating-to-the-latest-version) can be used. This procedure is generally compatible with all GROMACS versions from the same release years as those listed above. Please use the latest revision of each release series whenever possible.
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**".

When posting a message to the [Gromacs forum](https://gromacs.bioexcel.eu/) please use the [`colvars` tag](https://gromacs.bioexcel.eu/tag/colvars) and please salso specify "GROMACS modification: **Yes**" unless you are using a standard GROMACS.

If using a patched release, please also reference the Colvars version: this is included in the version string that is reported by the patched GROMACS (right after the GROMACS version), for example:
```
:-) GROMACS - gmx_d, 2021.5-Colvars-2022-02-20-dev (double precision) (-:
```

## Which version of Colvars is recommended?

The Git `master` branch is to be considered the "*stable*" release at any given time; any bugfixes are released through `master` first. The input syntax is near-completely *backward-compatible* and output files are *forward-compatible*. Feel free to download Colvars and update NAMD, VMD, LAMMPS, GROMACS, or Tinker-HP as needed.
The Git `master` branch is to be considered the "*stable*" release at any given time; any bugfixes are released through `master` first. The input syntax is near-completely *backward-compatible* and output files are *forward-compatible*. Feel free to download Colvars and update GROMACS, LAMMPS, NAMD, Tinker-HP or VMD as needed.

Other branches are dedicated to the development of specific features: please use them at your own discretion.


## Which version of Colvars is included in package XX version YY?

The specific version of Colvars is identified both in the code and in the documentation by the date of the most recent code revision (e.g. `2021-01-19`).
This date is printed to the standard output or log file as soon as Colvars is activated.

A table mapping software package release versions to Colvars versions is given [here](https://github.com/Colvars/colvars/wiki/List-of-Colvars-versions-included-in-simulation-and-analysis-packages).


If you are using a stable release of any of the codes mentioned above, feel free to use the version number of that code when asking questions.


## Feedback

Please use the "[Issues](https://github.com/Colvars/colvars/issues)" tab of this page to submit new bug reports or to suggest new features.
For usage questions, please start a new [Discussion](https://github.com/Colvars/colvars/discussions/new?category=q-a).

For bug reports or feature requests, use the "[Issues](https://github.com/Colvars/colvars/issues)" tab.


## License

This software is distributed under the GNU Lesser General Public License (LGPL), version 3. See COPYING.LESSER for complete licensing terms.
This software is distributed under the GNU Lesser General Public License version 3 (LGPLv3); see the file COPYING.LESSER for complete licensing terms.

In the interest of broad distribution, copies of this code are also distributed together with LAMMPS (LGPL version 2), NAMD and VMD (UIUC license). However, the terms of the LGPLv3 license still apply to code originating from this repository.
In the interest of broad distribution, copies of this code are also included in GROMACS (LGPLv2), LAMMPS (LGPLv2), NAMD and VMD (UIUC license); however, the terms of the LGPLv3 still apply to code originating from this repository.
46 changes: 29 additions & 17 deletions colvartools/plot_colvars_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Invoke this script with --help for documentation.

# Download link: https://github.com/Colvars/colvars/blob/master/colvartools/plot_colvars_traj.py?raw=true
# This version was modified on: 2023-07-13
# This version was modified on: 2024-01-16
# Contact: [email protected]

from __future__ import print_function
Expand Down Expand Up @@ -314,10 +314,10 @@ def as_pandas(self, keys=None):

parser.add_argument('--output-file',
type=str,
help='Write the selected variables to a text file. '
'The step number is always included as the first '
'column, and all variables '
'must be defined on the same trajectory segments.',
help="Write the selected variables to a file in NumPy format "
" (if the extension is .npz) or in text format otherwise. "
"The step number is included as the first column, and all variables "
"must be defined on the same trajectory segments.",
default=None)

parser.add_argument('--plot-file',
Expand Down Expand Up @@ -388,24 +388,36 @@ def as_pandas(self, keys=None):
plot_keys = dict(zip(variables, variables))


if (args.output_file):
if args.output_file:

fmt = " %12d"
columns = [colvars_traj[variables[0]].steps]
output_file = args.output_file
numpy_format = False
if output_file.endswith(".npz"):
numpy_format = True
if output_file == '-':
output_file = sys.stdout

text_fmt_string = " %12d"
if numpy_format:
columns = { 'step' : colvars_traj[variables[0]].steps }
else:
columns = [colvars_traj[variables[0]].steps]
for var in variables:
cv = colvars_traj[var]
for ic in range(cv.num_dimensions):
y = cv.values
if (cv.num_dimensions > 1):
if cv.num_dimensions > 1 and not numpy_format:
y = cv.values[:,ic]
columns += [y]
fmt += " %21.14f"
columns = tuple(columns)
output_file = args.output_file
if (output_file == '-'): output_file = sys.stdout
np.savetxt(fname=output_file,
X=list(zip(*columns)),
fmt=str(fmt))
if numpy_format:
columns[var] = y
else:
columns += [y]
text_fmt_string += " %21.14f"

if numpy_format:
np.savez(output_file, **columns)
else:
np.savetxt(fname=output_file, X=np.column_stack(columns), fmt=str(text_fmt_string))

else:

Expand Down
7 changes: 7 additions & 0 deletions devel-tools/build_test_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ if(COLVARS_LEPTON)
if(NOT DEFINED LEPTON_DIR)
set(LEPTON_DIR "${COLVARS_SOURCE_DIR}/openmm-source/libraries/lepton")
if(NOT EXISTS ${LEPTON_DIR})
# Try the parent folder
get_filename_component(LEPTON_DIR ${COLVARS_SOURCE_DIR} DIRECTORY)
set(LEPTON_DIR "${LEPTON_DIR}/openmm-source/libraries/lepton")
endif()
if(NOT EXISTS ${LEPTON_DIR})
# Giving up, cloning OpenMM into a sub-folder
execute_process(COMMAND git clone --depth=1 https://github.com/openmm/openmm.git "${COLVARS_SOURCE_DIR}/openmm-source")
set(LEPTON_DIR "${COLVARS_SOURCE_DIR}/openmm-source/libraries/lepton")
endif()
message(STATUS "Using Lepton library from: ${LEPTON_DIR}")
endif()
Expand Down
2 changes: 2 additions & 0 deletions devel-tools/compile-gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ source $(dirname $0)/load-recent-git.sh

source $(dirname $0)/load-recent-gcc.sh

source $(dirname $0)/load-openmpi.sh

source $(dirname $0)/set-ccache.sh


Expand Down
17 changes: 3 additions & 14 deletions devel-tools/compile-namd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ if [ -n "${CCACHE_HOME}" ] ; then
export PATH=${CCACHE_HOME}:${PATH}
fi

# Save path to be used later
devel_tools_folder=$(realpath $(dirname $0))
if [ -e /opt/tcl/8.6/include/tcl.h ] ; then
export TCL_HOME=/opt/tcl/8.6
fi


compile_namd_target() {
Expand Down Expand Up @@ -77,18 +78,6 @@ EOF
cmd+=(--charm-arch netlrts-linux-x86_64)
fi

if grep -q -- -ltcl8.6 arch/Linux-x86_64.tcl ; then
if [ -d ${devel_tools_folder}/packages/tcl8.6.13-linux-x86_64-threaded ] ; then
export TCL_HOME=${devel_tools_folder}/packages/tcl8.6.13-linux-x86_64-threaded
fi
else
# Amend NAMD 2.x arch file for recent Tcl versions under RH and Debian paths
if [ -f /usr/lib64/libtcl8.6.so ] || \
[ -f /usr/lib/x86_64-linux-gnu/libtcl8.6.so ] ; then
sed -i 's/-ltcl8.5/-ltcl8.6/' arch/Linux-x86_64.tcl
fi
fi

if [ -z "${TCL_HOME}" ] ; then
if [ -f /usr/local/include/tcl.h ] ; then
export TCL_HOME=/usr/local
Expand Down
16 changes: 0 additions & 16 deletions gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff

This file was deleted.

Empty file.
Empty file.
Loading

0 comments on commit 7e07b4a

Please sign in to comment.