Skip to main content

A simple JIT job management framework in Python.

Project description

Custodian is a simple, robust and flexible just-in-time (JIT) job management framework written in Python. Using custodian, you can create wrappers that perform error checking, job management and error recovery. It has a simple plugin framework that allows you to develop specific job management workflows for different applications.

The specific use case for custodian is for long running jobs, with potentially random errors. For example, there may be a script that takes several days to run on a server, with a 1% chance of some IO error causing the job to fail. Using custodian, one can develop a mechanism to gracefully recover from the error, and potentially restart the job if necessary.

Custodian is now in an very early alpha, and there may be many frequent API changes. Please use with care.

Getting custodian

Stable version

The version at the Python Package Index (PyPI) is always the latest stable release that will be hopefully, be relatively bug-free. The easiest way to install custodian on any system is to use easy_install or pip, as follows:

easy_install custodian

or:

pip install custodian

Some plugins (e.g., vasp management) require additional setup (please see pymatgen’s documentation).

Developmental version

The bleeding edge developmental version is at the custodian’s Github repo. The developmental version is likely to be more buggy, but may contain new features. The Github version include test files as well for complete unit testing. After cloning the source, you can type:

python setup.py install

or to install the package in developmental mode:

python setup.py develop

Requirements

Custodian requires Python 2.7+. There are no other required dependencies.

Optional dependencies

Optional libraries that are required if you need certain features:

  1. pymatgen 2.5+: To use the plugin for VASP.

  2. nose - For complete unittesting.

Basic usage

The main class in the workflow is known as Custodian, which manages a series of jobs with a list of error handlers. To use custodian, you need to implement concrete implementation of the abstract base classes custodian.custodian.Job and custodian.custodian.ErrorHandler. An very simple example implementation is given in the examples.py script in the scripts directory.

Other specific examples for electronic structure calculations based on the Vienna Ab Initio Simulation Package (VASP) are implemented in the custodian.vasp package. A simple example of a script using Custodian to run a two-relaxation VASP job is as follows:

from custodian.custodian import Custodian
from custodian.vasp.handlers import VaspErrorHandler, UnconvergedErrorHandler
from custodian.vasp.jobs import VaspJob

handlers = [VaspErrorHandler(), UnconvergedErrorHandler(),
            PoscarErrorHandler()]
jobs = VaspJob.double_relaxation_run(args.command.split())
c = Custodian(handlers, jobs, max_errors=10)
c.run()

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

custodian-0.2.3a.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

custodian-0.2.3a-py2.7.egg (40.4 kB view details)

Uploaded Source

File details

Details for the file custodian-0.2.3a.tar.gz.

File metadata

  • Download URL: custodian-0.2.3a.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for custodian-0.2.3a.tar.gz
Algorithm Hash digest
SHA256 9d8b726aa9dd375c8ae818381d4761ee413c82c4976caab9fcb11b99d3caea3b
MD5 51825bcf4469979060e2c7e00a74a711
BLAKE2b-256 dfa7e2d45d3f2e7fb430ab66cc1ddfa21ff2e54b247258df4a7b01332b97af7e

See more details on using hashes here.

File details

Details for the file custodian-0.2.3a-py2.7.egg.

File metadata

File hashes

Hashes for custodian-0.2.3a-py2.7.egg
Algorithm Hash digest
SHA256 f28f889e125ac17ec87b062cf68d3accbec428f5d195b50075c6cc220d7b4680
MD5 d630d5716de051b54a9caf78e0b54cec
BLAKE2b-256 f3d0514c42e10c38d2295dbdc1e1d2e1954f0d42f4e127a6f1d5f84941e910de

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