Architectures Package

Architectures Package

This package contains all Architecture importers.

ArchitectureImporter Module

This module contains the base class for all Architecture importers.

class HPCStats.Importer.Architectures.ArchitectureImporter.ArchitectureImporter(app, db, config, cluster_name)

Bases: HPCStats.Importer.Importer.Importer

This is the base class common to all HPCStats Architecture importers. It defines a common set of attributes and generic methods.

find_node(search)

Search for a Node over the list of Nodes loaded by importer in self.nodes attribute. Returns None if not found.

ArchitectureImporterArchfile Module

This module contains the ArchitectureImporterArchfile class.

class HPCStats.Importer.Architectures.ArchitectureImporterArchfile.ArchitectureImporterArchfile(app, db, config, cluster_name)

Bases: HPCStats.Importer.Architectures.ArchitectureImporter.ArchitectureImporter

This class imports architecture related data (Cluster and Nodes) from an ini flat file.

check()

Checks if archfile actually exists or raises HPCStatsSourceError if not.

config_get(section, option, isint=False)

Static method to get option/section in architecture file and raise HPCStatsSourceError when a problem occurs.

static convert_freq(freq_str)

Convert frequency string in parameter into float. Returns None if string format is not valid.

static convert_mem(mem_str)

Convert memory string in parameter into int. Returns None if string format is not valid.

load()

Load Cluster, Nodes and partitions from Architecture files. Raises HPCStatsRuntimeError or HPCStatsSourceError if error is encountered while loading data from sources. It sets attributes cluster, nodes and partitions with loaded data.

read_arch()

Check if archfile actually exists then reads it and set arch attribute. Raises HPCStatsSourceError on error.

update()

Create or update Cluster and Nodes in the database.

ArchitectureImporterFactory Module

This module contains the factory design pattern class that builds the appropriate ArchitectureImporter depending on what is specified in configuration.

class HPCStats.Importer.Architectures.ArchitectureImporterFactory.ArchitectureImporterFactory

Bases: object

This class simply delivers the factory() static method, there is not point to instanciate it with an object.

static factory(app, db, config, cluster_name)

This method returns the appropriate ArchitectureImporter object depending on what is specified in configuration. In case of configuration error, HPCStatsConfigurationException is raised.