Skip to main content

A small utility for running multiple jobs in parallel or series.

Project description

NAME

qrun - Quickly queue and run jobs from the command line.

VERSION: 0.4.0

Note: Before version 0.4.0, qrun was a Perl script. For version 0.4.0, qrun was completely rewritten in Python.

DESCRIPTION

qrun is a Python script that will run a set of commands. It is primarily useful for running commands that are expected to run for a long time, such as physics simulations. qrun uses "handlers" to actually run the commands, and tries to automatically select the best handler to use to complete the runs as quickly as possible. For example, if you are working on a cluster and the qsub command exists, qrun will create submission scripts and submit them to the scheduler. If the qsub command does not exist, then other handlers are checked. For example, if the parallel (gnu parallel) or xjobs commands are found, they can be used to run all commands in parallel.

If all other handlers fail, qrun will fall back to just running each command in serial, one after the other. This turns out to still be useful, because if you have a set of simulations that you need to perform, you can use qrun to automatically run each simulation after one has completed.

All handlers will first create a script wrapper for each command to run and then run this script. This is done so that extra information can be embedded in the command output, such as a time stamp for timing data.

Current Handlers

slurm

This handler uses the sbatch command. sbatch is used to submit jobs to an HPC cluster using the Slurm workload manager, which is become popular in recent years. The sbatch handler will automatically create a submission script for each job and subit the scripts to the scheduler. This is handy if you want to just quickly submit a basic job that does not require a complex submission script.

gnuparallel

This handler uses the parallel command, from the gnuparallel project. parallel is a perl script that runs multiple jobs in parallel and even supports running jobs on remote computers (not supported by run). It attempts to work as a parallel version of xargs.

xjobs

This handler uses the xjobs command. xjobs is a small C program written by Thomas Maier-Komer that that a command multiple times with different arguments in parallel. It strives to be a parallel version of xargs.

serial

This handler just runs each job directly, one after the other.

Possible Future Handlers

  • pexec another tool for running jobs in parallel on a workstation.
  • pbs a common (maybe the most common) scheduler interface used on clusters.

Note that qrun does not do load balancing. Each handler is given the list of commands to run, and they are responsible for managing the system workload.

EXAMPLES

run 3 scripts

  > qrun script1.sh : script2.sh : script3.sh

run 3 BTEC runs

  > qrun -C BTECthermal config1.btec : BTECthermal config2.btec : BTECthermal config3.btec

run BTEC for all config files in the current directory

  > qrun -C BTECthermal -d' ' config*.btec

run 3 scripts using the gnuparallel handler

  > qrun -H gnuparallel script1.sh : script2.sh : script3.sh

get a list of all handlers

  > qrun -l

INSTALLATION

qrun is available on PyPi

$ pip install qrun

LICENSE

The MIT License (MIT)

Copyright (c) 2015-present CD Clark III

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qrun-0.6.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

qrun-0.6.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file qrun-0.6.0.tar.gz.

File metadata

  • Download URL: qrun-0.6.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for qrun-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6f7d15648a85883ae1450c754c89202f27f76c8485b6280883b1e38081e9c100
MD5 fb73275c3c98a3918c9d8c6c39df154f
BLAKE2b-256 753bf698a2d024aee1e38612f901819b14b6b5f09eaa749ca6ca29d90bf63126

See more details on using hashes here.

File details

Details for the file qrun-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: qrun-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for qrun-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4173008b70480340fac5b61597c85fdf7b9eb1eb5597b706c1b73f7dbb67c28
MD5 166db86188bff349d3b57954e6c13db9
BLAKE2b-256 379c85b546f8ea15e550125b8354ef3e37cb0a8d7af9c7b309467a710125303f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page