Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e8991f54 authored by HEDIN Florent's avatar HEDIN Florent
Browse files

CI enabled, reproducibility added, ready for release v1.2

parent 6721e718
No related branches found
No related tags found
No related merge requests found
Pipeline #67100 passed
Showing with 946 additions and 87 deletions
...@@ -9,3 +9,6 @@ build/LuaJIT-2.0.5* ...@@ -9,3 +9,6 @@ build/LuaJIT-2.0.5*
build/Makefile build/Makefile
build/cmake_install.cmake build/cmake_install.cmake
build/openmm-7.3.0* build/openmm-7.3.0*
build/CTestTestfile.cmake
build/parRep
build/Testing
stages:
- build
- test
variables:
MAKE_COMMAND: "make -j 4"
cache: # Directories that need to be kept between the build job and the test job
paths:
- build/
#----------------------------------------------------------------
# Linux build/test procedure
#----------------------------------------------------------------
# Build job
parrep_build_ubuntu:
stage: build
tags:
- parrep-ubuntu-1604-amd64
script:
- cd build
- bash download_deps_and_run_cmake.sh
- make
# Test job
parrep_test_ubuntu:
stage: test
tags:
- parrep-ubuntu-1604-amd64
script:
- echo "$PWD"
- cd build
- ctest -V
# v1.2.0
Mar 08th, 2019
The software was modified in order to allow reproducibility in some cases (the limiting factor is OpenMM which does not
always provides deterministic output even when using the same seeds (!), see http://docs.openmm.org/latest/userguide/library.html#determinism ).
The main executable now has 2 more command line options, '--inp-seeds [fname]' or '--out-seeds [fname]' for respectively loading seeds or writting seeds
from/to a unique binary file. See rand.hpp/rand.cpp, od the Doxygen doc for more details.
These modifications now allow Continuous Integration (CI) on the infrastructure provided by INRIA : in mol/ci a small test case will be executed at each commit to the repository and compared to reference results.
The two other minor modifications concern the Lua scripts:
* "get_minimised_energy_crdvels" was added to the set of functions that the user can call from the Lua script : it simply combines in one call what
"get_minimised_energy" and "get_minimised_crdvels" already provided.
* a extra optional parameter is available for the "simulation" parameters block when "simulation.algorithm" is "PARREP_FV" ; this parameter is
"simulation.minAccumulatedObs" : it will enforce that at least minAccumulatedObs observations of an observable have already been accumulated
before the convergence test is performed ; this may be useful if there is a risk of early pseudo-convergence for some of the observables when only a few samples have been accumulated.
**Download sources:**
https://gitlab.inria.fr/parallel-replica/gen.parRep/tags/v1.2.0
or
https://github.com/FHedin/gen.parRep/releases/tag/v1.2.0
---------------------------------------------- ----------------------------------------------
# v1.1.0 # v1.1.0
Nov 16th, 2018
Finished the implementation of a "MD_interface" abstract class for future addition of different Molecular Dynamics engines. Finished the implementation of a "MD_interface" abstract class for future addition of different Molecular Dynamics engines.
This required important changes to a significant part of the code. This required important changes to a significant part of the code.
Optimizations to the MPI communications were also performed, therefore the minor version number Optimizations to the MPI communications were also performed, therefore the minor version number
...@@ -19,7 +51,9 @@ https://github.com/FHedin/gen.parRep/releases/tag/v1.1.0 ...@@ -19,7 +51,9 @@ https://github.com/FHedin/gen.parRep/releases/tag/v1.1.0
# v1.0.1 # v1.0.1
simply added directory structure to readme file Aug 16th, 2018
Simply added directory structure to readme file.
**Download sources:** **Download sources:**
...@@ -33,7 +67,9 @@ https://github.com/FHedin/gen.parRep/releases/tag/v1.0.1 ...@@ -33,7 +67,9 @@ https://github.com/FHedin/gen.parRep/releases/tag/v1.0.1
# v1.0.0 # v1.0.0
Release of v1.0.0 : several bug fixes like memory leaks adressed, added input files for alanine Aug 13th, 2018
Release of v1.0.0 : several bug fixes like memory leaks addressed, added input files for alanine
dipeptide using transient propagation. dipeptide using transient propagation.
**Download sources:** **Download sources:**
...@@ -52,7 +88,7 @@ July 6th, 2018 ...@@ -52,7 +88,7 @@ July 6th, 2018
First public release of the software. First public release of the software.
It is following the submission of the corresponding article on arXiv ; this is a release candidate 1.0.0-rc1, It is following the submission of the corresponding article on arXiv ; this is a release candidate 1.0.0-rc1,
the 1.0.0 release should follow within the next weeks the 1.0.0 release should follow within the next weeks.
**Download sources:** **Download sources:**
......
...@@ -15,6 +15,8 @@ if(NOT CMAKE_BUILD_TYPE) ...@@ -15,6 +15,8 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE) FORCE)
endif() endif()
enable_testing()
set(TGT "parRep" CACHE STRING "The executable name") set(TGT "parRep" CACHE STRING "The executable name")
project(${TGT} C CXX) project(${TGT} C CXX)
...@@ -37,7 +39,7 @@ include ...@@ -37,7 +39,7 @@ include
include/dyna include/dyna
include/md include/md
include/utils include/utils
# external headers (dependancies provided with this project) # external headers (dependencies provided with this project)
external/sol2 external/sol2
) )
...@@ -61,12 +63,10 @@ src/md/omm_interface.cpp ...@@ -61,12 +63,10 @@ src/md/omm_interface.cpp
# utilities files # utilities files
src/utils/mpi_utils.cpp src/utils/mpi_utils.cpp
src/utils/lua_interface.cpp src/utils/lua_interface.cpp
# external dependancies provided with this project # external dependencies provided with this project
external/luasqlite3/lsqlite3.c external/luasqlite3/lsqlite3.c
) )
add_executable(${TGT} ${SRCS})
set(cWarnings "-Wall -Wextra") set(cWarnings "-Wall -Wextra")
# more warnings for c++ # more warnings for c++
# set(cxxWarnings "-Wall -Wextra -Wformat=2 -Wshadow -Wconversion -Wuseless-cast") # set(cxxWarnings "-Wall -Wextra -Wformat=2 -Wshadow -Wconversion -Wuseless-cast")
...@@ -90,4 +90,12 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native") ...@@ -90,4 +90,12 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -march=native") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -march=native")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -s -march=native") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -s -march=native")
add_executable(${TGT} ${SRCS})
target_link_libraries(${TGT} ${OpenMM_LIBRARY} ${LUA_LIBRARIES} ${MPI_LIBRARIES} ${SQLITE3_LIBRARIES}) target_link_libraries(${TGT} ${OpenMM_LIBRARY} ${LUA_LIBRARIES} ${MPI_LIBRARIES} ${SQLITE3_LIBRARIES})
add_test(
NAME test_ci_ar7_gen.parRep
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ci/run.ci.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ci
)
Copyright (c) 2016-2018, Florent Hédin, Tony Lelièvre, and École des Ponts - ParisTech Copyright (c) 2016-2019, Florent Hédin, Tony Lelièvre, and École des Ponts - ParisTech,
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
......
---------------------------------------------- # gen.parRep (v1.2)
# gen.parRep (v1.1)
----------------------------------------------
C++ implementation of the Generalized Parallel Replica algorithm C++ implementation of the Generalized Parallel Replica algorithm
Link to this repository : Link to this repository :
* https://gitlab.inria.fr/parallel-replica/gen.parRep
* https://gitlab.inria.fr/parallel-replica/gen.parRep
Link to the project gitlab page (includes more resources): Link to the project gitlab page (includes more resources):
* https://gitlab.inria.fr/parallel-replica
* https://gitlab.inria.fr/parallel-replica
See the following articles: See the following articles:
* A generalized parallel replica dynamics: Binder, Lelièvre & Simpson, 2015: https://doi.org/10.1016/j.jcp.2015.01.002
* A new implementation of the Generalized Parallel Replica Dynamics targeting metastable biochemical systems: Hédin & Lelièvre, 2018: https://arxiv.org/abs/1807.02431
* A generalized parallel replica dynamics: Binder, Lelièvre & Simpson, 2015: https://doi.org/10.1016/j.jcp.2015.01.002
* gen.parRep: a first implementation of the Generalized Parallel Replica dynamics for the long time simulation of metastable biochemical systems: Hédin & Lelièvre, 2018: https://arxiv.org/abs/1807.02431 and https://doi.org/10.1016/j.cpc.2019.01.005
Molecular dynamics is performed by using external codes linked to this program such as: Molecular dynamics is performed by using external codes linked to this program such as:
* OpenMM (https://github.com/pandegroup/openmm and https://simtk.org/home/openmm)
---------------------------------------------- * OpenMM (https://github.com/pandegroup/openmm and https://simtk.org/home/openmm)
If you find any error, bug, or limitation, please open an issue on https://gitlab.inria.fr/parallel-replica/gen.parRep/issues so that the community can benefit from its correction ; also feel free to clone/fork the repo and perform the modifications yourself if you have the programming abilities to do so !
Continuous Integration is performed on a test case system (see ./ci), ensuring that no release breaks the ability to compile the software; furthermore reference results from a previous run are available in ./ci/ref.sim in an attempt to achieve reproducibility whenever possible.
[![pipeline status](https://gitlab.inria.fr/parallel-replica/gen.parRep/badges/test_ci/pipeline.svg)](https://gitlab.inria.fr/parallel-replica/gen.parRep/commits/master)
## DOCUMENTATION ## DOCUMENTATION
----------------------------------------------
Please consult the Gitlab wiki for an overview of this software use: Please consult the Gitlab wiki for an overview of this software use:
https://gitlab.inria.fr/parallel-replica/gen.parRep/wikis/home https://gitlab.inria.fr/parallel-replica/gen.parRep/wikis/home
Doxygen can be used for generating a code reference documentation within the docs directory: Doxygen can be used for generating a code reference documentation within the docs directory (particularly useful if you plan to modify/extend the software):
* doxygen parRep.doxy
* doxygen parRep.doxy
By default an HTML reference is generated (ready to read), and a docs/latex directory is also created, although the pdf version requires to be manually compiled (pdfLaTeX, see the Makefile in ./docs/latex). By default an HTML reference is generated (ready to read), and a docs/latex directory is also created, although the pdf version requires to be manually compiled (pdfLaTeX, see the Makefile in ./docs/latex).
The Lua input files, in ./mol, used for starting computations, are self documented, and together The Lua input files, in ./mol, used for starting simulations, are self documented, and together
with the bash submission files in the ./run directory should be enough for starting to use the program with the bash submission files in the ./run directory, it should be enough for starting to use the program.
## DEPENDENCIES
### Dependencies required before running the CMakeLists.txt script
---------------------------------------------- You will need an MPI development framework installed, compatible with the MPI 3.0 or newer standard : tested implementations :
## DEPENDANCIES
----------------------------------------------
### Dependancies required before running the CMakeLists.txt script * Open MPI 1.10.2 (from Ubuntu 16.04 repositories)
You will need an MPI development framework installed, compatible with the MPI 3.0 or newer standard : tested implementations :
* Open MPI 1.10.2 (from Ubuntu 16.04 repositories)
CMake will try to locate it automatically. CMake will try to locate it automatically.
You will need the SQLite3 dynamic library on your system: You will need the SQLite3 dynamic library on your system. See :
See :
* https://sqlite.org/index.html
### Dependancies downloaded automatically via the script "build/download_dependencies.sh" * https://sqlite.org/index.html
The script "build/download_dependencies.sh" can download and compile if required the OpenMM and LuaJIT dependancies. ### Dependencies downloaded automatically via the script "build/download_deps_and_run_cmake.sh"
You can however use your own version of the OpenMM library, or any Lua inplementation (either compiled yourself or downloaded somewhere). The script "build/download_deps_and_run_cmake.sh" will download and compile if required the OpenMM and LuaJIT Dependencies.
You can however use your own version of the OpenMM library, or any Lua implementation (either compiled yourself or downloaded somewhere).
#### Ressources (OpenMM): #### Ressources (OpenMM):
* see https://simtk.org/home/openmm * see https://simtk.org/home/openmm
* and/or https://github.com/pandegroup/openmm * and/or https://github.com/pandegroup/openmm
* tested with version 7.0 to 7.3. * tested with version 7.0 to 7.3.
You may need Nvidia CUDA or AMD OpenCL toolkit for enabling GPU acceleration ; see OpenMM documentation. You may need NVIDIA CUDA or AMD OpenCL toolkit for enabling GPU acceleration ; see OpenMM documentation.
You may also need to edit CMakeLists.txt for specifying path to the include and lib directories of OpenMM. You may also need to edit CMakeLists.txt for specifying path to the include and lib directories of OpenMM.
CMake will try to locate it automatically. CMake will try to locate it automatically.
#### Ressources (Lua/LuaJIT): #### Ressources (Lua/LuaJIT):
A Lua implementation compatible with Lua API version >= 5.1 is required : A Lua implementation compatible with Lua API version >= 5.1 is required :
* A release of Lua 5.x is usually already installed by default for recent linux versions, try to execute 'lua' and/or 'locate liblua'
* You can Download and compile the official implementation : http://www.lua.org/download.html * A release of Lua 5.x is usually already installed by default for recent linux versions, try to execute 'lua' and/or 'locate liblua'
* The LuaJIT implementation can provide an important speedup : http://luajit.org/download.html
* You can Download and compile the official implementation : http://www.lua.org/download.html
* The LuaJIT implementation can provide an important speedup : http://luajit.org/download.html
Please download and compile any of the two. See below for hints for setting DCMAKE_PREFIX_PATH in case of a manual install. Please download and compile any of the two. See below for hints for setting DCMAKE_PREFIX_PATH in case of a manual install.
CMake will try to locate it automatically. CMake will try to locate it automatically.
### Dependancies provided in directory "external" ### Dependencies provided in directory "external"
The excellent Sol2 (header-only Lua<->c++ inteface) and LuaSQLite3 (a Lua/SQLite3 binding) dependancies are provided The excellent Sol2 (header-only Lua<->c++ interface) and LuaSQLite3 (a Lua/SQLite3 binding) Dependencies are provided
in the './external' directory and are automatically included/compiled if required, and thus should not require extra in the './external' directory and are automatically included/compiled if required, and thus should not require extra
configuration. configuration. See :
See :
* https://github.com/ThePhD/sol2 * https://github.com/ThePhD/sol2
* http://lua.sqlite.org/index.cgi/home
* http://lua.sqlite.org/index.cgi/home
----------------------------------------------
## COMPILE & INSTALL ## COMPILE & INSTALL
----------------------------------------------
C and C++ compiler compatible with the C99 and C++14 standards are required. C and C++ compiler compatible with the C99 and C++14 standards are required.
Tested compilers: Tested compilers:
* gcc/g++ 5.4.0 and 6.2.0 (from Ubuntu 16.04 repositories)
* gcc/g++ 5.4.0 and 6.2.0 (from Ubuntu 16.04 repositories)
Be sure to have CMake installed (http://www.cmake.org/), available on most repositories. Be sure to have CMake installed (http://www.cmake.org/), available on most repositories.
Tested version : Tested version :
* CMake 3.5.1 (from Ubuntu 16.04 repositories)
Create a build directory and move to that directory: * CMake 3.5.1 (from Ubuntu 16.04 repositories)
* mkdir build && cd build
Create a build directory and move to that directory:
* mkdir build && cd build
For building a debug or release or an intermediate release with debug information, do: For building a debug or release or an intermediate release with debug information, do:
* cmake -DCMAKE_BUILD_TYPE=Debug ..
* cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
* cmake -DCMAKE_BUILD_TYPE=Release .. (default, with cpu targeting for the current compilation machine)
Debug builds are possibly slower, usually more memory consuming, but useful when debugging with gdb or valgrind. * cmake -DCMAKE_BUILD_TYPE=Debug ..
* cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
If some dependancies were note detected (e.g. because they are not available within /usr/local) * cmake -DCMAKE_BUILD_TYPE=Release .. (default, with cpu targeting for the current compilation machine)
Debug builds are possibly slower, usually more memory consuming, but useful when debugging with gdb or Valgrind.
If some dependencies were note detected (e.g. because they are not available within /usr/local)
it is required to add the path where the were installed to CMAKE_PREFIX_PATH, e.g.: it is required to add the path where the were installed to CMAKE_PREFIX_PATH, e.g.:
* cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$HOME/bin/something" ..
* cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$HOME/bin/something" ..
Then, once CMake built a Makefile without error, just execute the following in order to build the executable: Then, once CMake built a Makefile without error, just execute the following in order to build the executable:
* make
For a verbose make, use: * make
* make VERBOSE=1
For a verbose make, use:
* make VERBOSE=1
For a faster multi-core (on N cores) build, use: For a faster multi-core (on N cores) build, use:
* make -j N
Please never edit the autogenerated Makefile, edit the CMakeLists.txt instead. * make -j N
Please never edit the automatically generated Makefile, edit the CMakeLists.txt instead.
For specifying another compiler on linux, for example clang, or a proprietary one like Intel icc (untested) :
* CC=clang CXX=clang++ cmake ..
* CC=icc CXX=icpc cmake ..
For specifying another compiler on linux, for example clang, or a proprietary one like Intel icc (untested) :
* CC=clang CXX=clang++ cmake ..
* CC=icc CXX=icpc cmake ..
In any case, you may need to edit the variables CMAKE_C_FLAGS_* and CMAKE_CXX_FLAGS_* In any case, you may need to edit the variables CMAKE_C_FLAGS_* and CMAKE_CXX_FLAGS_*
for setting proper levels of optimization. By default for setting proper levels of optimization. By default
When using OpenMPI and forcing another C/C++ compilers version, the following might be required (possibly unsafe !): When using OpenMPI and forcing another C/C++ compilers version, the following might be required (possibly unsafe !):
* OMPI_CC=gcc-5 OMPI_CXX=g++-5 CC=gcc-5 CXX=g++-5 ccmake ..
* OMPI_CC=gcc-5 OMPI_CXX=g++-5 CC=gcc-5 CXX=g++-5 ccmake ..
----------------------------------------------
## LICENSING (all files excepted subdirectory external and its content) ## LICENSING (all files excepted subdirectory external and its content)
----------------------------------------------
Copyright (c) 2016-2018, Florent Hédin, Tony Lelièvre, and École des Ponts - ParisTech Copyright (c) 2016-2019, Florent Hédin, Tony Lelièvre, and École des Ponts - ParisTech
All rights reserved. All rights reserved.
The 3-clause BSD license is applied to this software. The 3-clause BSD license is applied to this software.
...@@ -140,9 +165,7 @@ See LICENSE.txt ...@@ -140,9 +165,7 @@ See LICENSE.txt
See in ./external/* for licensing information concerning the embedded libraries provided in './external' See in ./external/* for licensing information concerning the embedded libraries provided in './external'
----------------------------------------------
## NOTES CONCERNING OpenMM ## NOTES CONCERNING OpenMM
----------------------------------------------
The software should automatically detect the fastest OpenMM Platform available on your computer (i.e. CUDA, OpenCL, ...) The software should automatically detect the fastest OpenMM Platform available on your computer (i.e. CUDA, OpenCL, ...)
If not it will run with the slow Reference platform : it is most probably because the OpenMM directory with the If not it will run with the slow Reference platform : it is most probably because the OpenMM directory with the
...@@ -151,18 +174,18 @@ If not it will run with the slow Reference platform : it is most probably becaus ...@@ -151,18 +174,18 @@ If not it will run with the slow Reference platform : it is most probably becaus
You may need to export the following OPENMM_PLUGIN_DIR environment variable to solve the problem : You may need to export the following OPENMM_PLUGIN_DIR environment variable to solve the problem :
For example for a custom installation in /home/$USER/bin/openmm For example for a custom installation in /home/$USER/bin/openmm
* export OPENMM_PLUGIN_DIR=$HOME/bin/openmm/lib/plugins
* export OPENMM_PLUGIN_DIR=$HOME/bin/openmm/lib/plugins
For setting the amount of cpu threads used by each MPI process use the following env. variable : For setting the amount of cpu threads used by each MPI process use the following env. variable :
* export OPENMM_CPU_THREADS=1
---------------------------------------------- * export OPENMM_CPU_THREADS=1
## Directory structure ## Directory structure
----------------------------------------------
**src** and **include** -> contains the C++ source and headers of the gen.parRep software. **src** and **include** -> contains the C++ source and headers of the gen.parRep software.
**build** -> directory where dependancies will be downloaded, and the program built. **build** -> directory where dependencies will be downloaded, and the program built.
**external** -> contains source and headers of dependencies used by the gen.parRep software. **external** -> contains source and headers of dependencies used by the gen.parRep software.
...@@ -172,5 +195,6 @@ For setting the amount of cpu threads used by each MPI process use the following ...@@ -172,5 +195,6 @@ For setting the amount of cpu threads used by each MPI process use the following
**mol** -> contains ready to use test systems, i.e. input files and OpenMM configurations of various molecular systems. **mol** -> contains ready to use test systems, i.e. input files and OpenMM configurations of various molecular systems.
**run** -> contains bash scripts demonstrating how to run the software using either mpirun or the SLURM scheduler; also contains three bash files for runing the software under the following debuggers/profilers: GDB, Valgrind and Scalasca. **run** -> contains bash scripts demonstrating how to run the software using either mpirun or the SLURM scheduler; also contains bash files for running the software under the following debuggers/profilers: GDB, Valgrind and Scalasca.
**ci** -> contains a molecular system, an input script and reference data for performing continuous integration and non regression tests.
...@@ -21,7 +21,7 @@ then ...@@ -21,7 +21,7 @@ then
fi fi
tar xf LuaJIT-2.0.5.tar.gz tar xf LuaJIT-2.0.5.tar.gz
cd LuaJIT-2.0.5 cd LuaJIT-2.0.5
make PREFIX=$PWD/build -j 8 install make PREFIX=$PWD/build install
cd .. cd ..
fi fi
export LUAJIT_INSTALL_DIR=$PWD/LuaJIT-2.0.5/build export LUAJIT_INSTALL_DIR=$PWD/LuaJIT-2.0.5/build
......
*.txt
*.log
*.db
# WARNING
This is a simple test case executed when Continuous Integration tasks are performed ; it does not really make sense to use parRep on such a small test system !
This diff is collapsed.
<?xml version="1.0" ?>
<Integrator constraintTolerance="1e-08" friction="10" randomSeed="123456789" stepSize=".001" temperature="15" type="LangevinIntegrator" version="1"/>
<?xml version="1.0" ?>
<State openmmVersion="7.3" time="999.9999999832651" type="State" version="1">
<PeriodicBoxVectors>
<A x="20" y="0" z="0"/>
<B x="0" y="20" z="0"/>
<C x="0" y="0" z="20"/>
</PeriodicBoxVectors>
<Positions>
<Position x="9.983385059299602" y="10.174980427137598" z="10.020986348782928"/>
<Position x="9.770224100810191" y="10.037570850276143" z="10.293565548378014"/>
<Position x="9.59030488821879" y="10.02885267592082" z="9.931518707870099"/>
<Position x="9.648648572516473" y="10.349048230249956" z="10.107352368306797"/>
<Position x="9.766183439034616" y="10.306491926935744" z="9.758201173961519"/>
<Position x="9.93467672489858" y="9.95859189806722" z="9.682105588219425"/>
<Position x="9.906861537781493" y="9.817471151536196" z="10.038531569331555"/>
</Positions>
<Velocities>
<Velocity x=".06812021378266309" y="-.014536461211633878" z="-.05354852211603145"/>
<Velocity x="-.0003575163347591115" y=".004253822229571824" z=".10209696385565792"/>
<Velocity x=".01955586418134203" y=".01921201910093373" z="-.003143989026455074"/>
<Velocity x=".06026768071265565" y=".04230138984162579" z=".07773255456200445"/>
<Velocity x="-.05115033391156487" y=".045557891198200196" z=".03101618878886825"/>
<Velocity x="-.028826659962177814" y=".059965265059247486" z="-.07743277297400653"/>
<Velocity x=".06604694795520061" y="-.02419439117318234" z=".015470123640781708"/>
</Velocities>
</State>
<?xml version="1.0" ?>
<System openmmVersion="7.3" type="System" version="1">
<PeriodicBoxVectors>
<A x="20" y="0" z="0"/>
<B x="0" y="20" z="0"/>
<C x="0" y="0" z="20"/>
</PeriodicBoxVectors>
<Particles>
<Particle mass="39.948"/>
<Particle mass="39.948"/>
<Particle mass="39.948"/>
<Particle mass="39.948"/>
<Particle mass="39.948"/>
<Particle mass="39.948"/>
<Particle mass="39.948"/>
</Particles>
<Constraints/>
<Forces>
<Force alpha="0" cutoff="1" dispersionCorrection="0" ewaldTolerance=".0005" forceGroup="0" ljAlpha="0" ljnx="0" ljny="0" ljnz="0" method="0" nx="0" ny="0" nz="0" recipForceGroup="-1" rfDielectric="78.3" switchingDistance="-1" type="NonbondedForce" useSwitchingFunction="0" version="3">
<GlobalParameters/>
<ParticleOffsets/>
<ExceptionOffsets/>
<Particles>
<Particle eps=".99607255958" q="0" sig=".3405"/>
<Particle eps=".99607255958" q="0" sig=".3405"/>
<Particle eps=".99607255958" q="0" sig=".3405"/>
<Particle eps=".99607255958" q="0" sig=".3405"/>
<Particle eps=".99607255958" q="0" sig=".3405"/>
<Particle eps=".99607255958" q="0" sig=".3405"/>
<Particle eps=".99607255958" q="0" sig=".3405"/>
</Particles>
<Exceptions/>
</Force>
<Force forceGroup="0" frequency="100" type="CMMotionRemover" version="1"/>
</Forces>
</System>
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
import numpy as np
from math import *
from sys import stdout
platform = Platform.getPlatformByName('Reference')
# periodic conditions
# periodic vectors
a = Vec3(20.0,0.0,0.0)
b = Vec3(0.0,20.0,0.0)
c = Vec3(0.0,0.0,20.0)
center = Vec3(10.,10.,10.)
print("a = ",a)
print("b = ",b)
print("c = ",c)
print("center = ",center)
natoms = 7
mass = 39.948*amu
temperature = 15.0*kelvin
integrator = LangevinIntegrator(temperature, 10/picosecond, 0.001*picosecond)
integrator.setConstraintTolerance(1e-8)
integrator.setRandomNumberSeed(123456789)
nb = NonbondedForce()
nb.setNonbondedMethod(NonbondedForce.NoCutoff)
#nb.setUseSwitchingFunction(True)
#nb.setSwitchingDistance(1.0*nanometer)
#nb.setCutoffDistance(1.2*nanometer)
nb.setUseDispersionCorrection(False)
# see http://www.sklogwiki.org/SklogWiki/index.php/Argon for argon LJ parameters
k_B = 0.0083144621*(kilojoule/(mole*kelvin))
lj_epsilon = 119.8*kelvin * k_B # in kJ/mol
lj_sigma = 0.3405*nanometer # in nm
# All seven particles will initially be placed on a 2D plane
# Each particle is by construction at distance r_min of another atom
# r_min = lj_sigma * 2^(1./6.) is the distance at which the LJ potential is minimum
# See on the right for the numbering of particles
#
# * * 3 2
# * * * 4 0 1
# * * 5 6
#
r_min = 2.**(1./6.) * lj_sigma._value
xpos = r_min*cos(pi/3.)
ypos = r_min*sin(pi/3.)
iniPos = np.zeros((natoms,3))
iniPos[0,:] = (center[0],center[1],center[2])
iniPos[1,:] = (center[0]+r_min,center[1],center[2])
iniPos[2,:] = (center[0]+xpos,center[1]+ypos,center[2])
iniPos[3,:] = (center[0]-xpos,center[1]+ypos,center[2])
iniPos[4,:] = (center[0]-r_min,center[1],center[2])
iniPos[5,:] = (center[0]-xpos,center[1]-ypos,center[2])
iniPos[6,:] = (center[0]+xpos,center[1]-ypos,center[2])
system = System()
for i in range(natoms):
system.addParticle(mass)
nb.addParticle(0.0,lj_sigma,lj_epsilon)
system.setDefaultPeriodicBoxVectors(a,b,c)
system.addForce(nb)
system.addForce(CMMotionRemover(100))
# generate basic topology object to use with simulation class (and to be able to write pdb files)
top = Topology()
top.setPeriodicBoxVectors([a,b,c])
chain = top.addChain("A")
for i in range(natoms):
top.addResidue("AR",chain)
for r in top.residues():
top.addAtom("AR",Element.getBySymbol("Ar"),r)
simulation = Simulation(top,system,integrator,platform)#,platformProperties)
simulation.context.setPositions(iniPos)
state = simulation.context.getState(getPositions=True,getVelocities=True,enforcePeriodicBox=True)
with open("start.pdb", 'w') as f:
PDBFile.writeFile(top,state.getPositions(),f)
print('Minimizing energy...')
simulation.minimizeEnergy(1e-5)
simulation.context.setVelocitiesToTemperature(temperature)
state = simulation.context.getState(getPositions=True,getVelocities=True,enforcePeriodicBox=True)
with open("minim.pdb", 'w') as f:
PDBFile.writeFile(top,state.getPositions(),f)
nsteps = 1e6
# save each 1 ps
saveFreq = 1000
simulation.reporters.append(StateDataReporter(stdout, saveFreq, step=True,
time=True, potentialEnergy=True, kineticEnergy=True, totalEnergy=True,
temperature=True, progress=True,
remainingTime=True, speed=True,
totalSteps=nsteps, separator='\t'))
simulation.reporters.append(DCDReporter(file='sim.dcd', reportInterval=saveFreq, enforcePeriodicBox=True))
print("Running dynamics...")
simulation.step(nsteps)
state = simulation.context.getState(getPositions=True,getVelocities=True,enforcePeriodicBox=True)
with open("1ns.pdb", 'w') as f:
PDBFile.writeFile(top,state.getPositions(),f)
#serialize the state to xml for load in parRep later
print('Serializing state : it contains coordinates, velocities, etc. for parRep...')
f = open('State.xml','w')
f.write(XmlSerializer.serialize(state))
f.close()
#serialize the system to xml for load in parRep later
print('Serializing system : it contains all definition of forces for parRep...')
f = open('System.xml','w')
f.write(XmlSerializer.serialize(system))
f.close()
#serialize the integrator to xml for load in parRep later
print('Serializing integrator for parRep...')
f = open('Integrator.xml','w')
f.write(XmlSerializer.serialize(integrator))
f.close()
# Software used for producing this output :
sqlite3 : 3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2alt1
gcc/g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Luajit : LuaJIT 2.0.5, download and compiled from script download_dependcies in the build directory.
OpenMM : openmm-7.3.0-py27_cuda92_rc_1.tar.bz2, bin version downloaded from script download_dependcies in the build directory.
MPI : mpirun (Open MPI) 2.1.1, from repository
# Linux (Ubuntu 18.04):
$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
$ uname -a
Linux pl267-pro 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
File added
File added
#!/bin/bash
rm -f *.db *.log *.txt
export OPENMM_CPU_THREADS=1
export OPENMM_PLUGIN_DIR=$PWD/../build/openmm-7.3.0/lib/plugins
mpirun -np 8 $PWD/../build/parRep -i input_generalized_parRep.lua -log warn -o out.txt -e err.txt --inp-seeds ./ref.sim/seeds.bin
MPI_RET_CODE=$?
# compare the db file from the run and the reference, they should be the same
sqldiff lj7.db ref.sim/lj7.db > diff.txt
SQL_RET_CODE=$?
if [ -s "diff.txt" ]
then
TEST_RET_CODE=-1
else
TEST_RET_CODE=0
fi
cat out.*.txt
# success only if there was no error code from any of the previous commands
exit $(($MPI_RET_CODE|$SQL_RET_CODE|$TEST_RET_CODE))
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* \author Florent Hédin * \author Florent Hédin
* \author Tony Lelièvre * \author Tony Lelièvre
* \author École des Ponts - ParisTech * \author École des Ponts - ParisTech
* \date 2016-2018 * \date 2016-2019
*/ */
#ifndef GELMANRUBIN_HPP_INCLUDED #ifndef GELMANRUBIN_HPP_INCLUDED
...@@ -34,13 +34,11 @@ public: ...@@ -34,13 +34,11 @@ public:
/** /**
* @brief Constructor for a Gelman Rubin Analysis object; requires at least the number of chains (replica) as first argument. * @brief Constructor for a Gelman Rubin Analysis object; requires at least the number of chains (replica) as first argument.
* The second argument allows to discard the first n observations when averaging, default is zero and thus disables
* discarding.
* *
* @param _num_chains The number of G-R chains (same as the number of replicas usually). * @param _num_chains The number of G-R chains (same as the number of replicas usually).
* @param _discard Discards the first n observations, as usually there won't be convergence at the beginning. * @param _no_convergence_if_less_than Optional argument : if set there won't be convergence check until at least _no_convergence_if_less_than observations have been accumulated for each observable : this may hel avoiding pseudo-convergence.
*/ */
GelmanRubinAnalysis(const uint32_t _num_chains, const uint32_t _discard=0); GelmanRubinAnalysis(const uint32_t _num_chains, const uint32_t _no_convergence_if_less_than=0);
/** /**
...@@ -195,8 +193,9 @@ private: ...@@ -195,8 +193,9 @@ private:
std::map<std::string,double> tolerance; ///< Allows one tolerance treshold per observable type std::map<std::string,double> tolerance; ///< Allows one tolerance treshold per observable type
std::map<std::string,std::vector<double>> ratio; ///< Allows one ratio vector per observable type std::map<std::string,std::vector<double>> ratio; ///< Allows one ratio vector per observable type
uint32_t num_chains; ///< The total number of chains uint32_t num_chains = 0; ///< The total number of chains
uint32_t discard_first; ///< A given number of records to ignore at the beginning uint32_t min_num_observations_before_check = 0; ///< There won't be convergence check until at least this amount ob observations have been accumulated for each obseravble
}; };
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* \author Florent Hédin * \author Florent Hédin
* \author Tony Lelièvre * \author Tony Lelièvre
* \author École des Ponts - ParisTech * \author École des Ponts - ParisTech
* \date 2016-2018 * \date 2016-2019
*/ */
#ifndef OBSERVABLE_HPP_INCLUDED #ifndef OBSERVABLE_HPP_INCLUDED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment