pymatgen.io.abinit.qutils module

Collection of low-level tools that faciliate the interface with resource managers.

The preferred way of importing this module is:

import qutils as qu
any2mb(s)[source]

Convert string or number to memory in megabytes.

slurm_parse_timestr(s)[source]

A slurm time parser. Accepts a string in one the following forms:

# “days-hours”, # “days-hours:minutes”, # “days-hours:minutes:seconds”. # “minutes”, # “minutes:seconds”, # “hours:minutes:seconds”,
Returns:Time in seconds.
Raises:ValueError if string is not valid.
time2loadlever(timeval, unit='s')[source]

Convert a number representing a time value in the given unit (Default: seconds) to a string following the LoadLever convention. format hh:mm:ss (hours:minutes:seconds)

>>> assert time2loadlever(2, unit="d") == '48:00:00'
time2pbspro(timeval, unit='s')[source]

Convert a number representing a time value in the given unit (Default: seconds) to a string following the PbsPro convention: “hours:minutes:seconds”.

>>> assert time2pbspro(2, unit="d") == '48:0:0'
time2slurm(timeval, unit='s')[source]

Convert a number representing a time value in the given unit (Default: seconds) to a string following the slurm convention: “days-hours:minutes:seconds”.

>>> assert time2slurm(61) == '0-0:1:1' and time2slurm(60*60+1) == '0-1:0:1'
>>> assert time2slurm(0.5, unit="h") == '0-0:30:0'
timelimit_parser(s)[source]

Convert a float or a string into time in seconds.