Skip to content

Commit 62a072c

Browse files
authored
Add documentation
This adds documentation to the project.
2 parents 5e937dd + 4d13f59 commit 62a072c

19 files changed

+1021
-188
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ dist/
1010
**/runtimes.csv
1111
**/runtimes.pdf
1212

13+
# Documentation
14+
docs/_build/
15+
docs/.doctrees/
16+
1317
# Ignore local Pipfile
1418
Pipfile
1519
Pipfile.lock

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ matrix:
2424
- os: osx
2525
env: PYTHON_VERSION=2.7
2626

27+
- os: linux
28+
env: PIP_DEPENDENCIES="sphinx-click"
29+
MAIN_CMD="python setup.py build_sphinx"
30+
SETUP_CMD=""
31+
2732
- os: linux
2833
env: PIP_DEPENDENCIES="restructuredtext_lint"
2934
MAIN_CMD="rst-lint README.rst"

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include README.rst
22
include LICENSE
3-
include runtimes.png
43
include AUTHORS
54
include CHANGELOG.rst
5+
include docs/_static/runtimes.png

README.rst

Lines changed: 50 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
.. image:: https://travis-ci.org/bio-phys/MDBenchmark.svg?branch=master
1515
:target: https://travis-ci.org/bio-phys/MDBenchmark
1616

17+
.. image:: https://readthedocs.org/projects/mdbenchmark/badge/?version=latest&style=flat
18+
:target: https://mdbenchmark.readthedocs.io/en/latest/
19+
1720
.. image:: https://codecov.io/gh/bio-phys/MDBenchmark/branch/master/graph/badge.svg
1821
:target: https://codecov.io/gh/bio-phys/MDBenchmark
1922

@@ -32,166 +35,99 @@ resources. It tries to make it as easy as possible to set up systems on varying
3235
numbers of nodes and compare their performances to each other.
3336

3437
You can also create a plot to get a quick overview of the possible performance
35-
(and also show of to your friends)! The plot below shows the performance of an
38+
(and also show of to your friends)! The plot below shows the performance of a
3639
molecular dynamics system on up to five nodes with and without GPUs.
3740

38-
.. image:: https://raw.githubusercontent.com/bio-phys/MDBenchmark/master/runtimes.png
41+
.. image:: https://raw.githubusercontent.com/bio-phys/MDBenchmark/master/docs/_static/runtimes.png
3942

4043

4144
Installation
4245
============
4346

44-
You can install ``mdbenchmark`` via ``pip`` or ``conda``:
45-
46-
.. code::
47+
You can install ``mdbenchmark`` via ``pip``, ``conda`` or ``pipenv``:
4748

48-
$ pip install mdbenchmark
49+
pip
50+
---
4951

5052
.. code::
5153
52-
$ conda install -c conda-forge mdbenchmark
54+
pip install mdbenchmark
5355
54-
Usage with a virtual environments
55-
---------------------------------
56-
57-
We recommend to install the package inside a `conda environment`_. This can
58-
easily be done with ``conda``. The following commands create an environment
59-
called ``benchmark`` and then installs ``mdbenchmark`` and its dependencies.
56+
conda
57+
-----
6058

6159
.. code::
6260
63-
$ conda create -n benchmark
64-
$ conda install -n benchmark -c conda-forge mdsynthesis click mdbenchmark
61+
conda install -c conda-forge mdbenchmark
6562
66-
Before every usage of ``mdbenchmark``, you need to first activate the conda
67-
environment. After doing this once, you can use the tool for the whole duration
68-
of your shell session.
63+
pipenv
64+
------
6965

7066
.. code::
7167
72-
$ source activate benchmark
73-
# mdbenchmark should now be usable!
74-
$ mdbenchmark
75-
Usage: mdbenchmark [OPTIONS] COMMAND [ARGS]...
68+
pipenv install mdbenchmark
69+
70+
After installation MDBenchmark is accessible on your command-line via ``mdbenchmark``::
71+
72+
$ mdbenchmark
73+
Usage: mdbenchmark [OPTIONS] COMMAND [ARGS]...
7674

