Peano
Loading...
Searching...
No Matches
tarch.plotter.api.merge Namespace Reference

Merge the partial patch files of a Peano simulation. More...

Functions

 merge_partial_files (partial_files, merged_file_path)
 Merge the patches of several patch files into one file.
 
 read_meta_file (path_to_metafile, start, end)
 
 count_total_snapshot_number (path_to_metafile)
 

Variables

 parser
 
 dest
 
 help
 
 required
 
 type
 
 default
 
 args = parser.parse_args()
 
 total_snapshot_number = count_total_snapshot_number(args.metafile)
 
 start_snapshot = args.start
 
tuple end_snapshot
 

Detailed Description

Merge the partial patch files of a Peano simulation.

A parallel run writes one patch file per spacetree (and rank) and snapshot. The script merges the files of each snapshot into one file, and writes a new meta file merged_meta_file.peano-patch-file next to the original one which links to the merged files. It handles files with ASCII and with binary quantities. Call it with

python3 -m tarch.plotter.api.merge --meta-file solution-Euler.peano-patch-file

Merging data files

Function Documentation

◆ count_total_snapshot_number()

tarch.plotter.api.merge.count_total_snapshot_number (   path_to_metafile)

Definition at line 135 of file merge.py.

◆ merge_partial_files()

tarch.plotter.api.merge.merge_partial_files (   partial_files,
  merged_file_path 
)

Merge the patches of several patch files into one file.

The files are processed as bytes. A file with format Binary holds raw doubles between its text lines, and we copy those verbatim. The header of the merged file is the header of the first partial file, i.e. all partial files have to have the same format. Everything from the first "begin patch" in a file on is a patch, and everything before it is the header: A header holds text only, so the first occurrence is the right one, even in a binary file.

Parameters
partial_files[str] Files to merge. Their patches end up in the merged file in this order.
merged_file_pathstr File to write.

Definition at line 22 of file merge.py.

Referenced by tarch.plotter.api.merge.read_meta_file().

Here is the caller graph for this function:

◆ read_meta_file()

tarch.plotter.api.merge.read_meta_file (   path_to_metafile,
  start,
  end 
)

Definition at line 64 of file merge.py.

References tarch.plotter.api.merge.merge_partial_files().

Here is the call graph for this function:

Variable Documentation

◆ args

tarch.plotter.api.merge.args = parser.parse_args()

Definition at line 172 of file merge.py.

◆ default

tarch.plotter.api.merge.default

Definition at line 161 of file merge.py.

◆ dest

tarch.plotter.api.merge.dest

Definition at line 151 of file merge.py.

◆ end_snapshot

int tarch.plotter.api.merge.end_snapshot
Initial value:
1= (
2 total_snapshot_number - 1
3 )

Definition at line 184 of file merge.py.

◆ help

tarch.plotter.api.merge.help

Definition at line 152 of file merge.py.

◆ parser

tarch.plotter.api.merge.parser
Initial value:
1= argparse.ArgumentParser(
2 description="Peano 4 - Merge partial patch files "
3 "that are linked to by a meta file"
4 )

Definition at line 145 of file merge.py.

◆ required

tarch.plotter.api.merge.required

Definition at line 153 of file merge.py.

◆ start_snapshot

tarch.plotter.api.merge.start_snapshot = args.start

Definition at line 183 of file merge.py.

◆ total_snapshot_number

tarch.plotter.api.merge.total_snapshot_number = count_total_snapshot_number(args.metafile)

Definition at line 179 of file merge.py.

◆ type

tarch.plotter.api.merge.type

Definition at line 159 of file merge.py.