Skip to content

Commit

Permalink
Merge pull request #73 from peastman/cuda
Browse files Browse the repository at this point in the history
Fix failing CI builds
  • Loading branch information
peastman authored Nov 8, 2023
2 parents c54094d + 81f7a02 commit 66873f7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ENDIF(PLUMED_BUILD_CUDA_LIB)
# Build the Python API

FIND_PROGRAM(PYTHON_EXECUTABLE python)
FIND_PROGRAM(PIP_EXECUTABLE pip)
FIND_PROGRAM(SWIG_EXECUTABLE swig)
IF(PYTHON_EXECUTABLE AND SWIG_EXECUTABLE)
SET(PLUMED_BUILD_PYTHON_WRAPPERS ON CACHE BOOL "Build wrappers for Python")
Expand Down
8 changes: 3 additions & 5 deletions devtools/scripts/install_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ set -euxo pipefail
# Enable retrying
echo 'APT::Acquire::Retries "5";' | sudo tee /etc/apt/apt.conf.d/80-retries

sudo wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries 5 \
-O /etc/apt/preferences.d/cuda-repository-pin-600 \
https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-key del 7fa2af80
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update -qq

CUDA_APT=${CUDA_VERSION/./-}
Expand Down
4 changes: 2 additions & 2 deletions platforms/cuda/tests/TestCudaPlumedForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void testMetadynamics() {
double expected = x*x;
for (int j = 0; j < centers.size(); j++)
expected += 0.1*exp(-(x-centers[j])*(x-centers[j])/(2*0.5*0.5));
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-2);
if (i > 0)
centers.push_back(x);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void testWellTemperedMetadynamics() {
heights.push_back(height0*exp(-bias/(delta_temperature*BOLTZ)));
}

ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions platforms/opencl/tests/TestOpenCLPlumedForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void testMetadynamics() {
double expected = x*x;
for (int j = 0; j < centers.size(); j++)
expected += 0.1*exp(-(x-centers[j])*(x-centers[j])/(2*0.5*0.5));
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-2);
if (i > 0)
centers.push_back(x);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void testWellTemperedMetadynamics() {
heights.push_back(height0*exp(-bias/(delta_temperature*BOLTZ)));
}

ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions platforms/reference/tests/TestReferencePlumedForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void testMetadynamics() {
double expected = x*x;
for (int j = 0; j < centers.size(); j++)
expected += 0.1*exp(-(x-centers[j])*(x-centers[j])/(2*0.5*0.5));
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-2);
if (i > 0)
centers.push_back(x);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void testWellTemperedMetadynamics() {
heights.push_back(height0*exp(-bias/(delta_temperature*BOLTZ)));
}

ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-2);
}
}

Expand Down
3 changes: 1 addition & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ set(OPENMMPLUMED_HEADER_DIR "${CMAKE_SOURCE_DIR}/openmmapi/include")
set(OPENMMPLUMED_LIBRARY_DIR "${CMAKE_BINARY_DIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py ${CMAKE_CURRENT_BINARY_DIR}/setup.py)
add_custom_command(TARGET PythonInstall
COMMAND "${PYTHON_EXECUTABLE}" setup.py build
COMMAND "${PYTHON_EXECUTABLE}" setup.py install
COMMAND "${PIP_EXECUTABLE}" install .
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
2 changes: 1 addition & 1 deletion python/plumedplugin.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%module openmmplumed


%include "factory.i"
%import(module="simtk.openmm") "swig/OpenMMSwigHeaders.i"
%include "swig/typemaps.i"
%include "std_string.i"
Expand Down

0 comments on commit 66873f7

Please sign in to comment.