Skip to content

Commit ad35248

Browse files
authored
Merge pull request #337 from pyiron/docs
Reformat docs
2 parents 3b454dc + 0eaa898 commit ad35248

File tree

5 files changed

+98
-38
lines changed

5 files changed

+98
-38
lines changed

docs/advanced.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Advanced Configuration
2-
Initially `pysqa` was only designed to interact with the local queuing systems of an HPC cluster. This functionality has recently been extended to support remote HPC clusters in addition to local HPC clusters. These two developments, the support for remote HPC clusters and the support for multiple clusters in `pysqa` are discussed in the following. Both of these features are under active development so this part of the interface might change more frequently than the rest.
2+
Initially `pysqa` was only designed to interact with the local queuing systems of an HPC cluster. This functionality has
3+
recently been extended to support remote HPC clusters in addition to local HPC clusters. These two developments, the
4+
support for remote HPC clusters and the support for multiple clusters in `pysqa` are discussed in the following. Both of
5+
these features are under active development so this part of the interface might change more frequently than the rest.
36

47
## Remote HPC Configuration
58
Remote clusters can be defined in the `queue.yaml` file by setting the `queue_type` to `REMOTE`:
@@ -30,23 +33,27 @@ In addition to `queue_type`, `queue_primary` and `queues` parameters, this also
3033

3134
And optional keywords:
3235

33-
* `ssh_delete_file_on_remote` specify whether files on the remote HPC should be deleted after they are transferred back to the local system - defaults to `True`
36+
* `ssh_delete_file_on_remote` specify whether files on the remote HPC should be deleted after they are transferred back
37+
to the local system - defaults to `True`
3438
* `ssh_port` the port used for the SSH connection on the remote HPC cluster - defaults to `22`
3539

36-
A definition of the `queues` in the local system is required to enable the parameter checks locally. Still it is sufficient to only store the individual submission script templates only on the remote HPC.
40+
A definition of the `queues` in the local system is required to enable the parameter checks locally. Still it is
41+
sufficient to only store the individual submission script templates only on the remote HPC.
3742

3843
## Access to Multiple HPCs
3944
To support multiple remote HPC clusters additional functionality was added to `pysqa`.
4045

41-
Namely, a `clusters.yaml` file can be defined in the configuration directory, which defines multiple `queue.yaml` files for different clusters:
46+
Namely, a `clusters.yaml` file can be defined in the configuration directory, which defines multiple `queue.yaml` files
47+
for different clusters:
4248
```
4349
cluster_primary: local_slurm
4450
cluster: {
4551
local_slurm: local_slurm_queues.yaml,
4652
remote_slurm: remote_queues.yaml
4753
}
4854
```
49-
These `queue.yaml` files can again include all the functionality defined previously, including the configuration for remote connection using SSH.
55+
These `queue.yaml` files can again include all the functionality defined previously, including the configuration for
56+
remote connection using SSH.
5057

