diff --git a/.docker/hymd/Dockerfile b/.docker/hymd/Dockerfile new file mode 100644 index 00000000..ad70341e --- /dev/null +++ b/.docker/hymd/Dockerfile @@ -0,0 +1,27 @@ +FROM ubuntu:20.04 + +# Fix for tzdata installation from +# https://rtfm.co.ua/en/docker-configure-tzdata-and-timezone-during-build/ +ENV TZ=Europe/Oslo +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && apt-get install -y \ + libopenmpi-dev \ + libhdf5-openmpi-dev \ + pkg-config \ + curl \ + python3.8 \ + python3-pip \ + python3-mpi4py \ + python3-numpy + +RUN python3 -m pip install --upgrade pip && \ + python3 -m pip install --no-cache-dir cython numpy mpi4py cython && \ + python3 -m pip install networkx sympy pytest pytest-mpi mpsort pfft-python pmesh tomli + +ENV CC=mpicc +ENV HDF5_MPI="ON" +RUN python3 -m pip install --no-cache-dir --no-binary=h5py h5py + +COPY . /app +WORKDIR /app diff --git a/README.md b/README.md index e7600cf0..2f680ced 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,79 @@ -HyMD testing and development · [![License: GPL v3](https://img.shields.io/badge/License-LGPLv3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0.html) ![build](https://github.com/Cascella-Group-UiO/HyMD-2021/workflows/build/badge.svg) + + +[![License: GPL v3](https://img.shields.io/badge/License-LGPLv3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0.html) ![build](https://github.com/Cascella-Group-UiO/HyMD-2021/workflows/build/badge.svg) [![docs_pages](https://github.com/Cascella-Group-UiO/HyMD/actions/workflows/docs_pages.yml/badge.svg?branch=docs_setup)](https://github.com/Cascella-Group-UiO/HyMD/actions/workflows/docs_pages.yml) [![codecov](https://codecov.io/gh/Cascella-Group-UiO/HyMD/branch/main/graph/badge.svg?token=BXZ7B9RXV9)](https://codecov.io/gh/Cascella-Group-UiO/HyMD) + --------- -HyMD is a software that can run coarse-grained molecular dynamics simulations -using the hybrid-particle field model approach, introduced initially in [1]. -In HyMD we implement the formulation presented in [2]. +**HylleraasMD** (HyMD) is a massively parallel Python package for hybrid particle-field molecular dynamics (hPF-MD) simulations of coarse-grained bio- and soft-matter systems. + +HyMD can run canonical hPF-MD simulations [[1]](#1), or filtered density Hamiltonian hPF (HhPF-MD) simulations [[2]](#2), with or without explicit PME electrostatic interactions [[3]](#3). It includes all standard intramolecular interactions, including stretching, bending, torsional, and combined bending-dihedral potentials. Additionally, topological reconstruction of permanent peptide chain backbone dipoles is possible for accurate recreation of protein conformational dynamics [[4]](#4). Martini style elastic networks (ElNeDyn) [[5]](#5) are also supported. + +HyMD uses the [pmesh](github.com/rainwoodman/pmesh) library for particle-mesh operations, with the PPFT [[6]](#6) backend for FFTs through the [pfft-python bindings](github.com/rainwoodman/pfft-python). File IO is done via HDF5 formats to allow MPI parallel reads. + +## User Guide +Detailed installation and user guide, together with comprehensive example simulations are located in the [HylleraasMD documentation](https://cascella-group-uio.github.io/HyMD/index.html). + +Run simulations by +```bash +python3 -m hymd [CONFIGURATION_FILE] [TOPOLOGY_FILE] +``` -## Setup -First compile the FORTRAN modules: +## Installation +Install HyMD with `pip` by +```bash +python3 -m pip install hymd +``` +#### Install dependencies +HyMD installation **requires** a working MPI compiler. It is highly recommended to have *MPI-enabled* HDF5 and [h5py](https://docs.h5py.org/en/stable/mpi.html) for running parallel simulations with HyMD. Install both on Ubuntu with ```bash -> cd hymd/ -> make clean -> make -> cd .. +sudo apt-get update -y +sudo apt-get install -y curl pkg-config python3-pip python3-mpi4py libhdf5-mpi-dev +export CC=mpicc +export HDF5_MPI="ON" +python3 -m pip install --no-binary=h5py h5py ``` -Check out all the available options with +#### Run in docker +Alternatively, an up-to-date docker image is available from [docker hub](https://hub.docker.com/repository/docker/mortele/hymd) ```bash -> python3 hymd/main.py --help +docker pull mortele/hymd +docker run -it mortele/hymd +/app# apt-get install -y git +/app# git clone https://github.com/Cascella-Group-UiO/HyMD.git hymd +/app# cd hymd/ +/app/hymd# pip3 install . +/app/hymd# pytest ``` -Start a simple example simulation with: +## Run tests +Clone the repository and run tests with [pytest](https://docs.pytest.org/en/latest) ```bash -> mpirun -n 4 python3 hymd/main.py peptide.toml peptide.h5 -v +git clone https://github.com/Cascella-Group-UiO/HyMD.git hymd +cd hymd +pytest ``` +Running MPI enabled pytest tests is simplified with a convenient script +```bash +chmod +x pytest-mpi +pytest-mpi -oo -n 2 -ns +``` + +--------- -## References -[1] Milano, G. & Kawakatsu, T. Hybrid particle-field molecular dynamics -simulations for dense polymer systems Journal of Chemical Physics, American -Institute of Physics, 2009, 130, 214106 +### References +[1] +Milano, G.; Kawakatsu, T. Hybrid particle-field molecular dynamics simulations for densepolymer systems. J. Chem. Phys. **2009**, 130, 214106. -[2] Bore, S. L. & Cascella, M. Hamiltonian and alias-free hybrid -particle--field molecular dynamics The Journal of Chemical Physics, AIP -Publishing LLC, 2020, 153, 094106 +[2] +Bore, S. L.; Cascella, M. Hamiltonian and alias-free hybrid particle–field molecular dynam-ics. J. Chem. Phys. **2020**, 153, 094106. +[3] +Kolli, H. B.; De Nicola, A.; Bore, S. L.; Schäfer, K.; Diezemann, G.; Gauss, J.; Kawakatsu, T.;Lu, Z.-Y.; Zhu, Y.-L.; Milano, G.; Cascella, M. Hybrid Particle-Field Molecular DynamicsSimulations of Charged Amphiphiles in an Aqueous Environment. J. Chem. Theory Comput. **2018**, 14, 4928–4937. +[4] +Bore, S. L.; Milano, G.; Cascella, M. Hybrid Particle-Field Model for Conformational Dy-namics of Peptide Chains. J. Chem. Theory Comput. **2018**, 14, 1120–1130. +[5] +Periole, X.; Cavalli, M.; Marrink, S. J.; Ceruso, M. A. Combining an elastic network with a coarse-grained molecular force field: structure, dynamics, and intermolecular recognition. J. Chem. Theory Comput. **2009**, 5.9, 2531-2543. +[6] +Pippig, M. PFFT: An extension of FFTW to massively parallel architectures. SIAM J. Sci. Comput. **2013**, 35, C213–C236. diff --git a/docs/img/hymd_logo_text_black.png b/docs/img/hymd_logo_text_black.png new file mode 100644 index 00000000..eecdc4eb Binary files /dev/null and b/docs/img/hymd_logo_text_black.png differ diff --git a/hymd/version.py b/hymd/version.py index 5c4105cd..7863915f 100644 --- a/hymd/version.py +++ b/hymd/version.py @@ -1 +1 @@ -__version__ = "1.0.1" +__version__ = "1.0.2" diff --git a/setup.py b/setup.py index 8677c917..9276c48b 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,18 @@ def find_version(path): packages=["hymd"], version=find_version("hymd/version.py"), ext_modules=[force_kernels], + install_requires=[ + "cython", + "h5py", + "mpi4py", + "mpsort", + "networkx", + "numpy", + "pfft-python", + "pmesh", + "sympy", + "tomli", + ], python_requires=">=3.6", classifiers=[ "Development Status :: 5 - Production/Stable",