Skip to content

psana.psexp.drp_ds

DataSource(drp=...) calls DrpDataSource when none of shmem, exp or files is given (see psana.datasource). As written, the first line after DataSourceBase.__init__ reads self.drp, which DataSourceBase does not set, so the call raises AttributeError (see Notes below). The rest of the class reads dgrams through DgramManager(["drp"]), and its runs() yields one RunDrp (see psana.psexp.run) for each BeginRun. The constructor also reads attributes of the drp keyword argument; the other keyword arguments are read by DataSourceBase.

See DRP and event building.

psana.psexp.drp_ds

Define DrpDataSource, the data source that reads dgrams from the DRP through DgramManager(["drp"]).

DrpDataSource

DrpDataSource(*args, **kwargs)

Bases: DataSourceBase

Data source that reads dgrams from the DRP shared memory and message queues.

The object given as drp supplies the segment, supervisor flag, worker number, tcp and ipc socket names and Prometheus config directory; worker 0 is the publisher. The constructor makes PUB/SUB zmq sockets from those flags (supervisor publisher: tcp PUB and ipc PUB; other publisher: tcp SUB and ipc PUB; non-publishers: ipc SUB), a SmallData object and the DgramManager, and starts the Prometheus HTTP exposer.

Notes

The first line after the base constructor reads self.drp, which DataSourceBase.__init__ in this file version does not set, so as written it raises AttributeError unless the attribute is set elsewhere.

runs

runs()

Yield a RunDrp for each BeginRun read from the DRP, then delete the zmq sockets.

Each run also gets the supervisor and publisher flags, the tcp PUB socket (supervisor publisher only) and the ipc PUB socket (publisher only). Iteration ends when the DgramManager stops before another BeginRun; the sockets are deleted afterwards, which the code comment says avoids "Address already in use" when they are recreated.

is_mpi

is_mpi()

Return False.