5158
Furthermore, the `QueueAdapter` class was extended with the following two functions:
5259
```
@@ -56,4 +63,5 @@ To list the available clusters in the configuration and:
5663
```
5764
qa.switch_cluster(cluster_name)
5865
```
59-
To switch from one cluster to another, with the `cluster_name` providing the name of the cluster like `local_slurm` and `remote_slurm` in the configuration above.
66+
To switch from one cluster to another, with the `cluster_name` providing the name of the cluster like `local_slurm` and
67+
`remote_slurm` in the configuration above.

docs/command.md

+23-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# Command Line Interface
2-
The command line interface implements a subset of the functionality of the python interface. While it can be used locally to check the status of your calculation, the primary use case is accessing the `pysqa` installation on a remote HPC cluster from your local `pysqa` installation. Still here the local execution of the commands is discussed.
2+
The command line interface implements a subset of the functionality of the python interface. While it can be used
3+
locally to check the status of your calculation, the primary use case is accessing the `pysqa` installation on a remote
4+
HPC cluster from your local `pysqa` installation. Still here the local execution of the commands is discussed.
35

4-
The available options are the submission of new jobs to the queuing system using the submit option `--submit`, enabling reservation for a job already submitted using the `--reservation` option, listing jobs on the queuing using the status option `--status`, deleting a job from the queuing system using the delete option `--delete`, listing files in the working directory using the list option `--list` and the help option `--help` to print a summary of the available options.
6+
The available options are the submission of new jobs to the queuing system using the submit option `--submit`, enabling
7+
reservation for a job already submitted using the `--reservation` option, listing jobs on the queuing using the status
8+
option `--status`, deleting a job from the queuing system using the delete option `--delete`, listing files in the
9+
working directory using the list option `--list` and the help option `--help` to print a summary of the available
10+
options.
511

612
## Submit job
7-
Submission of jobs to the queuing system with the submit option `--submit` is similar to the submit job function `QueueAdapter().submit_job()`. Example call to submit the `hostname` command to the default queue:
13+
Submission of jobs to the queuing system with the submit option `--submit` is similar to the submit job function
14+
`QueueAdapter().submit_job()`. Example call to submit the `hostname` command to the default queue:
815
```
916
python -m pysqa --submit --command hostname
1017
```
@@ -14,16 +21,21 @@ The options used and their short forms are:
1421

1522
Additional options for the submission of the job with their short forms are:
1623
* `-f`, `--config_directory` the directory which contains the `pysqa` configuration, by default `~/.queues`.
17-
* `-q`, `--queue` the queue the job is submitted to. If this option is not defined the `primary_queue` defined in the configuration is used.
24+
* `-q`, `--queue` the queue the job is submitted to. If this option is not defined the `primary_queue` defined in the
25+
configuration is used.
1826
* `-j`, `--job_name` the name of the job submitted to the queuing system.
1927
* `-w`, `--working_directory` the working directory the job submitted to the queuing system is executed in.
20-
* `-n`, `--cores` the number of cores used for the calculation. If the cores are not defined the minimum number of cores defined for the selected queue are used.
28+
* `-n`, `--cores` the number of cores used for the calculation. If the cores are not defined the minimum number of cores
29+
defined for the selected queue are used.
2130
* `-m`, `--memory` the memory used for the calculation.
22-
* `-t`, `--run_time` the run time for the calculation. If the run time is not defined the maximum run time defined for the selected queue is used.
31+
* `-t`, `--run_time` the run time for the calculation. If the run time is not defined the maximum run time defined for
32+
the selected queue is used.
2333
* `-b`, `--dependency` other jobs the calculation depends on.
2434

2535
## Enable reservation
26-
Enable reservation for a job already submitted to the queuing system using the reservation option `--reservation` is similar to the enable reservation function `QueueAdapter().enable_reservation()`. Example call to enable the reservation for a job with the id `123`:
36+
Enable reservation for a job already submitted to the queuing system using the reservation option `--reservation` is
37+
similar to the enable reservation function `QueueAdapter().enable_reservation()`. Example call to enable the reservation
38+
for a job with the id `123`:
2739
```
2840
python -m pysqa --reservation --id 123
2941
```
@@ -35,12 +47,14 @@ Additional options for enabling the reservation with their short forms are:
3547
* `-f`, `--config_directory` the directory which contains the `pysqa` configuration, by default `~/.queues`.
3648

3749
## List jobs
38-
List jobs on the queuing system option `--status`, list calculations currently running and waiting on the queuing system for all users on the HPC cluster:
50+
List jobs on the queuing system option `--status`, list calculations currently running and waiting on the queuing system
51+
for all users on the HPC cluster:
3952
```
4053
python -m pysqa --status
4154
```
4255
The options used and their short forms are:
43-
* `-s`, `--status` the status option lists the status of all calculation currently running and waiting on the queuing system.
56+
* `-s`, `--status` the status option lists the status of all calculation currently running and waiting on the queuing
57+
system.
4458

4559
Additional options for listing jobs on the queuing system with their short forms are:
4660
* `-f`, `--config_directory` the directory which contains the `pysqa` configuration, by default `~/.queues`.

docs/debug.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
# Debugging
2-
The configuration of a queuing system adapter, in particular in a remote configuration with a local installation of `pysqa` communicating to a remote installation on your HPC can be tricky.
2+
The configuration of a queuing system adapter, in particular in a remote configuration with a local installation of
3+
`pysqa` communicating to a remote installation on your HPC can be tricky.
34

45
## Local Queuing System
56
To simplify the process `pysqa` provides a series of steps for debugging:
67

7-
* When `pysqa` submits a calculation to a queuing system it creates an `run_queue.sh` script. You can submit this script using your batch command e.g. `sbatch` for `SLURM` and take a look at the error message.
8+
* When `pysqa` submits a calculation to a queuing system it creates an `run_queue.sh` script. You can submit this script
9+
using your batch command e.g. `sbatch` for `SLURM` and take a look at the error message.
810
* The error message the queuing system returns when submitting the job is also stored in the `pysqa.err` file.
9-
* Finally, if the `run_queue.sh` script does not match the variables you provided, then you can test your template using `jinja2`: `Template(open("~/.queues/queue.sh", "r").read()).render(**kwargs)` here `"~/.queues/queue.sh"` is the path to the queuing system submit script you want to use and `**kwargs` are the arguments you provide to the `submit_job()` function.
11+
* Finally, if the `run_queue.sh` script does not match the variables you provided, then you can test your template using
12+
`jinja2`: `Template(open("~/.queues/queue.sh", "r").read()).render(**kwargs)` here `"~/.queues/queue.sh"` is the path
13+
to the queuing system submit script you want to use and `**kwargs` are the arguments you provide to the `submit_job()`
14+
function.
1015

1116
## Remote HPC
12-
The failure to submit to a remote HPC cluster can be related with to an issue with the local `pysqa` configuration or an issue with the remote `pysqa` configuration. To identify which part is causing the issue, it is recommended to first test the remote `pysqa` installation on the remote HPC cluster:
17+
The failure to submit to a remote HPC cluster can be related with to an issue with the local `pysqa` configuration or an
18+
issue with the remote `pysqa` configuration. To identify which part is causing the issue, it is recommended to first
19+
test the remote `pysqa` installation on the remote HPC cluster:
1320

1421
* Login to the remote HPC cluster and import `pysqa` on a python shell.
15-
* Validate the queue configuration by importing the queue adapter using `from pysqa import QueueAdapter` then initialize the object from the configuration dictionary `qa = QueueAdapter(directory="~/.queues")`. The current configuration can be printed using `qa.config`.
16-
* Try to submit a calculation to print the hostname from the python shell on the remote HPC cluster using the `qa.submit_job(command="hostname")`.
17-
* If this works successfully then the next step is to try the same on the command line using `python -m pysqa --submit --command hostname`.
18-
19-
This is the same command the local `pysqa` instance calls on the `pysqa` instance on the remote HPC cluster, so if the steps above were executed successfully, then the remote HPC configuration seems to be correct. The final step is validating the local configuration to see the SSH connection is successfully established and maintained.
22+
* Validate the queue configuration by importing the queue adapter using `from pysqa import QueueAdapter` then initialize
23+
the object from the configuration dictionary `qa = QueueAdapter(directory="~/.queues")`. The current configuration can
24+
be printed using `qa.config`.
25+
* Try to submit a calculation to print the hostname from the python shell on the remote HPC cluster using the
26+
`qa.submit_job(command="hostname")`.
27+
* If this works successfully then the next step is to try the same on the command line using
28+
`python -m pysqa --submit --command hostname`.
2029

30+
This is the same command the local `pysqa` instance calls on the `pysqa` instance on the remote HPC cluster, so if the
31+
steps above were executed successfully, then the remote HPC configuration seems to be correct. The final step is
32+
validating the local configuration to see the SSH connection is successfully established and maintained.

docs/installation.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Installation
2-
The `pysqa` package can be installed either via `pip` or `conda`. While most HPC systems use Linux these days, the `pysqa` package can be installed on all major operation systems. In particular for connections to remote HPC clusters it is required to install `pysqa` on both the local system as well as the remote HPC cluster. In this case it is highly recommended to use the same version of `pysqa` on both systems.
2+
The `pysqa` package can be installed either via `pip` or `conda`. While most HPC systems use Linux these days, the
3+
`pysqa` package can be installed on all major operation systems. In particular for connections to remote HPC clusters it
4+
is required to install `pysqa` on both the local system as well as the remote HPC cluster. In this case it is highly
5+
recommended to use the same version of `pysqa` on both systems.
36

47
## pypi-based installation
58
`pysqa` can be installed from the python package index (pypi) using the following command:
@@ -9,15 +12,18 @@ pip install pysqa
912
On `pypi` the `pysqa` package exists in three different versions:
1013

1114
* `pip install pysaq` - base version - with minimal requirements only depends on `jinja2`, `pandas` and `pyyaml`.
12-
* `pip install pysaq[sge]` - sun grid engine (SGE) version - in addition to the base dependencies this installs `defusedxml` which is required to parse the `xml` files from `qstat`.
13-
* `pip install pysaq[remote]` - remote version - in addition to the base dependencies this installs `paramiko` and `tqdm`, to connect to remote HPC clusters using SSH and report the progress of the data transfer visually.
15+
* `pip install pysaq[sge]` - sun grid engine (SGE) version - in addition to the base dependencies this installs
16+
`defusedxml` which is required to parse the `xml` files from `qstat`.
17+
* `pip install pysaq[remote]` - remote version - in addition to the base dependencies this installs `paramiko` and
18+
`tqdm`, to connect to remote HPC clusters using SSH and report the progress of the data transfer visually.
1419

1520
## conda-based installation
1621
The `conda` package combines all dependencies in one package:
1722
```
1823
conda install -c conda-forge pysqa
1924
```
20-
When resolving the dependencies with `conda` gets slow it is recommended to use `mamba` instead of `conda`. So you can also install `pysqa` using:
25+
When resolving the dependencies with `conda` gets slow it is recommended to use `mamba` instead of `conda`. So you can
26+
also install `pysqa` using:
2127
```
2228
mamba install -c conda-forge pysqa
2329
```

0 commit comments

Comments
 (0)