Simple script which can be used to monitor and log CPU and RAM usage of submitted cluster jobs
Project description
ClusterMonitor
A very simple python script which monitors and records the CPU and RAM consumption of submitted cluster jobs.
Usage
To start recording use the cpu_ram_log.py
script. This script requires 3 arguments:
-u
which corresponds to your username.-o
which specifies the output file (in tsv format)--interval
which specifies the time (in seconds) over which the CPU and RAM usage gets averaged
Example:
python 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 20 some_bam.bam &
MainScript=$!
python cpu_ram_log.py -u nickhir -o cpu_ram.log --interval 5 &
wait $MainScript
pkill -P $$
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:
-i
which specifies the path to the log file which was created withcpu_ram_log.py
-o
which 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:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ClusterMonitor-0.0.6.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for ClusterMonitor-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 068d118fc003f776e8af6da5d0d7d00b7ea7ec0e47f04cc467f16e93ed77d3b9 |
|
MD5 | fc085faa660f97003ab1d4fe9424eac1 |
|
BLAKE2b-256 | a84812ef07e911cf65c7f71eecf4a594da2a8f8f6d6a9ed76339f16f0d788c2b |