HPCStats Package

Exceptions Module

Set of Exceptions for HPCStats application.

exception HPCStats.Exceptions.HPCStatsException(msg)

Bases: exceptions.Exception

Base class for exceptions in HPCStats

exception HPCStats.Exceptions.HPCStatsRuntimeError(msg)

Bases: HPCStats.Exceptions.HPCStatsException

Class for runtime errors exceptions in HPCStats

exception HPCStats.Exceptions.HPCStatsDBIntegrityError(msg)

Bases: HPCStats.Exceptions.HPCStatsException

Class for DB intregrity errors exceptions in HPCStats

exception HPCStats.Exceptions.HPCStatsSourceError(msg)

Bases: HPCStats.Exceptions.HPCStatsException

Class for source errors exceptions in HPCStats

exception HPCStats.Exceptions.HPCStatsArgumentException(msg)

Bases: HPCStats.Exceptions.HPCStatsException

Class for argument parsing exceptions in HPCStats

exception HPCStats.Exceptions.HPCStatsConfigurationException(msg)

Bases: HPCStats.Exceptions.HPCStatsException

Class for configuration file exceptions in HPCStats

Utils Module

Collection of utility functions widely used accross HPCStats.

HPCStats.Utils.compute_bg_nodelist(nodelist)

Returns the list of nodes in a BG/Q nodelist as formatted by Slurm. Ex: bgq[001x011] -> [ bgq001, bgq010, bgq011].

HPCStats.Utils.decypher(encoded)

Decypher the string in parameter.

HPCStats.Utils.extract_tres_cpu(tres_s)

Extract cpu_count from new generic Slurm TRES text field. TRES field is a string containing a comma-separated list of <id>=<value> pairs. CPU count has ID 1 according to this enum found in src/common/slurmdb_defs.h:

typedef enum {
TRES_CPU = 1, TRES_MEM, TRES_ENERGY, TRES_NODE,

} tres_types_t;

ex: 1=288,2=1160770,3=0,4=12
-> cpu_count = 288

Returns CPU count as an integer or -1 if unable to extract it. There is a special case for pending jobs that have an empty tres. In this case, returns 0. It will be updated at the next hpcstats run once resources will be allocated to the job.

HPCStats.Utils.is_bg_nodelist(nodelist)

Returns True if the nodelist in parameter is a valid BG/Q nodelist as formatted by Slurm.

HPCStats.Utils.match_bg_nodelist(nodelist)

Returns the match object as returned by the match() method after the regext and the nodelist in parameter.

Subpackages