Peano
Loading...
Searching...
No Matches
repartition_vtu Namespace Reference

Repartition a single-piece .vtu into a K-piece .pvtu for low-memory streaming. More...

Functions

 _xml_type (data_array)
 _component_names (array)
 ComponentName attributes, as VTK's writer emits them, for the named components.
 _parallel_arrays (field_data, indent=" ")
 _write_summary (pvtu_path, grid, piece_sources)
 Write the .pvtu summary that ties the piece files together.
 repartition (input_path, output_path, pieces, compress=True)
 main (argv=None)

Variables

dict _VTK_TO_XML_TYPE

Detailed Description

Repartition a single-piece .vtu into a K-piece .pvtu for low-memory streaming.

The CCZ4 sample snapshots are written as one big <Piece>, which VTK's XML reader can only load all-at-once. This one-time, offline tool splits such a file into K disjoint pieces referenced by a .pvtu summary. The apparent-horizon finder can then stream that .pvtu piece by piece, so its peak memory is bounded by one piece rather than the whole grid.

The split itself must load the whole grid once (that is the cost this tool pays so the finder never has to). It is deliberately separate from the reader: it runs occasionally, has the opposite memory profile, and is unnecessary for genuinely multi-piece / domain-decomposed output that Peano already produces.

Usage: python3 repartition_vtu.py input.vtu output.pvtu [-k 8] [–no-compress]

The K piece files are written next to output.pvtu as <output-stem>_<p>.vtu.

Function Documentation

◆ _component_names()

repartition_vtu._component_names ( array)
protected

ComponentName attributes, as VTK's writer emits them, for the named components.

Definition at line 48 of file repartition_vtu.py.

◆ _parallel_arrays()

repartition_vtu._parallel_arrays ( field_data,
indent = "      " )
protected

Definition at line 58 of file repartition_vtu.py.

◆ _write_summary()

repartition_vtu._write_summary ( pvtu_path,
grid,
piece_sources )
protected

Write the .pvtu summary that ties the piece files together.

Definition at line 76 of file repartition_vtu.py.

Referenced by repartition().

Here is the caller graph for this function:

◆ _xml_type()

repartition_vtu._xml_type ( data_array)
protected

Definition at line 44 of file repartition_vtu.py.

◆ main()

repartition_vtu.main ( argv = None)

Definition at line 164 of file repartition_vtu.py.

References main(), and repartition().

Referenced by main().

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

◆ repartition()

repartition_vtu.repartition ( input_path,
output_path,
pieces,
compress = True )

Definition at line 105 of file repartition_vtu.py.

References _write_summary().

Referenced by main().

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

Variable Documentation

◆ _VTK_TO_XML_TYPE

dict repartition_vtu._VTK_TO_XML_TYPE
protected
Initial value:
1= {
2 "double": "Float64",
3 "float": "Float32",
4 "int": "Int32",
5 "long": "Int64",
6 "long long": "Int64",
7 "idtype": "Int64",
8 "short": "Int16",
9 "unsigned char": "UInt8",
10 "unsigned short": "UInt16",
11 "unsigned int": "UInt32",
12 "unsigned long": "UInt64",
13}

Definition at line 29 of file repartition_vtu.py.