solprop.backends.sessions#

The run layer’s one door to a backend’s sessions (SEP 47 phases 2 to 5).

start_session() starts a run through the backend’s own preparation shape (SEP 47 section 5.2), backend.prepare(problem, request).start(start, ...), so a backend chooses its session and nothing here names one. The NumPy reference’s prepared execution opens its own session (solprop.backends.host.session.HostSession); a native backend’s (solprop_native.session.NativePrepared) opens the native execution session (solprop_native.session.NativeSession), on a CPU or a device build alike, which refuses by name, before the start is loaded, what it does not run.

Functions

start_session(backend, problem, request, ...)

Start the session that serves backend for one run.

solprop.backends.sessions.start_session(backend, problem, request, start, *, listener=None, started=None, stop=None, owns=True)[source]#

Start the session that serves backend for one run.

Parameters:
backendsolprop.backends.protocol.Backend

The backend, constructed for problem. A backend reused from an earlier run is loaded again from start, which restores everything a march reads.

problemsolprop.translate.problem.PropagationProblem

The translated problem.

requestsolprop.translate.run_request.RunRequest

The run’s policies.

startsolprop.backends.session.Start

Where the run starts; the session takes its field.

listenercallable or None, optional

Called with each attempt as it is made, for a progress reporter.

startedcallable or None, optional

Called with the start, the end and the plane count when propagation begins.

stopsolprop.log.StopFlag or None, optional

The run’s stop token.

ownsbool, optional

Whether closing the session closes the backend.

Returns:
solprop.backends.session.RunSession

The session the backend’s prepared execution opens: the native session (solprop_native.session.NativeSession) for a native backend, and a HostSession for a reference backend.