upxo.meshing.gbconformant.pipeline.estimate module

A forecast of a run’s size, time and memory before it starts.

The forecast is a power law in the number of voxels, scaled by the surface and volume size factors, with constants fitted to runs of the FM-steel development data (a crop of 8,800 voxels under eight settings, and a crop of 27,000 voxels). When the data directory holds earlier runs of this computer, the forecast is scaled by how far those runs differ from it, which also absorbs the speed of the computer. The result is a range: the mesh depends on the grain shapes, which no formula sees, and the time of a run changed by up to 1.9 times between runs of one computer.

class upxo.meshing.gbconformant.pipeline.estimate.Observation(name: str, voxels: int, tets: int | None = None, nodes: int | None = None, seconds: float | None = None, peak_memory_mb: float | None = None, tet_size_factor: float | None = None, gmsh_size_factor: float | None = None, complete: bool = False)[source]

Bases: object

What an earlier run turned out to be.

name: str
voxels: int
tets: int | None = None
nodes: int | None = None
seconds: float | None = None
peak_memory_mb: float | None = None
tet_size_factor: float | None = None
gmsh_size_factor: float | None = None
complete: bool = False
class upxo.meshing.gbconformant.pipeline.estimate.Forecast(voxels: int, tets: int, tets_range: tuple, nodes: int, seconds: float, seconds_range: tuple, memory_mb: float, memory_range: tuple, basis: str, runs_used: int = 0, notes: list = <factory>, output: dict | None = None, output_range: tuple | None = None)[source]

Bases: object

The expected size of a run; every figure comes with the range it is likely to fall in.

voxels: int
tets: int
tets_range: tuple
nodes: int
seconds: float
seconds_range: tuple
memory_mb: float
memory_range: tuple
basis: str
runs_used: int = 0
notes: list
output: dict | None = None
output_range: tuple | None = None
as_dict() → dict[source]
text() → str[source]

The forecast as one short paragraph for a readout or the command line.

upxo.meshing.gbconformant.pipeline.estimate.duration_text(seconds: float) → str[source]
upxo.meshing.gbconformant.pipeline.estimate.memory_text(megabytes: float) → str[source]
upxo.meshing.gbconformant.pipeline.estimate.model_tets(voxels: float, tet_size_factor: float | None = None, gmsh_size_factor: float | None = None) → float[source]

Tetrahedra the fitted law gives for voxels at the given size factors (default settings when omitted).

The surface size factor sets the count; the volume size factor adds tetrahedra only when its size is smaller than the surface size (the interior is then meshed finer than the boundary).

upxo.meshing.gbconformant.pipeline.estimate.model_seconds(voxels: float) → float[source]

Time of a run: it followed the number of voxels, not the number of tetrahedra, on the crops measured.

upxo.meshing.gbconformant.pipeline.estimate.model_memory_mb(tets: float) → float[source]

Peak memory of the main process; worker processes add their own.

upxo.meshing.gbconformant.pipeline.estimate.forecast(voxels: int, config: dict | None = None, history: Iterable[Observation] = ()) → Forecast[source]

The size, time and memory to expect for a run of voxels with config (default settings when omitted).

history holds earlier runs (see load_observations()); those that finished are used to scale the fitted law to this computer and to this kind of data.

upxo.meshing.gbconformant.pipeline.estimate.observation_from_folder(folder, manifest: dict | None = None) → Observation | None[source]

What the run in folder was, or None when it holds no manifest or no voxel count.

manifest is the folder’s already-read run_manifest.json, if the caller has it.

upxo.meshing.gbconformant.pipeline.estimate.load_observations(root: Path | None = None) → list[source]

The earlier runs under root (default: the data directory) that tell something about size and time.