Skip to content

Commit

Permalink
patch differences between gromacs/master (b61de386) and master-fda (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
BerndDoser committed Jan 15, 2018
1 parent 6573773 commit 3de95c9
Show file tree
Hide file tree
Showing 579 changed files with 1,048,114 additions and 491 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ lib*.pc
build
_build
CMakeLists.txt.user
build*
/VersionInfo*.cmake
Testing
.settings
104 changes: 89 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,94 @@
language: cpp
sudo: false

before_install:
- echo "yes" | sudo add-apt-repository ppa:kalakris/cmake #https://github.com/travis-ci/travis-ci/issues/2212
- sudo apt-get update
- sudo apt-get install libfftw3-dev libopenmpi-dev libx11-dev zlib1g-dev libgsl0-dev libxml2-dev libblas-dev liblapack-dev libboost-dev cmake
matrix:
include:
- os: linux
compiler: gcc
addons: &gcc49
apt:
sources: ['ubuntu-toolchain-r-test']
packages:
- g++-4.9
- libfftw3-dev
- libopenmpi-dev
- libx11-dev
- zlib1g-dev
- libgsl0-dev
- libxml2-dev
- libblas-dev
- liblapack-dev
- libboost-graph-dev
env: BUILD_TYPE='Release' C_COMPILER='gcc-4.9' CXX_COMPILER='g++-4.9'

env:
matrix:
- GMX_DOUBLE=OFF GMX_MPI=OFF
- GMX_DOUBLE=OFF GMX_MPI=ON
- GMX_DOUBLE=ON GMX_MPI=OFF
- GMX_DOUBLE=ON GMX_MPI=ON
- os: linux
compiler: gcc
addons: *gcc49
env: BUILD_TYPE='Debug' C_COMPILER='gcc-4.9' CXX_COMPILER='g++-4.9'

script:
- mkdir build && pushd build && cmake -DGMX_DOUBLE=$GMX_DOUBLE -DGMX_MPI=$GMX_MPI .. && make -j4
- os: linux
compiler: clang
addons: &clang38
apt:
sources: ['llvm-toolchain-precise-3.8', 'ubuntu-toolchain-r-test']
packages:
- clang-3.8
- libfftw3-dev
- libopenmpi-dev
- libx11-dev
- zlib1g-dev
- libgsl0-dev
- libxml2-dev
- libblas-dev
- liblapack-dev
- libboost-graph-dev
env: BUILD_TYPE='Release' C_COMPILER='clang-3.8' CXX_COMPILER='clang++-3.8'

compiler:
- clang
- gcc
- os: linux
compiler: clang
addons: *clang38
env: BUILD_TYPE='Debug' C_COMPILER='clang-3.8' CXX_COMPILER='clang++-3.8'

- os: osx
osx_image: xcode8.3
compiler: clang
env: BUILD_TYPE='Release' C_COMPILER='clang' CXX_COMPILER='clang++'

- os: osx
osx_image: xcode8.3
compiler: clang
env: BUILD_TYPE='Debug' C_COMPILER='clang' CXX_COMPILER='clang++'

install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz"
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
GTEST_URL="https://github.com/google/googletest/archive/release-1.7.0.tar.gz"
mkdir -p gtest && travis_retry wget --no-check-certificate --quiet -O - ${GTEST_URL} | tar --strip-components=1 -xz -C gtest
cmake gtest
cmake --build gtest
export GTEST_ROOT=${DEPS_DIR}/gtest
elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
which cmake || brew install cmake
fi
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DGMX_BUILD_MDRUN_ONLY=OFF -DGMX_BUILD_FDA=ON -DGMX_DEFAULT_SUFFIX=OFF -DGMX_BINARY_SUFFIX=_fda -DGMX_SIMD=NONE -DGMX_BUILD_UNITTESTS=ON -DGMX_BUILD_OWN_FFTW=ON ..

script:
- make -j 4
- make check

notifications:
recipients:
- [email protected]
email:
on_success: change
on_failure: always
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ set(REQUIRED_CUDA_COMPUTE_CAPABILITY 2.0)
# OpenCL required version: 1.1 or newer
set(REQUIRED_OPENCL_MIN_VERSION 1.1)

option(GMX_BUILD_FDA "Switch on force distribution analysis (FDA)" OFF)
mark_as_advanced(GMX_BUILD_FDA)
if(GMX_BUILD_FDA)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBUILD_WITH_FDA")
set(GMX_GPU OFF)
endif()

if(NOT GMX_USE_OPENCL)
# CUDA detection is done only if GMX_USE_OPENCL is OFF.
include(gmxManageGPU)
Expand Down Expand Up @@ -469,6 +476,18 @@ include(gmxManageSharedLibraries)
# Find external packages #
########################################################################

# Boost template libraries
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS graph REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})

