Peano
Loading...
Searching...
No Matches
OutputFile.OutputFile Class Reference

Represents single output file dumped by Peano. More...

Inheritance diagram for OutputFile.OutputFile:
Collaboration diagram for OutputFile.OutputFile:

Public Member Functions

 __init__ (self, name, verbose=False)
 parse (self)
 Parse Peano output file.
 ranks (self)
 threads_per_rank (self)
 runtime (self)
 Read out the total runtime.
 trees_per_snapshot (self, rank)
 Return a sequence of integers that holds the number of trees per snapshot.
 local_cells_per_snapshot (self, rank)
 Return local cells per snaphot.
 virtual_cells_per_snapshot (self, rank)
 Return local cells per snaphot.
 total_local_cells_per_snapshot (self, rank)
 Return the total number of cells per snapshot for this rank.
 min_local_cells_per_snapshot (self, rank)
 Return the total number of cells per snapshot for this rank.
 max_local_cells_per_snapshot (self, rank)
 Return the total number of cells per snapshot for this rank.
 min_virtual_cells_per_snapshot (self, rank)
 Return the total number of cells per snapshot for this rank.
 max_virtual_cells_per_snapshot (self, rank)
 Return the total number of cells per snapshot for this rank.
 is_valid (self)

Protected Attributes

 _file_name = name
bool _has_parsed = False
 _verbose = verbose
dict _snapshot_lines = {}
int _ranks = 1
 _threads = int( line.split( "threads" )[0].split( "(" )[-1])
 _runtime = float( line.split( "time stepping:" )[1].split( "s")[0] )

Detailed Description

Represents single output file dumped by Peano.

This class extracts all the load balancing-related information from an output file, i.e. is basically an abstraction of a file parser. It also holds some very basic runtime data.

Parameters
nameFile name

Definition at line 4 of file OutputFile.py.

Constructor & Destructor Documentation

◆ __init__()

OutputFile.OutputFile.__init__ ( self,
name,
verbose = False )

Definition at line 15 of file OutputFile.py.

Member Function Documentation

◆ is_valid()

OutputFile.OutputFile.is_valid ( self)

Definition at line 292 of file OutputFile.py.

◆ local_cells_per_snapshot()

OutputFile.OutputFile.local_cells_per_snapshot ( self,
rank )

Return local cells per snaphot.

This is a sequence of sequences. For each snapshot for this rank, we store one sequence with all the local cells in this snapshot. The standard plot_load_distribution.py script feeds this data into a scatter plot. For many cases, we might however be interested in the maximum value:

raw_data = ouput_file.local_cells_per_snapshot(rank)
max_data = [max(x) for x in raw_data ]

Definition at line 131 of file OutputFile.py.

References _ranks, _snapshot_lines, convert::input::MetaFileReader.parse(), convert::input::PatchFileReader.parse(), convert::input::PeanoTextPatchFileReader.parse(), exahype2.api.dslhype.Parser.Parser.parse(), exahype2.api.dslhype2.Parser.Parser.parse(), parse(), peano4.api.toolbox.particles.postprocessing.Dataset.Dataset.parse(), and toolbox::curvi::YAMLInput.parse().

Referenced by max_local_cells_per_snapshot(), min_local_cells_per_snapshot(), and total_local_cells_per_snapshot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max_local_cells_per_snapshot()

OutputFile.OutputFile.max_local_cells_per_snapshot ( self,
rank )

Return the total number of cells per snapshot for this rank.

The total number of cells is an interesting quantity, as it allows us to compare the load of different ranks.

Definition at line 232 of file OutputFile.py.

References local_cells_per_snapshot().

Here is the call graph for this function:

◆ max_virtual_cells_per_snapshot()

OutputFile.OutputFile.max_virtual_cells_per_snapshot ( self,
rank )

Return the total number of cells per snapshot for this rank.

The total number of cells is an interesting quantity, as it allows us to compare the load of different ranks.

Definition at line 272 of file OutputFile.py.

References virtual_cells_per_snapshot().

Here is the call graph for this function:

◆ min_local_cells_per_snapshot()

OutputFile.OutputFile.min_local_cells_per_snapshot ( self,
rank )

Return the total number of cells per snapshot for this rank.

The total number of cells is an interesting quantity, as it allows us to compare the load of different ranks.

Definition at line 212 of file OutputFile.py.

References local_cells_per_snapshot().

Here is the call graph for this function:

◆ min_virtual_cells_per_snapshot()

OutputFile.OutputFile.min_virtual_cells_per_snapshot ( self,
rank )

Return the total number of cells per snapshot for this rank.

The total number of cells is an interesting quantity, as it allows us to compare the load of different ranks.

Definition at line 252 of file OutputFile.py.

References virtual_cells_per_snapshot().

Here is the call graph for this function:

◆ parse()

OutputFile.OutputFile.parse ( self)

◆ ranks()

◆ runtime()

◆ threads_per_rank()

◆ total_local_cells_per_snapshot()

OutputFile.OutputFile.total_local_cells_per_snapshot ( self,
rank )

Return the total number of cells per snapshot for this rank.

The total number of cells is an interesting quantity, as it allows us to compare the load of different ranks.

Definition at line 192 of file OutputFile.py.

References local_cells_per_snapshot().

Here is the call graph for this function:

◆ trees_per_snapshot()

OutputFile.OutputFile.trees_per_snapshot ( self,
rank )

◆ virtual_cells_per_snapshot()

OutputFile.OutputFile.virtual_cells_per_snapshot ( self,
rank )

Return local cells per snaphot.

This is a sequence of sequences. For each snapshot for this rank, we store one sequence with all the local cells in this snapshot.

Definition at line 165 of file OutputFile.py.

References _ranks, _snapshot_lines, convert::input::MetaFileReader.parse(), convert::input::PatchFileReader.parse(), convert::input::PeanoTextPatchFileReader.parse(), exahype2.api.dslhype.Parser.Parser.parse(), exahype2.api.dslhype2.Parser.Parser.parse(), parse(), peano4.api.toolbox.particles.postprocessing.Dataset.Dataset.parse(), and toolbox::curvi::YAMLInput.parse().

Referenced by max_virtual_cells_per_snapshot(), and min_virtual_cells_per_snapshot().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ _file_name

OutputFile.OutputFile._file_name = name
protected

Definition at line 20 of file OutputFile.py.

Referenced by parse(), and postprocessing.PerformanceData.PerformanceData.parse().

◆ _has_parsed

bool OutputFile.OutputFile._has_parsed = False
protected

Definition at line 21 of file OutputFile.py.

Referenced by parse().

◆ _ranks

OutputFile.OutputFile._ranks = 1
protected

◆ _runtime

OutputFile.OutputFile._runtime = float( line.split( "time stepping:" )[1].split( "s")[0] )
protected

Definition at line 66 of file OutputFile.py.

Referenced by runtime().

◆ _snapshot_lines

dict OutputFile.OutputFile._snapshot_lines = {}
protected

◆ _threads

OutputFile.OutputFile._threads = int( line.split( "threads" )[0].split( "(" )[-1])
protected

◆ _verbose

OutputFile.OutputFile._verbose = verbose
protected

Definition at line 22 of file OutputFile.py.

Referenced by parse().


The documentation for this class was generated from the following file: