solprop.calibration.first_use#

Calibrating automatically on first use (SEP 46 sections 5 and 6.10).

Under SOLPROP_CALIBRATION=auto, the default, the first native workspace built in an allocation with no row in its machine’s profile first runs the quick calibration, about 30 s, after a CalibrationNotice. A process that had not loaded the native extension yet then takes the whole new profile when it does; one that had applies the new workspace settings that hold under the process settings it started with, and the rest from its next process. Importing the native backend never calibrates.

A scan calibrates its workers’ allocation at the standard level before it starts them (for_workers()), unless a standard or thorough row already matches; a worker never calibrates. Concurrent first runs on one host wait for the one that holds the calibration claim, up to its deadline, then use its profile. A busy machine’s inconclusive calibration publishes nothing, and auto tries again after a day.

Module Attributes

ROLE

Set to worker in a scan's workers, which never calibrate.

RETRY_SECONDS

How long auto waits after an inconclusive calibration before trying again.

Functions

ensure([environ])

Calibrate quickly before a first native workspace, if this allocation needs it.

for_workers(cpus[, environ])

Calibrate a scan's workers' allocation at the standard level, if it needs it.

solprop.calibration.first_use.RETRY_SECONDS = 86400.0#

How long auto waits after an inconclusive calibration before trying again.

solprop.calibration.first_use.ROLE = 'SOLPROP_CALIBRATION_ROLE'#

Set to worker in a scan’s workers, which never calibrate.

solprop.calibration.first_use.ensure(environ=None)[source]#

Calibrate quickly before a first native workspace, if this allocation needs it.

A no-op unless SOLPROP_CALIBRATION=auto, in a process that is not a scan’s worker, on a CPU build, with no row for its allocation, no inconclusive attempt in the last day and nobody else calibrating it; once per process. A process that has already loaded the native extension then refreshes its profile.

Parameters:
environMapping[str, str] or None, optional

The environment; the process’s when None.

Returns:
solprop.calibration.controller.CalibrationReport or None

The quick calibration’s report, or None when none ran.

solprop.calibration.first_use.for_workers(cpus, environ=None)[source]#

Calibrate a scan’s workers’ allocation at the standard level, if it needs it.

Run by the scan’s parent before its workers start, in children pinned like one worker; the other partitions stay idle meanwhile, so caches and memory bandwidth are less loaded than in the scan, which the row’s evidence records.

Parameters:
cpussequence of int

One worker’s CPUs.

environMapping[str, str] or None, optional

The environment; the process’s when None.

Returns:
solprop.calibration.controller.CalibrationReport or None

The report, or None when a standard or thorough row already matches or nothing may be measured.