# TNG wants zlib if it is available. And static libxml2 might have a dependency
find_package(ZLIB QUIET)
include(gmxTestZLib)
gmx_test_zlib(HAVE_ZLIB)

# Unconditionally find the package, as it is also required for unit
# tests. This exports LIBXML2_FOUND, which we should not use because
# it does not tell us that linking will succeed. Instead, we test that
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile-clang-4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM bernddoser/docker-devel-cpp:ubuntu-16.04-clang-4.0-gtest-1.8.0

MAINTAINER Bernd Doser <[email protected]>

RUN apt-get update \
&& apt-get install -y \
libboost-graph-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
9 changes: 9 additions & 0 deletions Dockerfile-gcc-4.9
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM bernddoser/docker-devel-cpp:ubuntu-16.04-gcc-4.9-gtest-1.8.0-doxygen-1.8.5

MAINTAINER Bernd Doser <[email protected]>

RUN apt-get update \
&& apt-get install -y \
libboost-graph-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
9 changes: 9 additions & 0 deletions Dockerfile-gcc-7
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM bernddoser/docker-devel-cpp:ubuntu-16.04-gcc-7-gtest-1.8.0

MAINTAINER Bernd Doser <[email protected]>

RUN apt-get update \
&& apt-get install -y \
libboost-graph-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
77 changes: 77 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!groovy

