Skip to content

Commit

Permalink
conflict resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang committed Oct 16, 2023
2 parents 4b6ba2f + 7b12838 commit 26b6868
Show file tree
Hide file tree
Showing 331 changed files with 12,720 additions and 6,626 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/backend-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ jobs:
restore-keys: |
${{ runner.os }}-build-${{ inputs.backend_name }}-
# Using an exact key to forgo saving it in case of a match (tarring up
# is expensive); also including a date to allow a force-update.
- name: Load containers cache
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-2023-09-05

- name: Checkout OpenMM (for Lepton library)
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -132,12 +124,8 @@ jobs:
shell: bash
working-directory: devel-tools
run: |
# Pull all containers used to build backends
# (contains build tools, OpenMPI, FFTW, Tcl/Tk and Charm++)
apptainer remote status SylabsCloud || apptainer remote add --no-login SylabsCloud cloud.sylabs.io
apptainer remote use SylabsCloud
apptainer pull CentOS7-devel.sif library://giacomofiorin/default/colvars_development:centos7
apptainer pull CentOS9-devel.sif library://giacomofiorin/default/colvars_development:centos9
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
- name: Update and build ${{ inputs.backend_name }}
shell: bash
Expand All @@ -162,10 +150,34 @@ jobs:
apptainer exec ${{github.workspace}}/devel-tools/${{ inputs.container_name }}.sif \
./run_tests.sh ${{github.workspace}}/${{ inputs.backend_name }}-source/${{ inputs.rpath_exe }} 0??_*
- name: Save failed library test artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: failed-library-test-diffs-${{ inputs.backend_name }}
path: ${{ github.workspace }}/${{ inputs.test_lib_directory }}/*/*.diff

- name: Run regression tests for ${{ inputs.backend_name }} interface code
if: ${{ inputs.test_interface_directory }}
shell: bash
working-directory: ${{ inputs.test_interface_directory }}
run: |
apptainer exec ${{github.workspace}}/devel-tools/${{ inputs.container_name }}.sif \
./run_tests.sh ${{github.workspace}}/${{ inputs.backend_name }}-source/${{ inputs.rpath_exe }}
- name: Save failed interface test artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: failed-interface-test-diffs-${{ inputs.backend_name }}
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 }}
shell: bash
working-directory: ${{ inputs.test_lib_directory }}
env:
COLVARS_BINARY_RESTART: 1
run: |
apptainer exec ${{github.workspace}}/devel-tools/${{ inputs.container_name }}.sif \
./run_tests.sh ${{github.workspace}}/${{ inputs.backend_name }}-source/${{ inputs.rpath_exe }} 0??_*
26 changes: 13 additions & 13 deletions .github/workflows/test-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,6 @@ jobs:
private_key: ${{ secrets.PULL_VMD_KEY }}
private_key_vmd_plugins: ${{ secrets.PULL_VMD_PLUGINS_KEY }}

gromacs-2021:
name: GROMACS 2021
if: github.event_name == 'pull_request' || contains(github.event.head_commit.message, 'test-gromacs-2021')
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-2021
backend_repo: gromacs/gromacs
backend_repo_ref: release-2021
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-2022:
name: GROMACS 2022
if: github.event_name == 'pull_request' || contains(github.event.head_commit.message, 'test-gromacs-2022')
Expand All @@ -137,3 +124,16 @@ jobs:
path_compile_script: devel-tools/compile-gromacs.sh
test_lib_directory: gromacs/tests/library
rpath_exe: install/bin/gmx_d

gromacs-devel:
name: GROMACS (MDModules)
if: github.event_name == 'pull_request' || contains(github.event.head_commit.message, 'test-gromacs-devel')
uses: ./.github/workflows/backend-template.yml
with:
backend_name: GROMACS-devel
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
39 changes: 6 additions & 33 deletions .github/workflows/test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Load containers cache
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-doc-2023-07-19

- name: Install Apptainer
shell: bash
run: |
Expand All @@ -110,9 +104,7 @@ jobs:
shell: bash
working-directory: devel-tools
run: |
apptainer remote status SylabsCloud || apptainer remote add --no-login SylabsCloud cloud.sylabs.io
apptainer remote use SylabsCloud
apptainer pull texlive.sif library://giacomofiorin/default/colvars_development:texlive
apptainer pull texlive.sif oras://ghcr.io/Colvars/devel-containers:texlive
- name: Checkout website repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -228,14 +220,6 @@ jobs:
key: ${{ runner.os }}-build-multiple-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-multiple-

# Using an exact key to forgo saving it in case of a match (tarring up
# is expensive); also including a date to allow a force-update.
- name: Load containers cache
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-2023-09-05

- name: Get small downloadable packages
uses: actions/checkout@v3
with:
Expand All @@ -250,14 +234,12 @@ jobs:
sudo apt update
sudo apt install -y apptainer-suid
- name: Get container image
- name: Get container images for build dependencies
shell: bash
working-directory: devel-tools
run: |
apptainer remote status SylabsCloud || apptainer remote add --no-login SylabsCloud cloud.sylabs.io
apptainer remote use SylabsCloud
apptainer pull CentOS7-devel.sif library://giacomofiorin/default/colvars_development:centos7
apptainer pull CentOS9-devel.sif library://giacomofiorin/default/colvars_development:centos9
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
- name: GCC 4.8, C++11 (CentOS 7)
env:
Expand Down Expand Up @@ -384,12 +366,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Load containers cache
uses: actions/cache@v3
with:
path: ~/.apptainer
key: Linux-x86_64-containers-build-2023-09-05

- name: Checkout Sun compiler (Oracle Developer Studio)
uses: actions/checkout@v3
with:
Expand All @@ -412,14 +388,11 @@ jobs:
sudo apt update
sudo apt install -y apptainer-suid
- name: Get container image
- name: Get container images for build dependencies
shell: bash
working-directory: devel-tools
run: |
apptainer remote status SylabsCloud || apptainer remote add --no-login SylabsCloud cloud.sylabs.io
apptainer remote use SylabsCloud
apptainer pull CentOS7-devel.sif library://giacomofiorin/default/colvars_development:centos7
apptainer pull CentOS9-devel.sif library://giacomofiorin/default/colvars_development:centos9
apptainer pull CentOS7-devel.sif oras://ghcr.io/Colvars/devel-containers:CentOS7-devel
- name: Build library with Sun compiler (Oracle Developer Studio)
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if(COLVARS_DEBUG)
endif()

option(ENABLE_COVERAGE "Enable code coverage reporting" ON)
if(ENABLE_COVERAGE AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "SunPro"))
if(ENABLE_COVERAGE AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "SunPro") AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
target_compile_options(colvars PUBLIC --coverage)
target_link_options(colvars PUBLIC --coverage)
endif()
Expand Down
8 changes: 5 additions & 3 deletions colvartools/plot_colvars_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self, name):
self._name = name
self._step = np.zeros(shape=(0), dtype=np.int64)
self._colvar = np.zeros(shape=(0), dtype=np.float64)
self._warned_dimensions = False

def __len__(self):
"""Returns the length of the trajectory"""
Expand All @@ -40,11 +41,12 @@ def __str__(self):

def _set_num_dimensions(self, n_d):
"""Set the number of components of the collective variable"""
if (len(self) > 0):
if len(self) > 0 and not self._warned_dimensions:
print("Warning: changing the number of dimensions "
"of collective variable \""+self._name+
"of collective variable \""+self._name +
"\" after it has already been read.")
if (n_d > 1):
self._warned_dimensions = True
if n_d > 1:
self._colvar.resize((len(self), n_d))
else:
self._colvar.resize((len(self)))
Expand Down
1 change: 1 addition & 0 deletions colvartools/poisson_integrator.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <iostream>
#include <fstream>

#include "colvargrid.h"
Expand Down
4 changes: 2 additions & 2 deletions devel-tools/build_test_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ if(DEFINED CMAKE_SYSTEM_NAME AND COLVARS_TCL)

if(EXISTS "${COLVARS_SOURCE_DIR}/devel-tools/packages")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.5.9-linux-x86_64")
set(TCL_LIBRARY "libtcl8.5.a")
set(TCL_DIR "${COLVARS_SOURCE_DIR}/devel-tools/packages/tcl8.6.13-linux-x86_64-threaded")
set(TCL_LIBRARY "libtcl8.6.a")
endif()

if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
Expand Down
28 changes: 15 additions & 13 deletions devel-tools/compile-gromacs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ source $(dirname $0)/set-ccache.sh

compile_gromacs_target() {

if [ -n "${GROMACS_REGRESSION_TESTS}" ] ; then
export GROMACS_BUILD_TESTS=1
fi

local CMAKE=cmake CTEST=ctest
if hash cmake3 >& /dev/null ; then
CMAKE=cmake3
Expand Down Expand Up @@ -68,8 +72,9 @@ compile_gromacs_target() {
fi
fi

# When on GitHub Actions, download the tests as well
# When on GitHub Actions, build the tests as well
if [ -n "${GITHUB_ACTION}" ] ; then
export GROMACS_BUILD_TESTS=1
GMX_BUILD_OPTS+=(-DREGRESSIONTEST_DOWNLOAD=ON)
fi

Expand Down Expand Up @@ -98,25 +103,22 @@ compile_gromacs_target() {
${CMAKE} --build "${GMX_BUILD_DIR}" --parallel $(nproc --all)
ret_code=$?

if [ -n "${GROMACS_REGRESSION_TESTS}" ] ; then
if [ -n "${GROMACS_BUILD_TESTS}" ] ; then
# Build the tests as well
${CMAKE} --build "${GMX_BUILD_DIR}" --target tests --parallel $(nproc --all)
ret_code=$((${ret_code} || $?))
fi

if [ ${ret_code} = 0 ] ; then
pushd "${GMX_BUILD_DIR}"
${CTEST} --output-on-failure
retcode=$?
if [ -n "${GMX_INSTALL_DIR}" ] ; then
if hash ninja >& /dev/null ; then
ninja install
else
make install
fi
ret_code=$((${ret_code} || $?))
if [ -n "${GROMACS_BUILD_TESTS}" ] && [ -z "${GITHUB_ACTION}" ] ; then
# Some GROMACS tests are extremely long, we run them only offline
pushd "${GMX_BUILD_DIR}"
${CTEST} --output-on-failure
retcode=$((${ret_code} || $?))
popd
fi
popd
${CMAKE} --install "${GMX_BUILD_DIR}"
ret_code=$((${ret_code} || $?))
fi

popd
Expand Down
32 changes: 25 additions & 7 deletions devel-tools/compile-namd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source $(dirname $0)/load-recent-git.sh

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

# Save path to be used later
devel_tools_folder=$(realpath $(dirname $0))


compile_namd_target() {

Expand Down Expand Up @@ -64,13 +67,28 @@ EOF
cmd+=(--charm-arch netlrts-linux-x86_64)
fi

# Quick check for more recent Tcl using 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
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
else
export TCL_HOME=/usr
fi
fi

cmd+=(--tcl-prefix ${TCL_HOME:-/usr})
cmd+=(--tcl-prefix ${TCL_HOME})

cmd+=(--with-fftw3 --fftw-prefix ${FFTW_HOME:-/usr})

local python_version=$(python3 --version 2> /dev/null | cut -d' ' -f 2)
Expand All @@ -83,10 +101,10 @@ EOF

eval ${cmd[@]}

if pushd ${dirname} ; then
if pushd ${dirname} ; then
make -j$(nproc --all)
ret_code=$?
popd
popd
else
ret_code=1
fi
Expand Down
15 changes: 13 additions & 2 deletions devel-tools/containers/CentOS7-devel.def
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ From: centos:7
yum -y update
yum -y install epel-release centos-release-scl
yum -y install \
redhat-lsb-core "@Development Tools" \
ncurses which bc man-db vim emacs screen tmux \
redhat-lsb-core \
bc man-db vim emacs tcsh which bash-completion screen tmux \
"@Development Tools" \
gcc gcc-c++ gcc-gfortran glibc-static libstdc++-static clang cppcheck \
autoconf automake cvs git git-cvs cvsps subversion mercurial \
rh-git227 devtoolset-{7..11} llvm-toolset-7 cmake3 ccache ninja-build \
Expand Down Expand Up @@ -55,3 +56,13 @@ EOF
git clone https://github.com/jhenin/spiff /tmp/spiff && \
make -C /tmp/spiff && \
install /tmp/spiff/spiff /usr/local/bin/

# Install Tcl 8.6 to support newer NAMD versions
cd /tmp && \
rm -f tcl8.6.13-linux-x86_64-threaded.tar.gz && \
curl -O https://www.ks.uiuc.edu/Research/namd/libraries/tcl8.6.13-linux-x86_64-threaded.tar.gz && \
tar xzf tcl8.6.13-linux-x86_64-threaded.tar.gz && \
cd tcl8.6.13-linux-x86_64-threaded && \
find . -type f -exec install -v -D "{}" "/opt/tcl/8.6/{}" \; && \
cd && \
rm -fr /tmp/tcl8.6.13-linux-x86_64-threaded /tmp/tcl8.6.13-linux-x86_64-threaded.tar.gz
6 changes: 6 additions & 0 deletions devel-tools/load-openmpi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
if declare -f module >& /dev/null ; then
# Ensure that Lmod is properly initialized
source /etc/profile
# Default modulefile in OpenMPI RPM package
if module load mpi/openmpi-x86_64 >& /dev/null ; then
echo "Loaded OpenMPI version $(mpirun --version | head -n 1 | rev | cut -d' ' -f1 | rev)"
if ompi_info --param btl vader | grep -q vader ; then
# Enforce intra-node communication on recent OpenMPI versions
export OMPI_MCA_btl="vader,self"
fi
fi
fi
Loading

0 comments on commit 26b6868

Please sign in to comment.