Skip to content

Commit

Permalink
deploy: 1177dbd
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Nov 14, 2023
1 parent 7759418 commit 3279cde
Show file tree
Hide file tree
Showing 54 changed files with 3,443 additions and 241 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 1b1501f97a74dce1b0ae5f6f0c31f428
config: 878c152044dfb5049531fd6e897ecbff
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/_static/code-blocks-note.doctree
Binary file not shown.
Binary file added .doctrees/_static/swc-wiki-warning.doctree
Binary file not shown.
Binary file added .doctrees/data_analysis/HPC-module-SLEAP.doctree
Binary file not shown.
Binary file modified .doctrees/data_analysis/index.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/open_science/Data-sharing.doctree
Binary file not shown.
Binary file modified .doctrees/open_science/Licensing.doctree
Binary file not shown.
Binary file added .doctrees/programming/SLURM-arguments.doctree
Binary file not shown.
Binary file modified .doctrees/programming/SSH-SWC-cluster.doctree
Binary file not shown.
Binary file modified .doctrees/programming/index.doctree
Binary file not shown.
597 changes: 597 additions & 0 deletions _sources/data_analysis/HPC-module-SLEAP.md.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _sources/data_analysis/index.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Guides related to the analysis of neuroscientific data, spanning a wide range of
```{toctree}
:maxdepth: 1

HPC-module-SLEAP
```
44 changes: 22 additions & 22 deletions _sources/open_science/Data-sharing.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Currently, SWC does not have any specific code and data sharing requirements, bu


