ClusterMonitor
A very simple python script which monitors and records the CPU and RAM consumption of submitted cluster jobs.
Installation
Simplest option is to install via PyPi:
pip install ClusterMonitor
Alternatively you can also clone this repository and use the scripts inside the ClusterMonitor directory.
Usage
To start recording use the cpu_ram_log.py script. It requires 3 arguments:
-uwhich corresponds to your username.-owhich specifies the output file (in tsv format)--intervalwhich specifies the time (in seconds) over which the CPU and RAM usage gets averaged
Example:
python ClusterMonitor/cpu_ram_log.py -u nickhir -o cpu_ram.log --interval 5
The script can simply be included in your cluster job submittion like this:
#!/bin/bash
#SBATCH --job-name=Example_run
sambamba sort -t 3 some_bam.bam &
MainScript=$!
python cpu_ram_log.py -u nickhir -o cpu_ram.log --interval 5 &
wait $MainScript
pkill -P $$
If you used pip to install the package, cpu_ram_log and visualize_log will be added to your PATH variable, thus you can simple use:
cpu_ram_log -u nickhir --interval 5 -o cpu_ram.log
Afterwards the resulting log file can be plotted (for that matplotlib is needed).
For that use the visualize_log.py script which needs 2 arguments:
-iwhich specifies the path to the log file which was created withcpu_ram_log.py-owhich specifies the path to the resulting PDF which contains a plot for the CPU and RAM usage.
Example:
python visualize_log.py -i cpu_ram.log -o cpu_ram_visualization.pdf
The resulting plots will look somewhat like this:
Metadata
Release files for ClusterMonitor 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ClusterMonitor-0.0.7.tar.gz | 4.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ClusterMonitor-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / ClusterMonitor-0.0.7.tar.gz
| Download URL | ClusterMonitor-0.0.7.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
063928b3ff86662122f139d561a2955cc003716944f9711d984c1e64803dbf04
|
|
BLAKE2b-256 checksum How to use checksums |
6b864ea491ed2805fcfdf5eb918fc70116720f30473c29c27c73f79b174e41a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / ClusterMonitor-0.0.7-py3-none-any.whl
| Download URL | ClusterMonitor-0.0.7-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
850acc33a5427f88258c00179dd73dabc0f468af238c606977cd3b8d2dc64709
|
|
BLAKE2b-256 checksum How to use checksums |
86f7535b1289a384d3ff092ea555ec27362ffaae35e68924b8be6b551f1ee687
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for ClusterMonitor 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.