Usage
You need to submit more slurm scripts than fit on the queue at once.
tree .
.
├── slurmscript0.slurm.sh
├── slurmscript1.slurm.sh
├── slurmscript2.slurm.sh
├── slurmscript3.slurm.sh
├── slurmscript4.slurm.sh
├── slurmscript5.slurm.sh
├── slurmscript6.slurm.sh
├── slurmscript7.slurm.sh
├── slurmscript8.slurm.sh
...
The qspool script will feed your job scripts onto the queue as space becomes available.
python3 -m qspool *.slurm.sh
You can also provide job names via stdin, which is useful for very large job batches.
find . -maxdepth 1 -name '*.slurm.sh' | python3 -m qspool
The qspool script creates a slurm job that submits your job scripts.
When queue capacity fills, this qspool job will schedule a follow-up job to submit any remaining job scripts.
This process continues until all job scripts have been submitted.
usage: qspool.py [-h] [--payload-job-script-paths-infile PAYLOAD_JOB_SCRIPT_PATHS_INFILE] [--job-log-path JOB_LOG_PATH] [--job-script-cc-path JOB_SCRIPT_CC_PATH]
[--queue-capacity QUEUE_CAPACITY] [--qspooler-job-title QSPOOLER_JOB_TITLE]
[payload_job_script_paths ...]
positional arguments:
payload_job_script_paths
What scripts to spool onto slurm queue? (default: None)
options:
-h, --help show this help message and exit
--payload-job-script-paths-infile PAYLOAD_JOB_SCRIPT_PATHS_INFILE
Where to read script paths to spool onto slurm queue? (default: <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>)
--job-log-path JOB_LOG_PATH
Where should logs for qspool jobs be written? (default: ~/joblog/)
--job-script-cc-path JOB_SCRIPT_CC_PATH
Where should copies of submitted job scripts be kept? (default: ~/jobscript/)
--queue-capacity QUEUE_CAPACITY
How many jobs can be running or waiting at once? (default: 1000)
--qspooler-job-title QSPOOLER_JOB_TITLE
What title should be included in qspooler job names? (default: none)
Installation
no installation:
python3 "$(tmpfile="$(mktemp)"; curl -s https://raw.githubusercontent.com/mmore500/qspool/v0.5.0/qspool.py > "${tmpfile}"; echo "${tmpfile}")" [ARGS]
pip installation:
python3 -m pip install qspool
python3 -m qspool [ARGS]
qspool has zero dependencies, so no setup or maintenance is required to use it.
Compatible all the way back to Python 3.6, so it will work on your cluster's ancient Python install.
How it Works
qspool
* read contents of target slurm scripts
* instantiate qspooler job script w/ target slurm scripts embedded
* submit qspooler job script to slurm queue
⬇️ ⬇️ ⬇️
qspooler job 1
* submit embedded target slurm scripts one by one until queue is almost full
* instantiate qspooler job script w/ remaining target slurm scripts embedded
* submit qspooler job script to slurm queue
⬇️ ⬇️ ⬇️
qspooler job 2
* submit embedded target slurm scripts one by one until queue is almost full
* instantiate qspooler job script w/ remaining target slurm scripts embedded
* submit qspooler job script to slurm queue
...
qspooler job n
* submit embedded target slurm scripts one by one
* no embedded target slurm scripts remain
* exit
Related Software
roll_q uses a similar approach to solve this problem.
roll_q differs in implementation strategy.
roll_q tracks submission progress via an index variable in a file associated with a job batch.
qspool embeds jobs in the submission worker script itself.
Metadata
Release files for qspool 0.5.0
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 | Actions |
|---|---|---|---|---|
| qspool-0.5.0.tar.gz | 6.9 kB | Without provenance | Details for qspool-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qspool-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for qspool-0.5.0-py3-none-any.whl |
Total release size: 14.0 kB
Release files / qspool-0.5.0.tar.gz
| Download URL | qspool-0.5.0.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb676941d0afd5d9e1a66076cdbef55e216c10613b8a1ba716535549bcbd16b9
|
|
BLAKE2b-256 checksum How to use checksums |
4e0d7f7697019093cc68c78c114590b1b2e97a48351e108e78b5f4c96fd97287
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / qspool-0.5.0-py3-none-any.whl
| Download URL | qspool-0.5.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a62fdb1da09ac9a3a018e54cd577d79226eeb82d8f778a980dc3ca91bb28f24
|
|
BLAKE2b-256 checksum How to use checksums |
cca856b32656867718f46c2d573798c0ca1863f242327a17efc01443e2bcf641
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for qspool 0.5.0
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.