77-
Generate and run benchmark jobs for GROMACS simulations.
75+
Generate and run benchmark jobs for GROMACS simulations.
7876

79-
Options:
80-
--version Show the version and exit.
81-
--help Show this message and exit.
77+
Options:
78+
--version Show the version and exit.
79+
--help Show this message and exit.
8280

83-
Commands:
84-
analyze analyze finished benchmark.
85-
generate Generate benchmark queuing jobs.
86-
submit Start benchmark simulations.
81+
Commands:
82+
analyze analyze finished benchmark.
83+
generate Generate benchmark queuing jobs.
84+
submit Start benchmark simulations.
8785

8886
Features
8987
========
9088

9189
- Generates benchmarks for GROMACS and NAMD simulations (contributions for other MD engines are welcome!).
9290
- Automatically detects the queuing system on your high-performance cluster and submits jobs accordingly.
9391
- Grabs performance from the output logs and creates a fancy plot.
94-
- Can benchmark systems either with or without GPUs.
95-
96-
Usage
97-
=====
98-
99-
After installation, the ``mdbenchmark`` command should be available to you
100-
globally. If you have installed the package in a virtual environment, make sure
101-
to activate that first!
102-
103-
Benchmark generation for GROMACS
104-
--------------------------------
105-
106-
Assuming your TPR file is called ``protein.tpr`` and you want to run benchmarks
107-
with the module ``gromacs/5.1.4-plumed2.3`` on up to ten nodes, run the
108-
following command:
109-
110-
.. code::
111-
112-
$ mdbenchmark generate --name protein --module gromacs/5.1.4-plumed2.3 --max-nodes 10
113-
114-
To run benchmarks on GPUs simply add the ``--gpu`` flag:
115-
116-
.. code::
117-
118-
$ mdbenchmark generate --name protein --module gromacs/5.1.4-plumed2.3 --max-nodes 10 --gpu
119-
120-
You can also create benchmarks for different versions of GROMACS:
121-
122-
.. code::
123-
124-
$ mdbenchmark generate --name protein --module gromacs/5.1.4-plumed2.3 --module gromacs/2016.4-plumed2.3 --max-nodes 10 --gpu
125-
126-
127-
Benchmark generation for NAMD
128-
-----------------------------
129-
130-
**NAMD support is experimental.** If you encounter any problems or bugs, we
131-
would appreciate to `hear from you`_.
92+
- Benchmarks systems on CPUs and/or GPUs.
13293

133-
Generating benchmarks for NAMD follows a similar process to GROMACS. Assuming
134-
the NAMD configuration file is called ``protein.namd``, you will also need the
135-
corresponding ``protein.pdb`` and ``protein.psf`` inside the same folder.
136-
**Warning:** Please be aware that all paths given in the ``protein.namd`` file
137-
must be absolute paths. This ensures that MDBenchmark does not destroy paths
138-
when copying files around during benchmark generation.
94+
Short usage reference
95+
=====================
13996

140-
In analogy to the GROMACS setup, you can execute the following command to
141-
generate benchmarks for a module named ``namd/2.12``:
97+
The following shows a short usage reference for MDBenchmark. Please consult the
98+
`documentation`_ for a complete guide.
14299

143-
.. code::
144-
145-
$ mdbenchmark generate --name protein --module namd/2.12 --max-nodes 10
146-
147-
To run benchmarks on GPUs add the ``--gpu`` flag:
148-
149-
.. code::
150-
151-
$ mdbenchmark generate --name protein --module namd/2.12-gpu --max-nodes 10 --gpu
152-
153-
Be aware that you will need to specify NAMD modules when running GPU and non-GPU
154-
benchmarks! To work with GPUs, NAMD needs to be compiled separately and will be
155-
probably named differently on the host of your choice. Using the ``--gpu``
156-
option on non-GPU builds of NAMD may lead to poorer performance and erroneous
157-
results.
100+
Benchmark generation
101+
--------------------
158102