pipeline {
agent {
dockerfile {
filename 'Dockerfile-gcc-4.9'
label 'docker-nodes'
}
}
stages {
stage('Build') {
steps {
sh '''
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=release \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
-DGMX_BUILD_MDRUN_ONLY=OFF \
-DGMX_BUILD_FDA=ON \
-DGMX_DEFAULT_SUFFIX=OFF \
-DGMX_BINARY_SUFFIX=_fda \
-DGMX_SIMD=NONE \
-DGMX_BUILD_UNITTESTS=ON \
-DGMX_BUILD_OWN_FFTW=ON \
..
make
'''
}
}
stage('Test') {
steps {
script {
try {
sh '''
cd build
make check
'''
} catch (err) {
echo "Failed: ${err}"
} finally {
step([
$class: 'XUnitBuilder',
thresholds: [[$class: 'FailedThreshold', unstableThreshold: '1']],
tools: [[$class: 'GoogleTestType', pattern: 'build/Testing/Temporary/*.xml']]
])
}
}
}
}
stage('Doxygen') {
steps {
sh '''
cd build
make doxygen-all
'''
publishHTML( target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportName: 'Doxygen',
reportDir: 'build/docs/html/doxygen/html-full',
reportFiles: 'index.xhtml'
])
}
}
}
post {
success {
archiveArtifacts artifacts: 'build/bin/gmx_fda', fingerprint: true
mail to: '[email protected]', subject: "SUCCESS: ${currentBuild.fullDisplayName}", body: "All fine."
}
failure {
mail to: '[email protected]', subject: "FAILURE: ${currentBuild.fullDisplayName}", body: "Failed."
}
}
}
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Force Distribution Analysis (FDA)
=================================
Jenkins: [![Build Status](https://jenkins.h-its.org/buildStatus/icon?job=MBM/HITS-MBM/gromacs-fda/master-fda)](https://jenkins.h-its.org/job/MBM/job/HITS-MBM/job/gromacs-fda/job/master-fda/)

Travis: [![Build Status](https://api.travis-ci.org/HITS-MBM/gromacs-fda.svg?branch=master-fda)](https://travis-ci.org/HITS-MBM/gromacs-fda)

Background
----------

Calculations of internal forces and stress distributions have long been used by mechanical engineers in designing strong structures, from tall sky-scrapers and kilometer-long bridges to Formula 1 cars and aircraft wings. The same kind of analysis, but applied to atomic and molecular level, could shed light onto the mechanical stability of (bio)molecules, allosteric mechanisms and signal propagation in cells or mechanically induced processes such as blood coagulation.

Molecular dynamics (MD) simulations apply Newton's equations of motion to atomic systems. During each integration time step, atoms interact with each other through pairwise forces. All pairwise forces acting on an atom are summed up and the resulting force determines the displacement of the atom in the next time step. These displacements are then typically used to analyze MD simulations.

The analysis of individual atomic pairwise forces, which we call Force Distribution Analysis, can offer a much more sensitive view of a (bio)molecular system, be it in a stable state or during a transition between states. Such analysis would be able to explain, for example, the functioning of an atomic level Newton's cradle, where the application of force on an atom does not translate directly into a displacement of all spheres but only of the outer ones. Similarly, atoms can propagate forces in the absence of any significant atomic displacements, for example through a protein's rigid core.

Installation and usage
----------------------

Please find the GROMACS-FDA manual at [fda-manual](fda-manual/fda-manual.pdf).

Citations
---------

If you use the FDA code, please cite: http://dx.doi.org/10.1186/2046-1682-6-5
Binary file added fda-manual/fda-manual.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions src/gromacs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ add_subdirectory(listed-forces)
add_subdirectory(commandline)
add_subdirectory(domdec)
add_subdirectory(ewald)
add_subdirectory(fda)
add_subdirectory(fft)
add_subdirectory(gpu_utils)
add_subdirectory(hardware)
Expand Down
40 changes: 40 additions & 0 deletions src/gromacs/fda/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# This file is part of the GROMACS molecular simulation package.
#
# Copyright (c) 2009,2010,2012,2014,2015,2016, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
#
# GROMACS is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; either version 2.1
# of the License, or (at your option) any later version.
#
# GROMACS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with GROMACS; if not, see
# http://www.gnu.org/licenses, or write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# If you want to redistribute modifications to GROMACS, please
# consider that scientific software is very special. Version
# control is crucial - bugs must be traceable. We will be happy to
# consider code for inclusion in the official distribution, but
# derived work must not be called official GROMACS. Details are found
# in the README & COPYING files - if they are missing, get the
# official version at http://www.gromacs.org.
#
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.

file(GLOB FDA_SOURCES *.cpp)
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${FDA_SOURCES} PARENT_SCOPE)

if(BUILD_TESTING)
add_subdirectory(tests)
endif()
55 changes: 55 additions & 0 deletions src/gromacs/fda/CompatInteractionType.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* CompatInteractionType.h
*
* Created on: Jan 10, 2017
* Author: Bernd Doser, HITS gGmbH <[email protected]>
*/

#include <stdexcept>
#include "CompatInteractionType.h"

namespace fda {

CompatInteractionType to_compat(InteractionType i)
{
switch(i) {
case InteractionType_BOND:
return CompatInteractionType::BOND;
case InteractionType_ANGLE:
return CompatInteractionType::ANGLE;
case InteractionType_DIHEDRAL:
return CompatInteractionType::DIHEDRAL;
case InteractionType_POLAR:
return CompatInteractionType::POLAR;
case InteractionType_COULOMB:
return CompatInteractionType::COULOMB;
case InteractionType_LJ:
return CompatInteractionType::LJ;
case InteractionType_NB14:
return CompatInteractionType::DIHEDRAL;
default:
return CompatInteractionType::NONE;
}
}

InteractionType from_compat(CompatInteractionType i)
{
switch(i) {
case CompatInteractionType::BOND:
return InteractionType_BOND;
case CompatInteractionType::ANGLE:
return InteractionType_ANGLE;
case CompatInteractionType::DIHEDRAL:
return InteractionType_DIHEDRAL;
case CompatInteractionType::POLAR:
return InteractionType_POLAR;
case CompatInteractionType::COULOMB:
return InteractionType_COULOMB;
case CompatInteractionType::LJ:
return InteractionType_LJ;
default:
throw std::runtime_error("Is not a compat interaction");
}
}

} // namespace fda
Loading

0 comments on commit 3de95c9

Please sign in to comment.