Skip to content

Commit

Permalink
Merge branch 'master' into new_abf_for_merging
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin committed Jan 17, 2024
2 parents 2b3f2a2 + c2bdeb9 commit 0573ac2
Show file tree
Hide file tree
Showing 107 changed files with 2,495 additions and 3,001 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
runs-on: ubuntu-latest
env:
CCACHE_DIR: ~/ccache_${{ inputs.container_name }}
# OpenMPI transport settings suitable for GH VMs
OMPI_MCA_mtl: "^ofi"
OMPI_MCA_btl: "vader,self"

steps:
- name: Checkout Colvars
Expand Down Expand Up @@ -124,8 +127,7 @@ jobs:
shell: bash
working-directory: devel-tools
run: |
apptainer pull CentOS7-devel.sif oras://ghcr.io/Colvars/devel-containers:CentOS7-devel
apptainer pull CentOS9-devel.sif oras://ghcr.io/Colvars/devel-containers:CentOS9-devel
apptainer pull ${{ inputs.container_name }}.sif oras://ghcr.io/Colvars/devel-containers:${{ inputs.container_name }}
- name: Update and build ${{ inputs.backend_name }}
shell: bash
Expand Down
45 changes: 14 additions & 31 deletions .github/workflows/test-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ env:

jobs:

lammps:
name: LAMMPS
lammps-develop:
name: LAMMPS (develop)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: LAMMPS
Expand All @@ -33,32 +33,14 @@ jobs:
test_interface_directory: lammps/tests/interface
rpath_exe: install/bin/lmp

namd:
name: NAMD
namd-devel:
name: NAMD (devel)
# Prevent running this job on PRs across different accounts, because
# secrets wouldn't be shared
uses: ./.github/workflows/backend-template.yml
with:
backend_name: NAMD
backend_repo: Colvars/namd
backend_repo_ref: master
container_name: CentOS7-devel
path_compile_script: devel-tools/compile-namd.sh
test_lib_directory: namd/tests/library
test_interface_directory: namd/tests/interface
rpath_exe: Linux-x86_64-g++.mpi/namd2
secrets:
# Choice of license by UIUC prevents sharing the code, hence the secret
private_key: ${{ secrets.PULL_NAMD_KEY }}

namd3:
name: NAMD3 (no CUDA)
# Prevent running this job on PRs across different accounts, because
# secrets wouldn't be shared
uses: ./.github/workflows/backend-template.yml
with:
backend_name: NAMD3
backend_repo: Colvars/namd
backend_repo_ref: devel
path_compile_script: devel-tools/compile-namd.sh
test_lib_directory: namd/tests/library
Expand All @@ -69,7 +51,7 @@ jobs:
# Choice of license by UIUC prevents sharing the code, hence the secret
private_key: ${{ secrets.PULL_NAMD_KEY }}

vmd:
vmd-cvs:
name: VMD
# Prevent running this job on PRs across different accounts, because
# secrets wouldn't be shared
Expand All @@ -91,7 +73,7 @@ jobs:
private_key_vmd_plugins: ${{ secrets.PULL_VMD_PLUGINS_KEY }}

gromacs-2022:
name: GROMACS 2022
name: GROMACS (release-2022)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-2022
Expand All @@ -100,10 +82,10 @@ 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-2023:
name: GROMACS 2023
name: GROMACS (release-2023)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-2023
Expand All @@ -112,16 +94,17 @@ 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-devel:
name: GROMACS (MDModules)
gromacs-main:
name: GROMACS (main)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-devel
backend_name: GROMACS-main
backend_repo: gromacs/gromacs
backend_repo_ref: main
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
43 changes: 37 additions & 6 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,36 @@ jobs:
- name: Checkout website repository
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.PULL_PUSH_COLVARS_GITHUB_IO }}
repository: 'Colvars/colvars.github.io'
path: 'website'

