Skip to content

psana.psexp.serial_ds

SerialDataSource is returned by DataSource(exp=..., run=...) when PS_PARALLEL=none or when the job has only one MPI rank (see psana.datasource). It reads the runs on a single process. The constructor builds the run-number list (every run found in the xtc directory when run is not given), finds the small-data and big-data files of the first run, reads the Configure dgrams from the small-data files, and opens the big-data files with a DgramManager. runs() yields one RunSerial (see psana.psexp.run) for each BeginRun. Keyword arguments are read by DataSourceBase.

See DataSource, Run and the event loop.

psana.psexp.serial_ds

Define SerialDataSource, the data source that reads an experiment's runs on a single process.

SerialDataSource

SerialDataSource(*args, **kwargs)

Bases: DataSourceBase

Data source for an experiment (exp, optional run) read on a single process.

The constructor builds the run-number list (all runs found in the xtc directory if run is not given), creates a SmallData object, publishes run info for psplot_live when psmon_publish is set, sets up the first run, and starts the Prometheus client. Setting up a run finds its smalldata and bigdata files, applies the detector selection, opens the smalldata files with a SmdReaderManager (whose first dgrams are the configs), and opens the bigdata files with a DgramManager.

runs

runs()

Yield a RunSerial for each BeginRun found in the smalldata files.

When the current run's smalldata files have no more BeginRun dgrams, the next run number is set up and searched; iteration stops when no run numbers remain or a newly set-up run has no BeginRun. Each run gets the experiment, run number and timestamp from the BeginRun dgram, plus dsparms, the DgramManager, the SmdReaderManager, the configs and the BeginRun dgrams.

is_mpi

is_mpi()

Return False.