Skip to content

Commit

Permalink
Add Readthedocs site (#29)
Browse files Browse the repository at this point in the history
* Added Cray-DRC Support

* Set DRC variable only when available

* Removed Python Bindings from compilation

* Added drc info for clients without MPI

* Added const keyword to metadata API

* clang formatting

* Initial doc commit

* Remove python configuration from readthedocs

* Make attempting the python bindings dependent on having a python build

* Move policies from bindings out to main CMakeLists.txt

* Fixed bug that was stopping multi-node DHT updates

* Add a test with misaligned DHT updates vs writes

* Only subtract found elements that are in the server's index range

* When processing subs, consider hash segment overlap

* Remove duplicates in obj_desc list sent in reply to query_rpc

* Formatting

* Warning cleanup

* format fixes

* Added Cray-DRC Support

* Set DRC variable only when available

* Added drc info for clients without MPI

* Added const keyword to metadata API

* clang formatting

* Add dspaces_iput for non-blocking puts

* Adapt test_writer_server to iput option

* Formatting

* Make attempting the python bindings dependent on having a python build

* Move policies from bindings out to main CMakeLists.txt

* Add flag to suppress type mismatch error in gcc-10

* A little better handling of numpy includes

* Added missing init file

* Theme update

* Added theme deps

* index update test

* Add installation page

* Update index

* index update

* Fix of link

* Set wait on sub request before sending to server. Avoids notify coming back before the sub is reqdy.

* index additions

* Formatting

* Add first layer doc files

* Add finalize flag to requests

* Update test for new allocate flag

* Add allocate flag to dspaces_iput

* Free data buffer when finalizing put request

* Add check flag to dspaces_iput

* Initial doc commit

* Remove python configuration from readthedocs

* Theme update

* Added theme deps

* index update test

* Add installation page

* Update index

* index update

* Fix of link

* index additions

* Add first layer doc files

* Add installation instructions

* usage

* Usage

* usage

* usage

* usage

* Added namespace for cmake exports

* usage

* running.rst

* running

* api

* Configure make file for exmamples

* Updated example dataspaces.conf files

* Update example documentation

Co-authored-by: pradsubedi <[email protected]>
Co-authored-by: pradsubedi <[email protected]>
Co-authored-by: Philip Davis <[email protected]>
  • Loading branch information
4 people authored Oct 15, 2021
1 parent 9dc22a2 commit 0a5083f
Show file tree
Hide file tree
Showing 23 changed files with 451 additions and 32 deletions.
20 changes: 20 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: "3.7"
install:
- requirements: docs/requirements.txt
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,11 @@ if(${ENABLE_TESTS})
add_subdirectory(tests)
endif(${ENABLE_TESTS})
if(${ENABLE_EXAMPLES})
add_subdirectory(examples)
configure_file(
${PROJECT_SOURCE_DIR}/examples/opts.mk.in
${PROJECT_BINARY_DIR}/examples/opts.mk
@ONLY
)
file(GLOB EXAMPLE_DIRS ${PROJECT_SOURCE_DIR}/examples/ex*)
file(COPY ${PROJECT_SOURCE_DIR}/examples/Makefile ${EXAMPLE_DIRS} DESTINATION ${PROJECT_BINARY_DIR}/examples)
endif(${ENABLE_EXAMPLES})
2 changes: 1 addition & 1 deletion bindings/python/dspaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from dspaces_wrapper import *
from dspaces.dspaces_wrapper import *
import numpy as np

class dspaces:
Expand Down
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = .build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
4 changes: 4 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DataSpaces API
==============


184 changes: 184 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = u'DataSpaces'
copyright = u'2021, '
author = u''

# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u''


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['.templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [u'.build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'renku'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['.static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'DataSpacesdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'DataSpaces.tex', u'DataSpaces Documentation',
u'Philip Davis', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'dataspaces', u'DataSpaces Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'DataSpaces', u'DataSpaces Documentation',
author, 'DataSpaces', 'One line description of project.',
'Miscellaneous'),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


# -- Extension configuration -------------------------------------------------

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
2 changes: 2 additions & 0 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DataSpaces Examples
===================
32 changes: 32 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. DataSpaces documentation master file, created by
sphinx-quickstart on Tue Sep 28 14:04:59 2021.
Welcome to DataSpaces
=====================

DataSpaces is a communication library aimed at supporting interactions between large-scale scientific simulation, analysis, and visualization programs.
DataSpaces enables programs to write to and read from shared N-dimensional arrays without centralized query processing or indexing using low-latency RDMA transfers.
The result is highly-scalable data access between components of an HPC workflow.
DataSpaces can be used to tranfer data in *in-situ* workflows, such as coupled simulations and in-situ analysis workflows,
moving data through shared memory and RDMA tranfers, rather than using the file system.
Like a shared file system, DataSpaces allow data readers to be decoupled from writers in both space in time.
In other words, no sychronization of writers and readers is required, and readers may access data written by any process.


Contents
========

.. toctree::

installation
usage
running
API
examples

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
42 changes: 42 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Installing
==========

The easiest way to install DataSpaces is using `Spack <https://spack.readthedocs.io/en/latest/>`_. Spack is a package manager aimed at HPC and scientific computing.
Using Spack simplifies the installation of DataSpaces and its dependencies.

Installing Spack
----------------

To install Spack, follow the getting started instructions found `here <https://spack.readthedocs.io/en/latest/getting_started.html>`_.
This will install the package manager, and make a large variety of packages available.

Installing the DataSpaces repository
------------------------------------

The DataSpaces group maintains a repository for the DataSpaces spack package (and any relevant ancillary packages). This can be found `here <https://github.com/rdi2dspaces/dspaces-spack>`_.
In order to use this package, you will need to first install Spack using the above instructions.
Once you have done this, you can load the DataSpaces package repository by doing the following:

.. code-block:: console
git clone https://github.com/rdi2dspaces/dspaces-spack.git
spack repo add dspaces-spack
Installing DataSpaces
---------------------

One the DataSpaces repository has been loaded, the dataspaces package can be installed with:

.. code-block:: console
spack install dataspaces
This will automatically install allDdataSpaces dependencies and the dataspaces package itself.
Once the package has been installed the command:

.. code-block:: console
spack load dataspaces
Configures the environment to use DataSpaces, adding the server binary's directory to `PATH`, any shared library paths to `LD_LIBRARY_PATH`, etc.
This simplifies building and running programs that use DataSpaces.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
renku-sphinx-theme
57 changes: 57 additions & 0 deletions docs/running.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
How to Run
==========

Running the Server
-----------------
The DataSpaces server expects to find the `dataspaces.conf` file in its working directory.
The format of this file is a list of configuration values, one per line.
The possible values are as follows:

`<variable> = <value>`, e.g.
`num_apps = 1`

`num_apps`: this value is the number of `dspaces_kill()` calls from clients that are needed to kill the server binary.

`ndim`: number of dimensions for the default global data domain.

`dims`: size of each dimension for the default global data domain.

`max_versions`: maximum number of versions of a data object to be cached in DataSpaces servers.

`hash_version`: the type of distributed hash table used. A value of `1` means that a Hilbert SFC is partitioned into continuous segments and distributed across the servers.
A value of `2` means the space is partitioned by repeating bisection along the longest domain.

*NOTES* on what values to use

The global dimensions have implications for performance. Data indexing will be partitioned evently across the global dimensions,
and so if data is only being writtent to a subset of the global dimensions there is a risk of unabalanced indexing load.
Ideally, the data domain being written to will match the global dimensions as closely as possible. The default value set in
`dataspaces.conf` is for convenience. The application can set this per variable with `dspaces_define_gdim()`.

`hash_version = 1` has better locality in the most general case, and should be preferred unless the dimensions of the data
domain are not a power of two or the ratio of longest to shortest dimension is greater than two.

`num_apps` should be set in conjunction with how `dspaces_kill()` is used in the application(s) using dataspaces. Generally, one rank
of each application should call `dspaces_kill()`, and the number of process groups using dataspaces will be the same as `num_apps`.
Occasionally, it is not practical to have a client call `dspaces_kill()`, and the dataspaces repo provides a standalone binary `terminator`
to send a single `dspaces_kill()` and then exit.

Bootstrapping communication
---------------------------
The server produces a bootstrap file during its init phase, `conf.ds`. This file must be read by the clients (or rank zero of the clients
if `dspaces_init_mpi()` is being used. This file provides the clients with enough information to make initial contact with the server and
perform wire-up. In order to find this file, the server and client application must be run in the same working directory, or at last a symlink of `ds.conf` should be present.

Environment variables
---------------------
There are a few environment variables that can be used to influence DataSpaces.

`DSPACES_DEBUG` - enables substantial debug output for both clients and server.

`DSPACES_DEFAULT_NUM_HANDLERS` - the number of request handling threads launched by the server (in addition to the main thread). Default: 4.
This value should be changed if it is likely to oversubscribe or underutilize the node the server is running on.

Running the server
------------------

The server binary, `dspaces_server`, takes a single argument: the listen_address. This is a Mercury-specific connection string (see Mercury documentation for details.) Common values are: `sockets` to use TCP for communication, `sm` for shared memory (if all clienta and server processes are on the same node) and `ofi+X` for RDMA, where `X` is `verbs`, `psm2`, or `cray` as is appropriate for the system fabric.
Loading

0 comments on commit 0a5083f

Please sign in to comment.