159-
Usage with multiple modules
160-
---------------------------
103+
Assuming you want to benchmark GROMACS version 2016.4 and your TPR file is
104+
called ``protein.tpr``, run the following command::
161105

162-
It is possible to generate benchmarks for different MD engines with a single
163-
command:
106+
mdbenchmark generate --name protein --module gromacs/2016.4
164107

165-
.. code::
108+
To run benchmarks on GPUs simply add the ``--gpu`` flag::
166109

167-
$ mdbenchmark generate --name protein --module namd/2.12 --module gromacs/2016.3 --max-nodes 10
110+
mdbenchmark generate --name protein --module gromacs/2016.4 --gpu
168111

169112
Benchmark submission
170113
--------------------
171114

172-
After you generated all benchmarks, you can submit them at once:
173-
174-
.. code::
175-
176-
$ mdbenchmark submit
115+
After you generated your benchmarks, you can submit them at once::
177116

178-
To start specific benchmarks separately, use the ``--directory`` option and
179-
specify the corresponding folder:
180-
181-
.. code::
182-
183-
$ mdbenchmark submit --directory draco_gromacs/5.1.4-plumed2.3
117+
mdbenchmark submit
184118

185119
Benchmark analysis
186120
------------------
187121

188-
As soon as the benchmarks have been submitted you can run the analysis script
189-
via ``mdbenchmark analysis``. When at least one system has finished, the script
190-
will produce a ``.csv`` output file or a plot for direct usage (via the
191-
``--plot`` option).
122+
As soon as the benchmarks have been submitted you can run the analysis via
123+
``mdbenchmark analysis``. When at least one system has finished, the script will
124+
produce a ``.csv`` output file or a plot for direct usage (via the ``--plot``
125+
option).
192126

193127
**Note:** The plotting function currently only allows to plot a CPU and GPU
194-
benchmark from the same module. We are working on fixing this. If you want to
128+
benchmark from the *same* module. This will be fixed in an upcoming version and
129+
is already implemented in the `develop
130+
<https://github.com/bio-phys/MDBenchmark/tree/develop>`_ branch. If you want to
195131
compare different modules with each other, either use the ``--directory`` option
196132
to generate separate plots or create your own plot from the provided CSV file.
197133

@@ -206,84 +142,12 @@ to generate separate plots or create your own plot from the provided CSV file.
206142
4 gromacs/5.1.4-plumed2.3 5 51.71 15 False draco 160
207143
208144
209-
Defining Host Templates
210-
=======================
211-
212-
It is possible to define your own host templates in addition to the ones shipped
213-
with the package. A template file should have the same filename as the UNIX
214-
command ``hostname`` returns to be detected automatically. Otherwise you can
215-
point MDBenchmark to a specific template by providing its name via the
216-
``--host`` option.
217-
218-
Assuming you created a new host template in your home directory ``~/.config/MDBenchmark/my_custom_hostfile``::
219-
220-
$ mdbenchmark generate protein --host my_custom_hostfile --module gromacs/5.1.4-plumed2.3
221-
222-
Here is an example job template for the MPG cluster ``hydra``.
223-
224-
.. code::
225-
226-
# @ shell=/bin/bash
227-
#
228-
# @ error = {{ name }}.err.$(jobid)
229-
# @ output = {{ name }}.out.$(jobid)
230-
# @ job_type = parallel
231-
# @ node_usage = not_shared
232-
# @ node = {{ n_nodes }}
233-
# @ tasks_per_node = 20
234-
{%- if gpu %}
235-
# @ requirements = (Feature=="gpu")
236-
{%- endif %}
237-
# @ resources = ConsumableCpus(1)
238-
# @ network.MPI = sn_all,not_shared,us
239-
# @ wall_clock_limit = {{ formatted_time }}
240-
# @ queue
241-
242-
module purge
243-
module load {{ module }}
244-
245-
# run {{ module }} for {{ time }} minutes
246-
poe gmx_mpi mdrun -deffnm {{ name }} -maxh {{ time / 60 }}
247-
248-
MDBenchmark passes the following variables to each template:
249-
250-
+----------------+---------------------------------------------------------------------+
251-
| Value | Description |
252-
+================+=====================================================================+
253-
| name | Name of the TPR file |
254-
+----------------+---------------------------------------------------------------------+
255-
| gpu | Boolean that is true, if GPUs are requested |
256-
+----------------+---------------------------------------------------------------------+
257-
| module | Name of the module to load |
258-
+----------------+---------------------------------------------------------------------+
259-
| n_nodes | Maximal number of nodes to run on |
260-
+----------------+---------------------------------------------------------------------+
261-
| time | Benchmark run time in minutes |
262-
+----------------+---------------------------------------------------------------------+
263-
| formatted_time | Run time for the queuing system in human readable format (HH:MM:SS) |
264-
+----------------+---------------------------------------------------------------------+
265-
266-
To ensure correct termination of jobs ``formatted_time`` is 5 minutes longer
267-
than ``time``.
268-
269-
MDBenchmark will look for user templates in the `xdg`_ config folders defined by
270-
the environment variables ``XDG_CONFIG_HOME`` and ``XDG_CONFIG_DIRS`` which by
271-
default are set to ``$HOME/.config/MDBenchmark`` and ``/etc/xdg/MDBenchmark``,
272-
respectively. If the variable ``MDBENCHMARK_TEMPLATES`` is set, the script will
273-
also search in that directory.
274-
275-
MDBenchmark will first search in ``XDG_CONFIG_HOME`` and ``XDG_CONFIG_DIRS`` for
276-
a suitable template file. This means it is possible to overwrite system-wide
277-
installed templates or templates shipped with the package.
278-
279145
Contributing
280146
============
281147