- name: Build doc
- name: Build doc for current branch
working-directory: doc
run: apptainer exec ${{ github.workspace }}/devel-tools/texlive.sif make
run: |
make clean-all
apptainer exec ${{ github.workspace }}/devel-tools/texlive.sif make
- name: Install SSH key for access to website repository
if: contains(github.event.head_commit.message, '[update-doc]')
env:
WEBSITE_SSH_KEY: ${{ secrets.PULL_PUSH_COLVARS_GITHUB_IO }}
run: |
mkdir -p -m 700 ~/.ssh
echo "${WEBSITE_SSH_KEY}" > ~/.ssh/website
chmod 600 ~/.ssh/website
- name: Push updated doc to website repository
working-directory: doc
if: contains(github.event.head_commit.message, '[update-doc]')
env:
COLVARS_WEBSITE_TREE: ${{ github.workspace }}/website
run: |
apptainer exec ${{ github.workspace }}/devel-tools/texlive.sif make install
export GIT_SSH="ssh -i ~/.ssh/website"
git config --global user.email "[email protected]"
git config --global user.name "CI runner"
bash update_website.sh ${{ github.workspace }}/website
codeql:
Expand Down Expand Up @@ -222,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 @@ -406,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
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

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).

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) and [VMD](https://www.ks.uiuc.edu/Research/vmd/). In VMD, interactive use is possible both from the command line and through the [Dashboard](vmd/cv_dashboard/README.md) graphical user interface.
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.

Patched [releases](https://github.com/Colvars/gromacs) of [GROMACS](http://www.gromacs.org/) that contain Colvars are also available ([see below](#gromacs-colvars-releases)).

The functionality provided 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 the Colvars library 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/).

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.
Expand All @@ -21,9 +20,9 @@ For the molecular simulation program [GROMACS](http://www.gromacs.org/), code ma

## Documentation

The [Colvars webpage](https://colvars.github.io/) includes user documentation for the four codes, as well as a Doxygen-based [developer documentation](https://colvars.github.io/doxygen/html/).
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) [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/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)

## Citing

Expand Down Expand Up @@ -52,10 +51,13 @@ cv configfile <Colvars configuration file>
```
fix Colvars all colvars configfile <Colvars configuration file>
```
- In GROMACS:
- In GROMACS 2024 and later (mdp file):
```
gmx mdrun -s topol.tpr -deffnm topol -colvars <Colvars configuration file>
colvars-active = yes
colvars-configfile = my_config.colvars
```
- In Tinker-HP:
Create a Colvars configuration file with the same prefix as the `.key` file, and the extension `.colvars`.

The contents of the configuration file are typically the same across all programs, for example:
```
Expand Down Expand Up @@ -100,7 +102,7 @@ and run the provided `update-colvars-code.sh` script against the unpacked source
and recompile them.

The `update-colvars-code.sh` script support patching the latest development version of each program:
- [GROMACS](https://github.com/gromacs/gromacs);
- [GROMACS](https://gitlab.com/gromacs/gromacs);
- [LAMMPS](https://github.com/lammps/lammps);
- [NAMD](https://gitlab.com/tcbgUIUC/namd);
- [VMD and its plugins](https://www.ks.uiuc.edu/Research/vmd/doxygen/cvsget.html); note that starting from Colvars version 2023-06-23, some updates are needed to the VMD build script (see [here](https://colvars.github.io/README-c++11.html) for details).
Expand All @@ -126,7 +128,7 @@ If using a patched release, please also reference the Colvars version: this is i

## 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 or GROMACS 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 NAMD, VMD, LAMMPS, GROMACS, or Tinker-HP as needed.

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

Expand Down
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
6 changes: 4 additions & 2 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 Expand Up @@ -49,7 +51,7 @@ compile_gromacs_target() {
if [ "${1,,}" = "debug" ]; then
GMX_BUILD_TYPE=Debug
GMX_BUILD_OPTS+=(-DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=yes)
GMX_BUILD_OPTS+=(-DCOLVARS_DEBUG)
GMX_BUILD_OPTS+=(-DCOLVARS_DEBUG=ON)
else
GMX_INSTALL_DIR=${1}
fi
Expand All @@ -60,7 +62,7 @@ compile_gromacs_target() {
GMX_BUILD_OPTS+=("-DGMX_MPI=ON")
fi

# GMX_BUILD_OPTS+=("-DBUILD_OMP=yes")
GMX_BUILD_OPTS+=("-DGMX_OPENMP=yes")

# Select FFT
if [ "$(basename \"${CXX}\")" = "icpc" ] ; then
Expand Down
Loading

0 comments on commit 0573ac2

Please sign in to comment.