drmr package¶
Subpackages¶
Submodules¶
drmr.config module¶
-
drmr.config.
get_resource_manager
(name)[source]¶ Given the name of a resource manager, return an instance of it.
-
drmr.config.
load_configuration
(config=None, file=None)[source]¶ Loads a drmr config in JSON format.
If a configuration dictionary is supplied, only the parameters for which it lacks values will be updated. So you can for example parse command line arguments, put them in a dictionary, and backfill it from the user config file.
If file is not specified, it defaults to ~/.drmrc.
drmr.exceptions module¶
-
exception
drmr.exceptions.
ControlError
(returncode, cmd, output=None, job_ids=None)[source]¶ Bases:
subprocess.CalledProcessError
Base exception for job control commands: submit, delete, alter.
-
action
= ''¶
-
-
exception
drmr.exceptions.
DeletionError
(returncode, cmd, output=None, job_ids=None)[source]¶ Bases:
drmr.exceptions.ControlError
-
action
= 'delete'¶
-
-
exception
drmr.exceptions.
SubmissionError
(returncode, cmd, output=None, job_ids=None)[source]¶ Bases:
drmr.exceptions.ControlError
-
action
= 'submit'¶
-
drmr.script module¶
-
drmr.script.
is_boring
(line)[source]¶ Return True if the line is empty or a comment that does not contain a directive.
-
drmr.script.
is_comment
(line)[source]¶ Return True if the line starts with a shell comment marker (#).
-
drmr.script.
is_continued
(line)[source]¶ Return true if the line ends with a backslash (and possibly whitespace).
drmr.util module¶
-
drmr.util.
makedirs
(*paths)[source]¶ Creates each path given.
An exception will be raised if any path exists and is not a directory.
-
drmr.util.
normalize_memory
(memory)[source]¶ Normalizes a string describing an amount of memory.
Returns the equivalent in megabytes, or the original value if it can’t be parsed.
-
drmr.util.
normalize_time
(time)[source]¶ Normalizes a string describing a duration.
Accepts seconds up through days, e.g.:
“18d 1.99h 2min 3.5seconds”
If the input can be parsed, returns a string containing whole integers in the format hours:minutes:seconds.
Raises SyntaxError if the input cannot be parsed.