Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpku committed Dec 11, 2023
2 parents ba18c36 + f8ed169 commit a244537
Show file tree
Hide file tree
Showing 86 changed files with 900 additions and 623 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ jobs:
test_backends:
runs-on: ubuntu-latest
env:
CCACHE_DIR: ${{ github.workspace }}/ccache_${{ inputs.container_name }}
# Silence OpenMPI warnings
PSM3_MULTI_EP: 1
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 All @@ -78,7 +79,7 @@ jobs:
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/ccache_${{ inputs.container_name }}
~/ccache_${{ inputs.container_name }}
key: ${{ runner.os }}-build-${{ inputs.backend_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ inputs.backend_name }}-
Expand Down Expand Up @@ -126,18 +127,19 @@ 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
env:
OPENMM_SOURCE: ${{ github.workspace }}/openmm-source
CMAKE_GENERATOR: Ninja
run: |
apptainer exec devel-tools/${{ inputs.container_name }}.sif ./update-colvars-code.sh -f ${{ inputs.backend_name }}-source
apptainer exec devel-tools/${{ inputs.container_name }}.sif \
bash ${{ inputs.path_compile_script }} ${{ inputs.backend_name }}-source
./update-colvars-code.sh -f ${{ inputs.backend_name }}-source
mkdir -p ${CCACHE_DIR}
apptainer exec devel-tools/${{ inputs.container_name }}.sif \
bash ${{ inputs.path_compile_script }} ${{ inputs.backend_name }}-source
# 2 types of tests can be performed with the MD engine: library & interface
Expand Down
66 changes: 14 additions & 52 deletions .github/workflows/test-backends.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "Backends"

on: [push, pull_request]
on:
push:


# These jobs call a template workflow `backend-template.yml`, which performs
# all the necessary steps to run the regression tests of the backend.
Expand All @@ -18,11 +20,8 @@ env:

jobs:

lammps:
name: LAMMPS
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-lammps') || github.event.base_ref == 'refs/heads/master'))
lammps-develop:
name: LAMMPS (develop)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: LAMMPS
Expand All @@ -34,56 +33,28 @@ 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
if: |
(github.event_name == 'pull_request' && github.repository_owner == github.event.pull_request.head.repo.owner.login) ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-namd') || github.event.base_ref == 'refs/heads/master'))
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
if: |
(github.event_name == 'pull_request' && github.repository_owner == github.event.pull_request.head.repo.owner.login) ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-namd') || github.event.base_ref == 'refs/heads/master'))
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
# Interface tests disabled until map variables are merged into NAMD3
# test_interface_directory: namd/tests/interface
test_interface_directory: namd/tests/interface
rpath_exe: Linux-x86_64-g++.mpi/namd3
container_name: CentOS7-devel
secrets:
# 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
if: |
(github.event_name == 'pull_request' && github.repository_owner == github.event.pull_request.head.repo.owner.login) ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-vmd') || github.event.base_ref == 'refs/heads/master'))
uses: ./.github/workflows/backend-template.yml
with:
backend_name: VMD
Expand All @@ -102,10 +73,7 @@ jobs:
private_key_vmd_plugins: ${{ secrets.PULL_VMD_PLUGINS_KEY }}

gromacs-2022:
name: GROMACS 2022
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-gromacs') || github.event.base_ref == 'refs/heads/master'))
name: GROMACS (release-2022)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-2022
Expand All @@ -117,10 +85,7 @@ jobs:
rpath_exe: install/bin/gmx_d

gromacs-2023:
name: GROMACS 2023
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-gromacs') || github.event.base_ref == 'refs/heads/master'))
name: GROMACS (release-2023)
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-2023
Expand All @@ -131,14 +96,11 @@ jobs:
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d

gromacs-devel:
name: GROMACS (MDModules)
if: |
(github.event_name == 'pull_request') ||
(github.event_name == 'push' && (contains(github.event.head_commit.message, 'test-gromacs') || github.event.base_ref == 'refs/heads/master'))
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
Expand Down
42 changes: 35 additions & 7 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Library"

on: [push, pull_request]
on:
push:


jobs:
Expand All @@ -9,7 +10,6 @@ jobs:

name: Basic checks
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
outputs:
hassecrets: ${{ steps.checksecrets.outputs.hassecrets }}
env:
Expand Down Expand Up @@ -84,6 +84,13 @@ jobs:
- name: Print ccache stats
run: ccache -s -v

- name: Keep only one cache besides the one from this job
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
bash ${{ github.workspace }}/devel-tools/cleanup-gh-cache.sh ${{ runner.os }}-build-basic-
build-doc:
name: Build documentation
Expand All @@ -109,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: |
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
run: apptainer exec ${{ github.workspace }}/devel-tools/texlive.sif make
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 @@ -267,7 +298,6 @@ jobs:
name: Linux x86_64 (GCC, Clang)
runs-on: ubuntu-latest
needs: basicchecks
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
CCACHE: ccache
CMAKE_GENERATOR: Ninja
Expand Down Expand Up @@ -478,7 +508,6 @@ jobs:
name: Windows x86_64 (MSVC)
runs-on: windows-latest
needs: basicchecks
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:

Expand All @@ -500,7 +529,6 @@ jobs:
name: macOS x86_64 (AppleClang)
runs-on: macos-latest
needs: basicchecks
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

steps:

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
4 changes: 2 additions & 2 deletions devel-tools/cleanup-gh-cache.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

key=${1:-key Linux-build-}
key=${1:-Linux-build-}

if [ -z "${key}" ] ; then
echo "Error: please specify a cache key as argument." >& 2
Expand All @@ -9,7 +9,7 @@ fi

gh actions-cache --help >& /dev/null || gh extension install actions/gh-actions-cache

# Keep at least one cache for each branch
# Keep at most one cache for each branch
branches=$(gh actions-cache list --key ${key} | cut -f 3 | uniq)
for branch in ${branches} ; do
caches=($(gh actions-cache list --key ${key} --branch ${branch} | cut -f 1))
Expand Down
4 changes: 2 additions & 2 deletions devel-tools/compile-gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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 +60,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
8 changes: 5 additions & 3 deletions devel-tools/compile-lammps.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash

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

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

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


compile_lammps_target() {

Expand Down Expand Up @@ -75,6 +73,10 @@ compile_lammps_target() {

LAMMPS_BUILD_OPTS+=("-DPKG_PYTHON=on")

if hash ccache >& /dev/null ; then
LAMMPS_BUILD_OPTS+=(-DCMAKE_{CXX,CC}_COMPILER_LAUNCHER=ccache)
fi

if hash ninja >& /dev/null ; then
LAMMPS_BUILD_OPTS+=("-G" "Ninja")
fi
Expand Down
Loading

0 comments on commit a244537

Please sign in to comment.