pymatgen.io.abinit.abitimer module

This module provides objects for extracting timing data from the ABINIT output files It also provides tools to analye and to visualize the parallel efficiency.

class AbinitTimer(sections, info, cpu_time, wall_time)[source]

Bases: object

Container class storing the timing results.

cpuwall_histogram(ax=None, **kwargs)[source]

keyword arguments controlling the display of the figure:

kwargs Meaning
title Title of the plot (Default: None).
show True to show the figure (default: True).
savefig ‘abc.png’ or ‘abc.eps’ to save the figure to a file.
size_kwargs Dictionary with options passed to fig.set_size_inches example: size_kwargs=dict(w=3, h=4)
tight_layout True if to call fig.tight_layout (default: False)
get_dataframe(sort_key='wall_time', **kwargs)[source]

Return pandas DataFrame

get_section(section_name)[source]
get_values(keys)[source]

Return a list of values associated to a particular list of keys

names_and_values(key, minval=None, minfract=None, sorted=True)[source]

Select the entries whose value[key] is >= minval or whose fraction[key] is >= minfract Return the names of the sections and the correspoding value

ncpus

Total number of CPUs employed.

order_sections(key, reverse=True)[source]

Sort sections according to the value of key.

pie(key='wall_time', minfract=0.05, title=None)[source]
scatter_hist(ax=None, **kwargs)[source]
sum_sections(keys)[source]
to_csv(fileobj=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Write data on file fileobj using CSV format.

to_table(sort_key='wall_time', stop=None)[source]

Return a table (list of lists) with timer data

totable(sort_key='wall_time', stop=None)

Return a table (list of lists) with timer data

class AbinitTimerParser[source]

Bases: collections.abc.Iterable

Responsible for parsing a list of output files, and managing the parsed database.

BEGIN_TAG = '-<BEGIN_TIMER'
END_TAG = '-<END_TIMER>'
Error

alias of AbinitTimerParserError

get_sections(section_name)[source]

Return the list of sections stored in self.timers() whose name is section_name A fake section is returned if the timer does not have sectio_name.

parse(filenames)[source]

Read and parse a filename or a list of filenames.

Files that cannot be opened are ignored. A single filename may also be given. Return list of successfully read files.

pefficiency()[source]

Analyze the parallel efficiency.

plot_all(**kwargs)[source]
plot_efficiency(key='wall_time', what='gb', nmax=5, ax=None, **kwargs)[source]

keyword arguments controlling the display of the figure:

kwargs Meaning
title Title of the plot (Default: None).
show True to show the figure (default: True).
savefig ‘abc.png’ or ‘abc.eps’ to save the figure to a file.
size_kwargs Dictionary with options passed to fig.set_size_inches example: size_kwargs=dict(w=3, h=4)
tight_layout True if to call fig.tight_layout (default: False)
plot_pie(key='wall_time', minfract=0.05, ax=None, **kwargs)[source]

Pie charts of the different timers.

keyword arguments controlling the display of the figure:

kwargs Meaning
title Title of the plot (Default: None).
show True to show the figure (default: True).
savefig ‘abc.png’ or ‘abc.eps’ to save the figure to a file.
size_kwargs Dictionary with options passed to fig.set_size_inches example: size_kwargs=dict(w=3, h=4)
tight_layout True if to call fig.tight_layout (default: False)
plot_stacked_hist(key='wall_time', nmax=5, ax=None, **kwargs)[source]

Stacked histogram of the different timers.

keyword arguments controlling the display of the figure:

kwargs Meaning
title Title of the plot (Default: None).
show True to show the figure (default: True).
savefig ‘abc.png’ or ‘abc.eps’ to save the figure to a file.
size_kwargs Dictionary with options passed to fig.set_size_inches example: size_kwargs=dict(w=3, h=4)
tight_layout True if to call fig.tight_layout (default: False)
section_names(ordkey='wall_time')[source]

Return the names of sections ordered by ordkey.

summarize(**kwargs)[source]

Return pandas DataFrame

timers(filename=None, mpi_rank='0')[source]

Return the list of timers associated to the given filename and MPI rank mpi_rank.

exception AbinitTimerParserError[source]

Bases: Exception

Errors raised by AbinitTimerParser

class AbinitTimerSection(name, cpu_time, cpu_fract, wall_time, wall_fract, ncalls, gflops)[source]

Bases: object

Record with the timing results associated to a section of code.

FIELDS = ('name', 'wall_time', 'wall_fract', 'cpu_time', 'cpu_fract', 'ncalls', 'gflops')
NUMERIC_FIELDS = ['wall_time', 'wall_fract', 'cpu_time', 'cpu_fract', 'ncalls', 'gflops']
STR_FIELDS = ['name']
classmethod fake()[source]
to_csvline(with_header=False)[source]

Return a string with data in CSV format

to_dict()[source]
to_tuple()[source]
class ParallelEfficiency(filenames, ref_idx, *args, **kwargs)[source]

Bases: dict

bad_sections(key='wall_time', criterion='mean', nmax=5)[source]
good_sections(key='wall_time', criterion='mean', nmax=5)[source]
totable(stop=None, reverse=True)[source]
alternate(*iterables)[source]

[a[0], b[0], ... , a[1], b[1], ..., a[n], b[n] ...] >>> alternate([1,4], [2,5], [3,6]) [1, 2, 3, 4, 5, 6]