282148
Contributions to the project are welcome! Information on how to contribute to
283149
the project can be found in `CONTRIBUTING.md`_ and `DEVELOPER.rst`_.
284150

285-
.. _conda environment: https://conda.io/docs/user-guide/tasks/manage-environments.html
286-
.. _hear from you: https://github.com/bio-phys/MDBenchmark/issues/new
287-
.. _xdg: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
151+
.. _documentation: https://mdbenchmark.readthedocs.io/en/latest/
288152
.. _CONTRIBUTING.md: https://github.com/bio-phys/MDBenchmark/blob/master/.github/CONTRIBUTING.md
289153
.. _DEVELOPER.rst: https://github.com/bio-phys/MDBenchmark/blob/master/DEVELOPER.rst

docs/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS = --ignore .doctrees/environment.pickle
6+
SPHINXBUILD = sphinx-build
7+
SPHINXAUTOBUILD = sphinx-autobuild
8+
SPHINXPROJ = MDBenchmark
9+
SOURCEDIR = .
10+
BUILDDIR = _build
11+
12+
# Put it first so that "make" without argument is like "make help".
13+
help:
14+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
15+
16+
build:
17+
@$(SPHINXAUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS)
18+
19+
.PHONY: help build Makefile
20+
21+
# Catch-all target: route all unknown targets to Sphinx using the new
22+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
23+
%: Makefile
24+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
File renamed without changes.

docs/_templates/sidebarintro.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<h2><a href="/">MDBenchmark documentation</a></h2>
2+
3+
<p>
4+
<iframe src="https://ghbtns.com/github-btn.html?user=bio-phys&repo=mdbenchmark&type=watch&count=true&size=large"
5+
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
6+
</p>
7+
8+
<p>
9+
<strong>MDBenchmark</strong> helps you to squeeze the maximum out of your
10+
limited computing resources.
11+
</p>
12+
13+
<h3>Useful Links</h3>
14+
<ul>
15+
<li><a href="http://github.com/bio-phys/mdbenchmark">MDBenchmark @ GitHub</a></li>
16+
<li><a href="http://pypi.org/project/mdbenchmark">MDBenchmark @ PyPI</a></li>
17+
<li><a href="http://github.com/bio-phys/mdbenchmark/issues">Issue Tracker</a></li>
18+
</ul>

0 commit comments

Comments
 (0)