## Code
Original code can be hosted in a public GitHub/GitLab repository, hosted on an organisational account (i.e. not an individual account). This could be the [SWC organisation](https://github.com/SainsburyWellcomeCentre), or that of a particular team, lab or collaboration. To enable reuse, code should include an [appropriate license](https://howto.neuroinformatics.dev/guides/Licensing.html).
Original code can be hosted in a public GitHub/GitLab repository, hosted on an organisational account (i.e. not an individual account). This could be the [SWC organisation](https://github.com/SainsburyWellcomeCentre), or that of a particular team, lab or collaboration. To enable reuse, code should include an [appropriate license](licensing-target).

To ensure a permanent archive of the code associated with a publication a [DOI](https://www.doi.org/) should be created (e.g. using [Zenodo](https://docs.github.com/en/repositories/archiving-a-github-repository/referencing-and-citing-content)).

Expand All @@ -46,7 +46,7 @@ In some cases, there may be a modality or field-specific repository that would b
In all cases, using a repository that can create a [DOI](https://www.doi.org/) will help increase citations.

### Structure
There is no single best way to structure your data, but it must be in a form that allows users to easily reuse it for their own purposes. This may be by adopting specific file formats (such as [NeuroData Without Borders](https://www.nwb.org/)). Alternatively the data could be organised within a standardised project folder structure. Many labs have their own system, but those starting from scratch may wish to use the [SWC-Blueprint data structure](https://swc-blueprint.neuroinformatics.dev/).
There is no single best way to structure your data, but it must be in a form that allows users to easily reuse it for their own purposes. This may be by adopting specific file formats (such as [NeuroData Without Borders](https://www.nwb.org/)). Alternatively the data could be organised within a standardised project folder structure. Many labs have their own system, but those starting from scratch may wish to use the [NeuroBlueprint data structure](https://neuroblueprint.neuroinformatics.dev/).

**However the data is structured, all relevant metadata must be included with the raw data.**

Expand All @@ -55,23 +55,23 @@ If you have any technical questions about sharing data or code, please contact a

(repo-table)=
## Reference of potential repositories for neuroscience data
| Repository |URL |Domain |
|------------------------------------|---------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| Globus | |Anything |
| figshare |https://rdr.ucl.ac.uk/The_Sainsbury_Wellcome_Centre|Anything |
| Zenodo |https://zenodo.org/ |Anything |
| Dryad |https://datadryad.org |Anything |
| GIN (German Neuroinformatics Node) |https://gin.g-node.org/ |Neuroscience |
| EBRAINS |https://ebrains.eu/service/share-data |Neuroscience |
| Open Source Brain |https://www.v2.opensourcebrain.org/ |Any neuroscience data (data must be hosted elsewhere) |
| Brain Image Library |http://www.brainimagelibrary.org/ |Large brain image datasets |
| Image data resource |https://idr.openmicroscopy.org/ |Reference image datasets |
| BioImage Archive |https://www.ebi.ac.uk/bioimage-archive/ |Biological images |
| DANDI |https://dandiarchive.org/ |Electrophysiology, optophysiology, behavioural time-series and images from immunostaining experiments|
| NeMO |https://nemoarchive.org/ |Omic data from the BRAIN Initiative (& others) |
| Openneuro |https://openneuro.org/ |BIDS-compliant MRI, PET, EEG etc |
| CRCNS |https://crcns.org/ |Computational neuroscience |
| BrainGlobe |https://gin.g-node.org/BrainGlobe/atlases |Brain Atlases |
| NeuroMorpho |https://neuromorpho.org/ |Neuronal morphologies |
| Cell Image Library |http://ccdb.ucsd.edu/home |Cell images |
| ModelDB |https://senselab.med.yale.edu/ModelDB/ |Computational neuroscience models |
| Repository | URL | Domain |
| ---------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Globus | | Anything |
| figshare | https://rdr.ucl.ac.uk/The_Sainsbury_Wellcome_Centre | Anything |
| Zenodo | https://zenodo.org/ | Anything |
| Dryad | https://datadryad.org | Anything |
| GIN (German Neuroinformatics Node) | https://gin.g-node.org/ | Neuroscience |
| EBRAINS | https://ebrains.eu/service/share-data | Neuroscience |
| Open Source Brain | https://www.v2.opensourcebrain.org/ | Any neuroscience data (data must be hosted elsewhere) |
| Brain Image Library | http://www.brainimagelibrary.org/ | Large brain image datasets |
| Image data resource | https://idr.openmicroscopy.org/ | Reference image datasets |
| BioImage Archive | https://www.ebi.ac.uk/bioimage-archive/ | Biological images |
| DANDI | https://dandiarchive.org/ | Electrophysiology, optophysiology, behavioural time-series and images from immunostaining experiments |
| NeMO | https://nemoarchive.org/ | Omic data from the BRAIN Initiative (& others) |
| Openneuro | https://openneuro.org/ | BIDS-compliant MRI, PET, EEG etc |
| CRCNS | https://crcns.org/ | Computational neuroscience |
| BrainGlobe | https://gin.g-node.org/BrainGlobe/atlases | Brain Atlases |
| NeuroMorpho | https://neuromorpho.org/ | Neuronal morphologies |
| Cell Image Library | http://ccdb.ucsd.edu/home | Cell images |
| ModelDB | https://senselab.med.yale.edu/ModelDB/ | Computational neuroscience models |
3 changes: 2 additions & 1 deletion _sources/open_science/Licensing.md.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(licensing-target)=
# Software licensing

## Disclaimer
Expand Down Expand Up @@ -50,4 +51,4 @@ If it is installed separately, and you simply call the library (e.g. using a Pyt
Firstly, you should ensure that the license for your code is compatible with the included code (e.g. by using a [license compatibility checking tool](https://joinup.ec.europa.eu/collection/eupl/solution/joinup-licensing-assistant/jla-compatibility-checker)). You should also adhere to any terms of the third party license and it is good practice to always include a copy of this license with the third party code.

## Acknowledgements
This document was adapted from the excellent [Imperial OSS license document](https://www.imperial.ac.uk/enterprise/staff/industry-partnerships-and-commercialisation/commercialisation/intellectual-property-guidance/open-source-software-licences/).
This document was adapted from the excellent [Imperial OSS license document](https://www.imperial.ac.uk/research-and-innovation/support-for-staff/scholarly-communication/research-data-management/sharing-data/research-software/).
147 changes: 147 additions & 0 deletions _sources/programming/SLURM-arguments.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
(slurm-arguments-target)=
# SLURM arguments primer

```{include} ../_static/swc-wiki-warning.md
```

## Abbreviations
| Acronym | Meaning |
| ------- | -------------------------------------------- |
| SWC | Sainsbury Wellcome Centre |
| HPC | High Performance Computing |
| SLURM | Simple Linux Utility for Resource Management |
| MPI | Message Passing Interface |


## Overview
SLURM is a job scheduler and resource manager used on the SWC HPC cluster.
It is responsible for allocating resources (e.g. CPU cores, GPUs, memory) to jobs submitted by users.
When submitting a job to SLURM, you can specify various arguments to request the resources you need.
These are called SLURM directives, and they are passed to SLURM via the `sbatch` or `srun` commands.

These are often specified at the top of a SLURM job script,
e.g. the lines that start with `#SBATCH` in the following example:

```{code-block} bash
#!/bin/bash

#SBATCH -J my_job # job name
#SBATCH -p gpu # partition (queue)
#SBATCH -N 1 # number of nodes
#SBATCH --mem 16G # memory pool for all cores
#SBATCH -n 4 # number of cores
#SBATCH -t 0-06:00 # time (D-HH:MM)
#SBATCH --gres gpu:1 # request 1 GPU (of any kind)
#SBATCH -o slurm.%N.%j.out # STDOUT
#SBATCH -e slurm.%N.%j.err # STDERR
#SBATCH --mail-type=ALL
#SBATCH [email protected]
#SBATCH --array=1-12%4 # job array index values

# load modules
...

# execute commands
...
```
This guide provides only a brief overview of the most important SLURM arguments,
to demysify the above directives and help you get started with SLURM.
For a more detailed description see the [SLURM documentation](https://slurm.schedmd.com/sbatch.html).

## Commonly used arguments

### Partition (Queue)
- *Name:* `--partition`
- *Alias:* `-p`
- *Description:* Specifies the partition (or queue) to submit the job to. To see a list of all partitions/queues, the nodes they contain and their respective time limits, type `sinfo` when logged in to the HPC cluster.
- *Example values:* `gpu`, `cpu`, `fast`, `medium`

### Job Name
- *Name:* `--job-name`
- *Alias:* `-J`
- *Description:* Specifies a name for the job, which will appear in various SLURM commands and logs, making it easier to identify the job (especially when you have multiple jobs queued up)
- *Example values:* `training_run_24`

### Number of Nodes
- *Name:* `--nodes`
- *Alias:* `-N`
- *Description:* Defines the number of nodes required for the job.
- *Example values:* `1`

:::{warning}
This should always be `1`, unless you really know what you're doing,
e.g. you are parallelising your code across multiple nodes with MPI.
:::

### Number of Cores
- *Name:* `--ntasks`
- *Alias:* `-n`
- *Description:* Defines the number of cores (or tasks) required for the job.
- *Example values:* `4`, `8`, `16`

### Memory Pool for All Cores
- *Name:* `--mem`
- *Description:* Specifies the total amount of memory (RAM) required for the job across all cores (per node)
- *Example values:* `8G`, `16G`, `32G`

### Time Limit
- *Name:* `--time`
- *Alias:* `-t`
- *Description:* Sets the maximum time the job is allowed to run. The format is D-HH:MM, where D is days, HH is hours, and MM is minutes.
- *Example values:* `0-01:00` (1 hour), `0-04:00` (4 hours), `1-00:00` (1 day).

:::{warning}
If the job exceeds the time limit, it will be terminated by SLURM.
On the other hand, avoid requesting way more time than what your job needs,
as this may delay its scheduling (depending on resource availability).
:::

### Generic Resources (GPUs)
- *Name:* `--gres`
- *Description:* Requests generic resources, such as GPUs.
- *Example values:* `gpu:1`, `gpu:rtx2080:1`, `gpu:rtx5000:1`, `gpu:a100_2g.10gb:1`

:::{warning}
No GPU will be allocated to you unless you specify it via the `--gres` argument (even if you are on the 'gpu' partition).
To request 1 GPU of any kind, use `--gres gpu:1`. To request a specific GPU type, you have to include its name, e.g. `--gres gpu:rtx2080:1`.
You can view the available GPU types on the [SWC internal wiki](https://wiki.ucl.ac.uk/display/SSC/CPU+and+GPU+Platform+architecture).
:::

### Standard Output File
- *Name:* `--output`
- *Alias:* `-o`
- *Description:* Defines the file where the standard output (STDOUT) will be written. In the examples scripts, it's set to slurm.%N.%j.out, where %N is the node name and %j is the job ID.
- *Example values:* `slurm.%N.%j.out`, `slurm.MyAwesomeJob.out`

:::{note}
This file contains the output of the commands executed by the job (i.e. the messages that normally gets printed on the terminal).
:::

### Standard Error File
- *Name:* `--error`
- *Alias:* `-e`
- *Description:* Specifies the file where the standard error (STDERR) will be written. In the examples, it's set to slurm.%N.%j.err, where %N is the node name and %j is the job ID.
- *Example values:* `slurm.%N.%j.err`, `slurm.MyAwesomeJob.err`

:::{note}
This file is very useful for debugging, as it contains all the error messages produced by the commands executed by the job.
:::

### Email Notifications
- *Name:* `--mail-type`
- *Description:* Defines the conditions under which the user will be notified by email.
- *Example values:* `ALL`, `BEGIN`, `END`, `FAIL`

### Email Address
- *Name:* `--mail-user`
- *Description:* Specifies the email address to which notifications will be sent.
- *Example values:* `[email protected]`

### Array jobs
- *Name:* `--array`
- *Description:* Job array index values (a list of integers in increasing order). The task index can be accessed via the `SLURM_ARRAY_TASK_ID` environment variable.
- *Example values:* `--array=1-10` (10 jobs), `--array=1-100%5` (100 jobs, but only 5 of them will be allowed to run in parallel at any given time).

:::{warning}
If an array consists of many jobs, using the `%` syntax to limit the maximum number of parallel jobs is recommended to prevent overloading the cluster.
:::
17 changes: 9 additions & 8 deletions _sources/programming/SSH-SWC-cluster.md.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(ssh-cluster-target)=
# Set up SSH for the SWC HPC cluster

This guide explains how to connect to the SWC's HPC cluster via SSH.
Expand All @@ -9,14 +10,14 @@ This guide explains how to connect to the SWC's HPC cluster via SSH.
```

## Abbreviations
| Acronym | Meaning |
| --- | --- |
| SWC | Sainsbury Wellcome Centre |
| HPC | High Performance Computing |
| SLURM | Simple Linux Utility for Resource Management |
| SSH | Secure (Socket) Shell protocol |
| IDE | Integrated Development Environment |
| GUI | Graphical User Interface |
| Acronym | Meaning |
| ------- | -------------------------------------------- |
| SWC | Sainsbury Wellcome Centre |
| HPC | High Performance Computing |
| SLURM | Simple Linux Utility for Resource Management |
| SSH | Secure (Socket) Shell protocol |
| IDE | Integrated Development Environment |
| GUI | Graphical User Interface |

## Prerequisites
- You have an SWC account and know your username and password.
Expand Down
1 change: 1 addition & 0 deletions _sources/programming/index.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Small tips and tricks that do not warrant a long-form guide can be found in the
```{toctree}
:maxdepth: 1

SLURM-arguments
SSH-SWC-cluster
SSH-vscode
Mount-ceph-ubuntu
Expand Down
4 changes: 4 additions & 0 deletions _static/check-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3279cde

Please sign in to comment.