Skip to content

psana.psexp.shmem_ds

ShmemDataSource is returned by DataSource(shmem=tag). It reads built events from a shared-memory server (the DAQ's monitoring event builder monReqServer, or the shmemServer test tool) through DgramManager(["shmem"], tag=...), and its runs() yields RunShmem objects. The optional supervisor / supervisor_ip_addr arguments let one process fetch calibration constants and broadcast them to the others over ZMQ.

See Shared memory and live analysis.

psana.psexp.shmem_ds

Define ShmemDataSource, the data source that reads dgrams from shared memory.

ShmemDataSource

ShmemDataSource(*args, **kwargs)

Bases: DataSourceBase

Data source that reads dgrams from a shared-memory server through DgramManager(["shmem"]).

The constructor passes the keyword arguments to DataSourceBase.__init__, uses shmem as the shmem client tag, turns off smalldata-file reading, creates a SmallData object and the DgramManager, and starts the Prometheus client. If supervisor is given, a PUB socket is bound at tcp://<supervisor_ip_addr> when it is 1 and a SUB socket is connected there otherwise; the code comment says these sockets broadcast calibration constants, and they are passed to each run.

runs

runs()

Yield a RunShmem for each BeginRun read from shared memory.

Each run gets the experiment, run number and timestamp from the BeginRun dgram, this data source's dsparms, DgramManager, configs and BeginRun dgrams, and the supervisor value with the PUB socket (supervisor 1) or SUB socket (supervisor 0). Iteration ends when the DgramManager stops before another BeginRun is found.

is_mpi

is_mpi()

Return False.