Skip to content
Snippets Groups Projects
Commit 7fab3b75 authored by pthouvenin's avatar pthouvenin
Browse files

add: Initial commit

parents
No related branches found
No related tags found
No related merge requests found
# Created by https://www.toptal.com/developers/gitignore/api/vscode,macos,python,windows,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=vscode,macos,python,windows,linux
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
doc/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# profiling data
.prof
### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.toptal.com/developers/gitignore/api/vscode,macos,python,windows,linux
# vscode
.vscode/
# MAC
*.DS_Store
# np data
*.npy
*.h5
*.hdf5
*.zarr
results/
*.pdf
logs/
# dask
dask-worker-space
*.html
# coverage
# coverage_html_report/
debug/
# Slurm log files
*.err
*.out
profile.*
*.ppk
# local folders
archive_steendonk_results/
README.md 0 → 100644
# dspa
[![license](https://img.shields.io/badge/license-GPL--3.0-brightgreen.svg)](LICENSE)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
![Python](https://img.shields.io/badge/python-3670A0?style=flat&logo=python&logoColor=ffdd54)
[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
<details>
<summary>Table of content</summary>
## Table of content
- [dspa](#dspa)
- [Table of content](#table-of-content)
- [Description](#description)
- [Installation](#installation)
- [Experiments](#experiments)
- [Versioning](#versioning)
- [License](#license)
</details>
______________________________________________________________________
## Description
This repository contains a subset of the Python codes associated with the distributed Split and Augment Gibbs sampler (DSPA) described in the following paper (reproducing Table 4).
> \[1\] P.-A. Thouvenin, A. Repetti, P. Chainais - **P.-A. Thouvenin, A. Repetti, P. Chainais**, submitted to *JCGS*, vol. ..., no. ..., pp. ..., year.
**Authors**: P.-A. Thouvenin, A. Repetti, P. Chainais
______________________________________________________________________
## Installation
- Clone the current repository and create an anaconda environment as follows.
```bash
# If you need to install Miniconda
wget -P path/to/install https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh # say yes to the default options
conda install -c anaconda conda-build
source ~/.bashrc # or .zshrc, depending on your shell
# Cloning the repo
git clone https://gitlab.com/pthouvenin/dspa.git
cd dspa
# Create anaconda environment
conda create --name demo-jcgs --file conda-osx-64.lock # or linux-64, win-64
# Install the proposed Python library in development mode in the environment
conda activate demo-jcgs
conda develop src/
# equivalent in pip:
# pip install -e .
```
- To possibly avoid [file lock issue in h5py](https://github.com/h5py/h5py/issues/1101), add the following to the `~/.zshrc` file (or `~/.bashrc`)
```bash
export HDF5_USE_FILE_LOCKING='FALSE'
```
## Experiments
- The `.sh` script provided in the `examples/deconvolution` folder require [`tmux`](https://github.com/tmux/tmux/wiki/Installing) to be installed. It opens a session in the background, from which the Python script provided is running.
To run a representative example of the experiments from the `examples/deconvolution` folder, configure and run the `submit_local_serial.sh` script (to run the serial version of the sampler), or the `submit_local.sh` script (for the distributed sampler). Both contain similar parameters to be configured (more details in these 2 files).
- An example to reproduce the results of the strong scaling experiment from Table 4, using the `submit_local.sh` and `submit_metric_p.sh` scripts, is reported below.
```bash
conda activate demo-jcgs
# * generate the data (only required once)
# set dataflag='--data' in submit_local.sh, then execute
bash submit_local.sh
# check name of the tmux session, called session_name in the following
tmux list-session
tmux a -t session_name # press crtl+b to kill the session once the work is done
# * run the sampler
# set dataflag='', in submit_local.sh, then, execute
bash submit_local.sh
# check name of the tmux session, called session_name in the following
tmux list-session
tmux a -t session_name
# to detach from a session (leave it running in the background, press ctrl+b, then ctrl+d)
# in the tmux session, press crtl+b to kill it once the work is done or, from a normal terminal
tmux kill-session -t session_name
# * deactivating the conda environment (when no longer needed)
conda deactivate
```
- To quickly inspect the content of an [`.h5`](https://docs.h5py.org/en/stable/mpi.html?highlight=h5dump#using-parallel-hdf5-from-h5py) file from the terminal (e.g., of some of the checkpoint files produces), the following commands may prove useful.
```bash
# replace <filename> by the name of your file
h5dump --header <filename>.h5 # displays the name and size of all variables contained in the file
h5dump <filename>.h5 # diplays the value of all the variables saved in the file
h5dump -d "/GroupFoo/databar[1,1;2,3;3,19;1,1]" <filename>.h5 # display part of the variable "databar" from the dataset GroupFoo within a given .h5 file
h5dump -d dset <filename>.h5 # displays content of a dataset dset
h5dls -d <filename>.h5/dset # displays content of a dataset dset
df -h --total # check total disk usage
du -sh ~ # disk usage for the current user (in ~ directory)
```
Please check the [`h5py`](https://docs.h5py.org/en/stable/quick.html) documentation for further details.
______________________________________________________________________
## Versioning
This project will use [SemVer](https://semver.org/) for versioning, once the API is fully specified.
______________________________________________________________________
## License
The project is licensed under the [GPL-3.0 license](LICENSE).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment